]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/cachesystem.class.php
A lot has been rewritten, ext-teams added, ext-forced continued:
[mailer.git] / inc / classes / cachesystem.class.php
index bee80767ac0581e642d07d739a122fb64e47f2db..7d722b121e489c20177117b568e37b951505054e 100644 (file)
@@ -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());
                }
        }
 
@@ -185,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;
@@ -223,7 +226,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));
                }
        }
 
@@ -248,7 +251,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
        }
 
@@ -287,8 +290,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();
@@ -330,6 +332,7 @@ class CacheSystem {
                        } // END - if
 
                        // Remove cache file from system
+                       //* DEBUG: */ debug_report_bug(__METHOD__, __LINE__, 'About to remove ' . basename($this->fqfn) . '!');
                        removeFile($this->fqfn);
 
                        // Reset read status
@@ -343,7 +346,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
        }
@@ -371,10 +374,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]);
                }
        }
 
@@ -398,7 +401,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));
                }
        }
 
@@ -435,7 +438,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]);
                }
        }
 
@@ -454,10 +457,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));
                }
        }
 
@@ -517,7 +520,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) {