]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/cachesystem.class.php
Next batch of fixed language ids (renamed, see ticket #219)
[mailer.git] / inc / classes / cachesystem.class.php
index aaaebe605205fd0b843abcb2761c5b5f5a1e5333..dd991721182406a698395cd3d2d51400243d65ee 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -125,7 +125,7 @@ class CacheSystem {
                        $this->writeLine('<?php');
                } else {
                        // Cannot create file
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
+                       debug_report_bug(__METHOD__, __LINE__, 'Problems with cache directory detected, getStatusCode()=' . $this->getStatusCode());
                }
        }
 
@@ -189,10 +189,10 @@ class CacheSystem {
                                        // Access control lines
                                        $GLOBALS['cache_array']['admin_acls'][$k][$data['admin_id']][] = $v;
                                } elseif ($this->name == 'refdepths') {
-                                       // Referal levels
+                                       // Referral levels
                                        $GLOBALS['cache_array']['refdepths'][$k][$data['id']] = $v;
                                } elseif ($this->name == 'refsystem') {
-                                       // Referal system
+                                       // Referral system
                                        $GLOBALS['cache_array']['refsystem'][$k][$data['id']] = $v;
                                } elseif ($this->name == 'revision') {
                                        // Revision data
@@ -207,6 +207,12 @@ class CacheSystem {
                                } elseif ($this->name == 'imprint') {
                                        // Imprint
                                        $GLOBALS['cache_array']['imprint'][$k][$data['imprint_id']] = $v;
+                               } elseif ($this->name == 'points_data') {
+                                       // Table 'points_data'
+                                       $GLOBALS['cache_array']['points_data'][$k][$data['id']] = $v;
+                               } elseif ($this->name == 'earning') {
+                                       // Table 'earning'
+                                       $GLOBALS['cache_array']['earning'][$k][$data['earning_id']] = $v;
                                } elseif (is_array($v)) {
                                        // Serialize and BASE64-encode the array
                                        $v = base64_encode(serialize($v));
@@ -226,7 +232,7 @@ class CacheSystem {
                        } // END - foreach
                } else {
                        // Cannot create file
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
+                       debug_report_bug(__METHOD__, __LINE__, 'Problem with cache detected, no resource! pointer[]=' . gettype($this->pointer));
                }
        }
 
@@ -251,7 +257,7 @@ class CacheSystem {
                        // Remove pointer and status
                        unset($this->status[$this->name]);
                        $this->pointer = false;
-                       //* DEBUG: */ debugOutput(__METHOD__ . '(<font color="#0000aa">' . __LINE__.'</font>): '.$this->name.' - FINALIZED!');
+                       //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'name=' . $this->name . ' - FINALIZED!');
                } // END - if
        }
 
@@ -290,8 +296,7 @@ class CacheSystem {
                        } // END - if
                } else {
                        // Cache file not found or not readable
-                       debug_report_bug(__METHOD__, __LINE__, $this->name);
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMaskedMessage('CACHE_CANNOT_LOAD', $this->fqfn));
+                       debug_report_bug(__METHOD__, __LINE__, '{%message,CACHE_CANNOT_LOAD=' . $this->name . '%}');
 
                        // Try to remove it
                        $this->removeCacheFile();
@@ -347,7 +352,7 @@ class CacheSystem {
                                $this->rebuilt[$this->name] = true;
                        } else {
                                // Not removed!
-                               addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMaskedMessage('CACHE_CANNOT_UNLINK', $this->fqfn));
+                               debug_report_bug(__METHOD__, __LINE__, '{%message,CACHE_CANNOT_UNLINK=' . $this->name . '%}');
                        }
                } // END - if
        }
@@ -375,10 +380,10 @@ class CacheSystem {
 
                                // Close cache file
                                $this->finalize();
-                       }
+                       } // END - if
                } else {
                        // Cannot write to cache!
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
+                       debug_report_bug(__METHOD__, __LINE__, 'Problem with cache detected: Unexpected status ' . $this->status[$this->name]);
                }
        }
 
@@ -402,7 +407,7 @@ class CacheSystem {
                        } // END - foreach
                } else {
                        // Cannot write array!
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
+                       debug_report_bug(__METHOD__, __LINE__, 'Problem with cache detected: pointer is not resource! pointer[]=' . gettype($this->pointer));
                }
        }
 
@@ -439,7 +444,7 @@ class CacheSystem {
                        } // END - if
                } else {
                        // Cannot write to cache!
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
+                       debug_report_bug(__METHOD__, __LINE__, 'Problem with cache detected: Unexpected status ' . $this->status[$this->name]);
                }
        }
 
@@ -458,10 +463,10 @@ class CacheSystem {
                                // Write cache line to file
                                $this->writeLine($this->rewriteEntry($ext_name, $ext_ver, 'version', true));
                        } // END - if
-                       //* DEBUG: */ debugOutput(__METHOD__ . '(<font color="#0000aa">' . __LINE__ . '</font>): '.$this->name.' - '.$ext_name.'='.$ext_ver);
+                       //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'name=' . $this->name . ',ext_name=' . $ext_name . ',ext_ver=' . $ext_ver);
                } else {
                        // Cannot create file
-                       addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
+                       debug_report_bug(__METHOD__, __LINE__, 'Problem with cache detected: pointer is not resource! pointer[]=' . gettype($this->pointer));
                }
        }
 
@@ -521,7 +526,7 @@ class CacheSystem {
                        $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . " = '" . escapeQuotes($value) . "';";
                } elseif (is_null($value)) {
                        // Null
-                       $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = null;';
+                       $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = NULL;';
                } elseif (is_bool($value)) {
                        // Boolean value
                        if ($value === true) {