From f1eed778e47604670e186d48c02659050aadf566 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 7 Jun 2010 22:14:04 -0700 Subject: Tweak the test setup code to always copy database.php; something is going wrong that's nuking test/var/database.php -- I'll figure that out, but in the meantime we can make this code more robust. --- index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index dbd17149..4ef3d943 100644 --- a/index.php +++ b/index.php @@ -64,11 +64,12 @@ if (PHP_SAPI == "cli") { case "test": array_splice($_SERVER["argv"], 1, 1, "gallery_unit_test"); define("TEST_MODE", 1); - define("VARPATH", realpath("test/var") . "/"); - if (!is_dir("test/var/logs")) { + if (!is_dir("test/var")) { + @mkdir("test/var", 0777, true); @mkdir("test/var/logs", 0777, true); - @copy("var/database.php", VARPATH . "database.php"); } + @copy("var/database.php", "test/var/database.php"); + define("VARPATH", realpath("test/var") . "/"); break; default: -- cgit v1.2.3