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/forums.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'forum/utils/forums.php') diff --git a/forum/utils/forums.php b/forum/utils/forums.php index 85e977b..1ee2eb9 100644 --- a/forum/utils/forums.php +++ b/forum/utils/forums.php @@ -100,6 +100,24 @@ class Forums { { $this->file = $file; if(file_exists($file)) $this->read(); + else { + if(!file_exists(dirname($file))) { + if(!mkdir(dirname($file))) { + echo"Could not create directory: " . dirname($file); + die(); + } + } else { + if(!is_dir(dirname($file))) { + echo dirname($file) . " exists but is not a directory"; + die(); + } else { + if(!is_readable(dirname($file)) || !is_writeable(dirname($file)) || !is_executable(dirname($file))) { + echo dirname($file) . " exists but does not have the correct permissions. (r/w/x)"; + die(); + } + } + } + } } } -- cgit v1.2.3