From 2fcc8a388b27747bb534f0beba18114720f9b899 Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 12 Oct 2008 08:55:05 +0000 Subject: Now files, forums and image cache create their storage dirs themselves, instead of createentities (when they do not already exists that is...) --- forum/utils/files.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'forum/utils/files.php') 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 -- cgit v1.2.3