]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/cachesystem.class.php
Naming convention on language strings applied, ACL handling fixed:
[mailer.git] / inc / classes / cachesystem.class.php
index 587a5281a14b8ad033f1a6c2c1050d63948bdf27..8f0b7e7175fbacd7b4f08b11c64cf22c31b454e4 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -65,18 +65,20 @@ class CacheSystem {
        var $extension = '.cache';
        var $status = array();
        var $readable = array();
+       var $fullPath = '';
 
        // Constructor
        function CacheSystem () {
+               // Construct full path
+               $this->fullPath = getPath() . getCachePath();
+
                // Failed is the default
                $this->setStatusCode('failed');
 
-               // Remeber path
-
                // Check if path exists
-               if (isDirectory(getCachePath())) {
+               if (isDirectory($this->fullPath)) {
                        // Is there a .htaccess file?
-                       if (isFileReadable(getCachePath() . '.htaccess')) {
+                       if (isFileReadable($this->fullPath . '.htaccess')) {
                                // All done!
                                $this->setStatusCode('done');
                        } else {
@@ -92,7 +94,7 @@ class CacheSystem {
                $this->name = $cacheName;
 
                // Construct FQFN (full qualified file name)
-               $this->fqfn = getCachePath() . $cacheName . $this->extension;
+               $this->fqfn = $this->fullPath . $cacheName . $this->extension;
 
                // Check if file exists and if version matches
                if (!isset($this->status[$cacheName])) {
@@ -183,6 +185,9 @@ class CacheSystem {
                                        } else {
                                                $GLOBALS['cache_array']['admin'][$k][$data['admin_id']] = $v;
                                        }
+                               } elseif ($this->name == 'admin_acls') {
+                                       // Access control lines
+                                       $GLOBALS['cache_array']['admin_acls'][$k][$data['admin_id']][] = $v;
                                } elseif ($this->name == 'refdepths') {
                                        // Referal levels
                                        $GLOBALS['cache_array']['refdepths'][$k][$data['id']] = $v;
@@ -212,7 +217,7 @@ class CacheSystem {
                                        // Remove cache
                                        $this->removeCacheFile(true);
 
-                                       // Unsupported cache found!
+                                       // Unsupported/unhandled cache detected
                                        debug_report_bug(__METHOD__, __LINE__, 'Unsupported cache ' . $this->name . ' detected.');
                                }
 
@@ -382,7 +387,7 @@ class CacheSystem {
                                if (is_array($v)) {
                                        // Multi line(s) found
                                        $LINE = '';
-                                       foreach($v as $k2 => $v2) {
+                                       foreach ($v as $k2 => $v2) {
                                                // Put every array element in a row...
                                                $LINE .= $this->rewriteEntry($k, $v2);
                                        } // END - foreach
@@ -476,7 +481,7 @@ class CacheSystem {
                                        // Does it match?
                                        $GLOBALS[__METHOD__][$ext_name] = ((isset($this->version[$this->name][$ext_name])) && ($this->version[$this->name][$ext_name] == $ext_ver));
                                } elseif ($this->isCacheReadable()) {
-                                       // No cache version found!
+                                       // No cache version found
                                        logDebugMessage(__METHOD__, __LINE__, 'Cache ' . $this->name . ' has missing version entry for extension ' . $ext_name . '! Purging cache...');
        
                                        // Remove the cache file