]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/cache_filter.php
Use rebuildCache() instead of loadCacheFile()/removeCacheFile()
[mailer.git] / inc / filter / cache_filter.php
index d675aa43bef46ab82edb495e5f5de5685609f864..706585fd49e40d3e2f6e59cc7017c613f12ac828 100644 (file)
@@ -50,11 +50,8 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($filterData) {
 
        // Remove cache
        foreach (array('config', 'extension', 'filter', 'modules', 'earning', 'points_data') as $cache) {
-               // Is this cache there?
-               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
-                       // Yes, then remove it
-                       $GLOBALS['cache_instance']->removeCacheFile();
-               } // END - if
+               // Rebuild cache
+               rebuildCache($cache);
        } // END - foreach
 
        // Return it
@@ -71,9 +68,7 @@ function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($filterData) {
        } // END - if
 
        // Remove cache
-       if ($GLOBALS['cache_instance']->loadCacheFile('admin')) {
-               $GLOBALS['cache_instance']->removeCacheFile();
-       } // END - if
+       rebuildCache('admin');
 
        // Return the data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
@@ -90,12 +85,8 @@ function FILTER_CACHE_DESTROY_ALL ($filterData) {
 
        // Remove cache files
        foreach (array('admin', 'admin_acls', 'config', 'extension', 'earning', 'filter', 'imprint', 'modules', 'payments', 'points_data', 'refdepths', 'refsystem', 'themes') as $cache) {
-               // Is the cache file readable?
-               // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
-               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
-                       // Remove the cache file
-                       $GLOBALS['cache_instance']->removeCacheFile();
-               } // END - if
+               // Rebuild it
+               rebuildCache($cache);
        } // END - foreach
 
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');