From 4ba02ad720de146ad2558ae67870986925e0a2a2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 7 Jun 2010 22:03:54 -0700 Subject: 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. --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'index.php') 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: -- cgit v1.2.3