summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-07 22:14:04 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-07 22:14:04 -0700
commitf1eed778e47604670e186d48c02659050aadf566 (patch)
tree5ee509f5fb99e0ebb42fb62cd14cfe41f6bbb429
parent4ba02ad720de146ad2558ae67870986925e0a2a2 (diff)
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.
-rw-r--r--index.php7
1 files changed, 4 insertions, 3 deletions
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: