Code style changed, ext-user continued:
[mailer.git] / inc / classes / cachesystem.class.php
index 713c1696ce14d7247cff5d4d6d4c35ae859d5c3e..df3c14578cd5f107ab04269dba99f960aeb1fe99 100644 (file)
@@ -49,7 +49,7 @@ class CacheSystem {
        var $fqfn = '';
 
        // Resource to cache file
-       var $pointer = false;
+       var $pointer = FALSE;
 
        // Data array from cache
        var $data = array();
@@ -174,7 +174,7 @@ class CacheSystem {
                                        // Filter
                                        $GLOBALS['cache_array']['filter']['chains'][$data['filter_name']][$data['filter_function']] = $data['filter_active'];
                                        $GLOBALS['cache_array']['filter']['counter'][$data['filter_name']][$data['filter_function']] = $data['filter_counter'];
-                                       $GLOBALS['cache_array']['filter']['loaded'][$data['filter_name']][$data['filter_function']] = true;
+                                       $GLOBALS['cache_array']['filter']['loaded'][$data['filter_name']][$data['filter_function']] = TRUE;
                                } elseif ($this->name == 'modules') {
                                        // Modules
                                        $GLOBALS['cache_array']['modules'][$k][$data['module']] = $v;
@@ -224,10 +224,10 @@ class CacheSystem {
                                        $this->finalize();
 
                                        // Remove cache
-                                       $this->removeCacheFile(true);
+                                       $this->removeCacheFile(TRUE);
 
                                        // Unsupported/unhandled cache detected
-                                       reportBug(__METHOD__, __LINE__, 'Unsupported cache ' . $this->name . ' detected, data=' . print_r($data, true) . ',k=' . $k . ',v=' . $v);
+                                       reportBug(__METHOD__, __LINE__, 'Unsupported cache ' . $this->name . ' detected, data=' . print_r($data, TRUE) . ',k=' . $k . ',v=' . $v);
                                }
 
                                // Write cache line to file
@@ -259,7 +259,7 @@ class CacheSystem {
 
                        // Remove pointer and status
                        unset($this->status[$this->name]);
-                       $this->pointer = false;
+                       $this->pointer = FALSE;
                        //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'name=' . $this->name . ' - FINALIZED!');
                } // END - if
        }
@@ -310,7 +310,7 @@ class CacheSystem {
        }
 
        // Destroy an existing cache file
-       function removeCacheFile ($force = false) {
+       function removeCacheFile ($force = FALSE) {
                // Reset read status
                $this->resetCacheReadStatus();
 
@@ -320,7 +320,7 @@ class CacheSystem {
                // Is the cache file not yet rebuilt?
                if ((!isset($this->rebuilt[$this->name])) && ($this->isCacheReadable())) {
                        // Only run in regular output mode
-                       if ((!isHtmlOutputMode()) && ($force === false)) {
+                       if ((!isHtmlOutputMode()) && ($force === FALSE)) {
                                // Debug message if allowed
                                if (isDebugModeEnabled()) {
                                        // Debug message
@@ -352,7 +352,7 @@ class CacheSystem {
                                // The cache does no longer exist so kill the content
                                unset($this->data[$this->name]);
                                unset($this->version[$this->name]);
-                               $this->rebuilt[$this->name] = true;
+                               $this->rebuilt[$this->name] = TRUE;
                        } else {
                                // Not removed!
                                reportBug(__METHOD__, __LINE__, '{%message,CACHE_CANNOT_UNLINK=' . $this->name . '%}');
@@ -424,7 +424,7 @@ class CacheSystem {
                        if ((is_array($dummy)) && (isset($dummy[$search])) && (is_array($dummy[$search]))) {
                                // Search for key in array
                                $key_found = array_key_exists($search_key, $dummy[$search]);
-                               if ($key_found == true) {
+                               if ($key_found == TRUE) {
                                        $key = $search_key;
                                        // Key (hopefully) found?
                                        foreach ($dummy as $a => $v) {
@@ -464,7 +464,7 @@ class CacheSystem {
                                $this->version[$this->name][$ext_name] = $ext_ver;
 
                                // Write cache line to file
-                               $this->writeLine($this->rewriteEntry($ext_name, $ext_ver, 'version', true));
+                               $this->writeLine($this->rewriteEntry($ext_name, $ext_ver, 'version', TRUE));
                        } // END - if
                        //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'name=' . $this->name . ',ext_name=' . $ext_name . ',ext_ver=' . $ext_ver);
                } else {
@@ -478,7 +478,7 @@ class CacheSystem {
                // Check cache
                if (!isset($GLOBALS[__METHOD__][$ext_name])) {
                        // Does never match by default
-                       $GLOBALS[__METHOD__][$ext_name] = false;
+                       $GLOBALS[__METHOD__][$ext_name] = FALSE;
 
                        // Compare only if installed
                        if (isExtensionInstalled($ext_name)) {
@@ -494,11 +494,11 @@ class CacheSystem {
                                        logDebugMessage(__METHOD__, __LINE__, 'Cache ' . $this->name . ' has missing version entry for extension ' . $ext_name . '! Purging cache...');
        
                                        // Remove the cache file
-                                       $this->removeCacheFile(true);
+                                       $this->removeCacheFile(TRUE);
                                }
                        } else {
                                // Not installed, does always match
-                               $GLOBALS[__METHOD__][$ext_name] = true;
+                               $GLOBALS[__METHOD__][$ext_name] = TRUE;
                        }
                } else {
                        // Cache entry found, log debug message
@@ -511,12 +511,12 @@ class CacheSystem {
 
        // Rewrit the entry so it can be stored in cache file
        // @TODO Add support for more types which break in last else-block
-       function rewriteEntry ($key, $value, $prefix = 'data', $single = false) {
+       function rewriteEntry ($key, $value, $prefix = 'data', $single = FALSE) {
                // Default is not single entry
                $extender = '[]';
 
                // Add only for single array entry?
-               if ($single === true) {
+               if ($single === TRUE) {
                        $extender = '';
                } // END - if
 
@@ -532,12 +532,12 @@ class CacheSystem {
                        $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = NULL;';
                } elseif (is_bool($value)) {
                        // Boolean value
-                       if ($value === true) {
+                       if ($value === TRUE) {
                                // True
-                               $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = true;';
+                               $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = TRUE;';
                        } else {
                                // False
-                               $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = false;';
+                               $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = FALSE;';
                        }
                } elseif (isset($value[0])) {
                        // These lines needs fixing