X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fclasses%2Fcachesystem.class.php;h=587a5281a14b8ad033f1a6c2c1050d63948bdf27;hp=ed67f4a32789ad60ce93fc3491e8fd924a2b52d5;hb=4f24ca9ad8ff2ff19279f1b39ffdf458b1a3f3d6;hpb=d712e3a5c13266fc0017f6724e7cb372442c7cc3 diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index ed67f4a327..587a5281a1 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -42,23 +42,34 @@ if (!defined('__SECURITY')) { // Caching class class CacheSystem { - // Define variables - var $ret = 'init'; + // Status code + var $statusCode = 'init'; + + // Full-qualified filename var $fqfn = ''; + + // Resource to cache file var $pointer = false; + + // Data array from cache var $data = array(); + + // Version data from cache var $version = array(); + + // Cache name var $name = ''; var $rebuilt = array(); + + // File extension var $extension = '.cache'; - var $statusDone = 'done'; var $status = array(); var $readable = array(); // Constructor function CacheSystem () { // Failed is the default - $this->ret = 'failed'; + $this->setStatusCode('failed'); // Remeber path @@ -67,10 +78,10 @@ class CacheSystem { // Is there a .htaccess file? if (isFileReadable(getCachePath() . '.htaccess')) { // All done! - $this->ret = $this->statusDone; + $this->setStatusCode('done'); } else { // Stop! Set a .htaccess file first - $this->ret = 'htaccess'; + $this->setStatusCode('htaccess'); } } // END - if } @@ -100,7 +111,7 @@ class CacheSystem { // Initializes the cache file function init () { // This will destory an existing cache file! - if ($this->ret == $this->statusDone) { + if ($this->getStatusCode() == 'done') { // Reset read status $this->resetCacheReadStatus(); @@ -337,7 +348,7 @@ class CacheSystem { // Unused method: function removeEntry ($search, $data, $array) { - if ($this->status[$this->name] == $this->statusDone) { + if ($this->status[$this->name] == 'done') { // Load cache into dummy array $dummy = $this->getArrayFromCache(); @@ -374,7 +385,7 @@ class CacheSystem { foreach($v as $k2 => $v2) { // Put every array element in a row... $LINE .= $this->rewriteEntry($k, $v2); - } + } // END - foreach } else { // Single line found $LINE = $this->rewriteEntry($k, $v); @@ -391,7 +402,7 @@ class CacheSystem { // Unused method function replaceEntry ($search, $replace, $search_key, $array) { - if ($this->status[$this->name] == $this->statusDone) { + if ($this->status[$this->name] == 'done') { // Load cache into dummy array $dummy = $this->getArrayFromCache(); @@ -526,9 +537,14 @@ class CacheSystem { return $line; } - // Getter for cache status - function getStatus () { - return $this->ret; + // Getter for cache status code + function getStatusCode () { + return $this->statusCode; + } + + // Setter for cache status code + function setStatusCode ($status) { + $this->statusCode = $status; } // Checks wether the current cache file is readable