X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fcache_functions.php;h=4e12fb90c3e20968167f84a2b39df891baf23128;hb=7b9f2d4c956e37c4c079c1e612ecd6a7947e7e05;hp=15adc4680619d683518bb041cddce11807b4e788;hpb=7ce379f8009cb988e0af74c5e5bf6f8ddb6de37b;p=mailer.git
diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php
index 15adc46806..4e12fb90c3 100644
--- a/inc/libs/cache_functions.php
+++ b/inc/libs/cache_functions.php
@@ -112,7 +112,7 @@ class CacheSystem {
$this->storeExtensionVersion("cache");
} else {
// Cannot create file
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
}
@@ -142,7 +142,7 @@ class CacheSystem {
}
} else {
// Cannot create file
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
}
@@ -178,7 +178,7 @@ class CacheSystem {
$cache_version = null;
// Load cache file
- require_once($this->inc);
+ LOAD_INC_ONCE($this->inc);
// Is there an array?
if (is_array($data)) {
@@ -205,7 +205,7 @@ class CacheSystem {
}
} else {
// Cache file not found or not readable
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->inc.CACHE_CANNOT_LOAD_2);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->inc.CACHE_CANNOT_LOAD_2);
}
}
@@ -228,12 +228,9 @@ class CacheSystem {
$this->rebuilt[$this->name] = true;
} else {
// Not removed!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->inc.CACHE_CANNOT_UNLINK_2);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->inc.CACHE_CANNOT_UNLINK_2);
}
- } else {
- // Does not exist!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
- }
+ } // END - if
}
// Unused method:
@@ -262,7 +259,7 @@ class CacheSystem {
}
} else {
// Cannot write to cache!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
}
@@ -286,7 +283,7 @@ class CacheSystem {
} // END - foreach
} else {
// Cannot write array!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
}
@@ -323,7 +320,7 @@ class CacheSystem {
} // END - if
} else {
// Cannot write to cache!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
}
@@ -341,7 +338,7 @@ class CacheSystem {
//* DEBUG: */ print __METHOD__."(".__LINE__."): {$this->name} - {$ext_name}={$ext_ver}
\n";
} else {
// Cannot create file
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
}
@@ -397,22 +394,25 @@ class CacheSystem {
}
// Destroy the cache on extension changes
-function FILTER_CACHE_DESTROY_ON_EXT_CHANGE () {
+function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
global $cacheInstance;
- // Update cache
+ // Remove cache
if (EXT_IS_ACTIVE("cache")) {
if ($cacheInstance->loadCacheFile("config")) $cacheInstance->destroyCacheFile();
if ($cacheInstance->loadCacheFile("extensions")) $cacheInstance->destroyCacheFile();
if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
} // END - if
+
+ // Return it
+ return $data;
}
// Destroy the cache on changing admin
function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () {
global $cacheInstance;
- // Update cache
+ // Remove cache
if (EXT_IS_ACTIVE("cache")) {
if ($cacheInstance->loadCacheFile("admins")) $cacheInstance->destroyCacheFile();
} // END - if
@@ -424,15 +424,22 @@ function FILTER_CACHE_DESTROY_ALL () {
// Remove cache
if (EXT_IS_ACTIVE("cache")) {
- if ($cacheInstance->loadCacheFile("admins")) $cacheInstance->destroyCacheFile();
- if ($cacheInstance->loadCacheFile("config")) $cacheInstance->destroyCacheFile();
- if ($cacheInstance->loadCacheFile("extensions")) $cacheInstance->destroyCacheFile();
- if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
- if ($cacheInstance->loadCacheFile("refdepths")) $cacheInstance->destroyCacheFile();
- if ($cacheInstance->loadCacheFile("refsystem")) $cacheInstance->destroyCacheFile();
- if ($cacheInstance->loadCacheFile("themes")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("admins")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("admins_acls")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("config")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("extensions")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("refdepths")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("refsystem")) $cacheInstance->destroyCacheFile();
+ if ($cacheInstance->loadCacheFile("themes")) $cacheInstance->destroyCacheFile();
} // END - if
}
+// Filter for purging entire admin menu cache
+function FILTER_CACHE_PURGE_ADMIN_MENU () {
+ // Just call the function
+ CACHE_PURGE_ADMIN_MENU();
+}
+
//
?>