diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-18 03:12:00 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-18 03:12:00 +0000 |
commit | 245cb11c5855d023d9bd4f7e693f0eafaeb7deb7 (patch) | |
tree | 837d6e9c8a003e3917dd2b3d40e8506c01f710f6 /installer/data | |
parent | b60e790e905f754dfa3ad603cb15a5838aeca4ab (diff) |
Clean up the var directory creation script
Diffstat (limited to 'installer/data')
-rw-r--r-- | installer/data/init_var.php | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/installer/data/init_var.php b/installer/data/init_var.php index 6f83ac0e..76a1855a 100644 --- a/installer/data/init_var.php +++ b/installer/data/init_var.php @@ -1,24 +1,12 @@ <?php defined("SYSPATH") or die("No direct script access."); -function create_var_directories() { - if (!@mkdir("resizes");) { - throw new Exception("Unable to create directory 'resizes'"); - } - if (!@mkdir("g3_installer");) { - throw new Exception("Unable to create directory 'g3_installer'"); - } - if (!@mkdir("modules");) { - throw new Exception("Unable to create directory 'modules'"); - } - if (!@mkdir("uploads");) { - throw new Exception("Unable to create directory 'uploads'"); - } - if (!@mkdir("logs");) { - throw new Exception("Unable to create directory 'logs'"); - } - if (!@mkdir("albums");) { - throw new Exception("Unable to create directory 'albums'"); - } - if (!@mkdir("thumbs");) { - throw new Exception("Unable to create directory 'thumbs'"); +if (!file_exists(VARPATH)) { + if (!mkdir(VARPATH)) { + throw new Exception("Unable to create directory '" . VARPATH . "'"); + } + chmod(VARPATH, 0777); +} +foreach (array("resizes", "modules", "uploads", "logs", "albums", "thumbs") as $dir) { + if (!@mkdir($dir)) { + throw new Exception("Unable to create directory '$dir'"); } }
\ No newline at end of file |