diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-07 22:03:54 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-07 22:03:54 -0700 |
commit | 4ba02ad720de146ad2558ae67870986925e0a2a2 (patch) | |
tree | 2b252b61a4e413dbabb55936768939ffb2818727 /index.php | |
parent | 1d91e1b2dc8456681f9e38baaca1d191cff1ac7a (diff) |
Don't recreate test/var/logs if it already exists. This fixes a
rather circuitous problem where if we have a failure early enough in
the cycle, the failure is masked by our mkdir attempt. Even though we
use @ to mask the error, the error handler still picks it up and turns
it into an exception in Kohana_PHP_Exception::shutdown_handler() which
obscures the real problem.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -64,9 +64,11 @@ if (PHP_SAPI == "cli") { case "test": array_splice($_SERVER["argv"], 1, 1, "gallery_unit_test"); define("TEST_MODE", 1); - @mkdir("test/var/logs", 0777, true); define("VARPATH", realpath("test/var") . "/"); - @copy("var/database.php", VARPATH . "database.php"); + if (!is_dir("test/var/logs")) { + @mkdir("test/var/logs", 0777, true); + @copy("var/database.php", VARPATH . "database.php"); + } break; default: |