Heavily rewritten API:
[mailer.git] / inc / libs / cache_functions.php
index bb24447efda1ab67f3b79ec8dd00bbce66048dec..1004594d625bef8b02329b9315b7a37b0fb682e2 100644 (file)
@@ -378,5 +378,28 @@ class CacheSystem {
                return $this->ret;
        }
 }
+
+// Destroy the cache on extension changes
+function FILTER_CACHE_DESTROY_ON_EXT_CHANGE () {
+       global $cacheInstance;
+
+       // Update cache
+       if (EXT_IS_ACTIVE("cache")) {
+               if ($cacheInstance->loadCacheFile("config"))           $cacheInstance->destroyCacheFile();
+               if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
+               if ($cacheInstance->loadCacheFile("mod_reg"))          $cacheInstance->destroyCacheFile();
+       } // END - if
+}
+
+// Destroy the cache on changing admin
+function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () {
+       global $cacheInstance;
+
+       // Update cache
+       if (EXT_IS_ACTIVE("cache")) {
+               if ($cacheInstance->loadCacheFile("admin")) $cacheInstance->destroyCacheFile();
+       } // END - if
+}
+
 //
 ?>