summaryrefslogtreecommitdiff
path: root/forum/utils/files.php
diff options
context:
space:
mode:
authordeva <deva>2008-10-12 08:55:05 +0000
committerdeva <deva>2008-10-12 08:55:05 +0000
commit2fcc8a388b27747bb534f0beba18114720f9b899 (patch)
tree52fe5737c6f2c43982cfedb10f2f58db1dd84c9d /forum/utils/files.php
parentb3bfcb9e6f512b2074dc69bf1af148ec4f4973d4 (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.php20
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