Extension ext-coupon continued, naming convention, many improvements:
[mailer.git] / inc / filter / cache_filter.php
index ec708e1ce01190c7f0db384d75399775b6dd0e68..dd9d22b7d8be6df9dde9e6f4d6e02dfd163ca0b5 100644 (file)
@@ -43,34 +43,48 @@ if (!defined('__SECURITY')) {
 // Destroy the cache on extension changes
 function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
        // Return the data anyway if there is no cache extension
-       if (!isCacheInstanceValid()) return $data;
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+       if (!isCacheInstanceValid()) {
+               return false;
+       } // END - if
 
        // Remove cache
        foreach (array('config','extension','filter','modules') as $cache) {
-               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
+                       $GLOBALS['cache_instance']->removeCacheFile();
+               } // END - if
        } // END - foreach
 
        // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
        return $data;
 }
 
 // Destroy the cache on changing admin
 function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) {
        // Skip this step if the cache instance is not there
-       if (!isCacheInstanceValid()) return false;
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+       if (!isCacheInstanceValid()) {
+               return false;
+       } // END - if
 
        // Remove cache
-       if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile();
+       if ($GLOBALS['cache_instance']->loadCacheFile('admin')) {
+               $GLOBALS['cache_instance']->removeCacheFile();
+       } // END - if
 
        // Return the data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
        return $data;
 }
 
 // Destroy all cache files
-function FILTER_CACHE_DESTROY_ALL () {
+function FILTER_CACHE_DESTROY_ALL ($data) {
        // Skip this step if the cache instance is not there
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
-       if (!isCacheInstanceValid()) return false;
+       if (!isCacheInstanceValid()) {
+               return false;
+       } // END - if
 
        // Remove cache files
        foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) {
@@ -81,16 +95,26 @@ function FILTER_CACHE_DESTROY_ALL () {
                        $GLOBALS['cache_instance']->removeCacheFile();
                } // END - if
        } // END - foreach
+
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $data;
 }
 
 // Filter for purging 'filter' cache
-function FILTER_CACHE_DESTROY_FILTER () {
+function FILTER_CACHE_DESTROY_FILTER ($data) {
        // Skip this step if the cache instance is not there
-       if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false;
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+       if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) {
+               return false;
+       } // END - if
 
        // Remove cache files
-       if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile();
+       if ($GLOBALS['cache_instance']->loadCacheFile('filter')) {
+               $GLOBALS['cache_instance']->removeCacheFile();
+       } // END - if
+
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $data;
 }
 
 // [EOF]