diff options
author | deva <deva> | 2008-10-12 08:55:05 +0000 |
---|---|---|
committer | deva <deva> | 2008-10-12 08:55:05 +0000 |
commit | 2fcc8a388b27747bb534f0beba18114720f9b899 (patch) | |
tree | 52fe5737c6f2c43982cfedb10f2f58db1dd84c9d /forum/utils/files.php | |
parent | b3bfcb9e6f512b2074dc69bf1af148ec4f4973d4 (diff) |
Now files, forums and image cache create their storage dirs themselves, instead of createentities (when they do not already exists that is...)
Diffstat (limited to 'forum/utils/files.php')
-rw-r--r-- | forum/utils/files.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/forum/utils/files.php b/forum/utils/files.php index 6cae023..c698ede 100644 --- a/forum/utils/files.php +++ b/forum/utils/files.php @@ -125,9 +125,25 @@ class Files { public function Files($file) { + global $PERMSTORE; + $this->file = $file; - $this->read(); - } + if(file_exists($file)) $this->read(); + if(!file_exists($PERMSTORE)) { + if(!mkdir($PERMSTORE)) { + echo"Could not create directory: " . $PERMSTORE; + die(); + } + } + if(!is_dir($PERMSTORE)) { + echo $PERMSTORE . " exists but is not a directory"; + die(); + } + if(!is_readable($PERMSTORE) || !is_writeable($PERMSTORE) || !is_executable($PERMSTORE)) { + echo $PERMSTORE . " exists but does not have the correct permissions. (r/w/x)"; + die(); + } + } } ?>
\ No newline at end of file |