More misc fixes and rewrites (sorry, lame description)
[mailer.git] / inc / libs / cache_functions.php
index 17910c97cdacc7c785655fae0f4b8e846a334187..a34313d1eb37053b5b06f6e32856b185d86909ad 100644 (file)
@@ -477,7 +477,7 @@ function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () {
 // Destroy all cache files
 function FILTER_CACHE_DESTROY_ALL () {
        // Skip this step if the cache instance is not there
-       DEBUG_LOG(__FUNCTION__, __LINE__, 'Called!');
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, 'Called!');
        if (!isCacheInstanceValid()) return false;
 
        // Remove cache files
@@ -490,7 +490,17 @@ function FILTER_CACHE_DESTROY_ALL () {
        if ($GLOBALS['cache_instance']->loadCacheFile('refsystem'))   $GLOBALS['cache_instance']->destroyCacheFile(false);
        if ($GLOBALS['cache_instance']->loadCacheFile('themes'))      $GLOBALS['cache_instance']->destroyCacheFile(false);
        if ($GLOBALS['cache_instance']->loadCacheFile('revision'))    $GLOBALS['cache_instance']->destroyCacheFile(false);
-       DEBUG_LOG(__FUNCTION__, __LINE__, 'Done!');
+       if ($GLOBALS['cache_instance']->loadCacheFile('filter'))      $GLOBALS['cache_instance']->destroyCacheFile(false);
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, 'Done!');
+}
+
+// Filter for purging 'filter' cache
+function FILTER_CACHE_DESTROY_FILTER () {
+       // Skip this step if the cache instance is not there
+       if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') == 'N')) return false;
+
+       // Remove cache files
+       if ($GLOBALS['cache_instance']->loadCacheFile('filter'))      $GLOBALS['cache_instance']->destroyCacheFile(false);
 }
 
 // Filter for purging entire admin menu cache