summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-07 22:03:54 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-07 22:03:54 -0700
commit4ba02ad720de146ad2558ae67870986925e0a2a2 (patch)
tree2b252b61a4e413dbabb55936768939ffb2818727
parent1d91e1b2dc8456681f9e38baaca1d191cff1ac7a (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.
-rw-r--r--index.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.php b/index.php
index 6ef215ab..dbd17149 100644
--- a/index.php
+++ b/index.php
@@ -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: