From: Roland Häder Date: Mon, 8 Nov 2010 01:50:32 +0000 (+0000) Subject: Naming convention applied X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4f24ca9ad8ff2ff19279f1b39ffdf458b1a3f3d6;p=mailer.git Naming convention applied --- 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 diff --git a/inc/functions.php b/inc/functions.php index 7676c1404d..9681a3020a 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2235,7 +2235,7 @@ function initCacheInstance () { $GLOBALS['cache_instance'] = new CacheSystem(); // Did it work? - if ($GLOBALS['cache_instance']->getStatus() != 'done') { + if ($GLOBALS['cache_instance']->getStatusCode() != 'done') { // Failed to initialize cache sustem addFatalMessage(__FUNCTION__, __LINE__, '(' . __LINE__ . '): {--CACHE_CANNOT_INITIALIZE--}'); } // END - if