]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/cache_filter.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / filter / cache_filter.php
index 36bab764cc295b78d838e3f3b77413d46895da57..02b456d55579c7c8accaed9944cea885cf88ec77 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -45,14 +45,13 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($filterData) {
        // Return the data anyway if there is no cache extension
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
        if (!isCacheInstanceValid()) {
-               return false;
+               return FALSE;
        } // END - if
 
        // Remove cache
        foreach (array('config', 'extension', 'filter', 'modules', 'earning', 'points_data') as $cache) {
-               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
-                       $GLOBALS['cache_instance']->removeCacheFile();
-               } // END - if
+               // Rebuild cache
+               rebuildCache($cache);
        } // END - foreach
 
        // Return it
@@ -65,13 +64,11 @@ function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($filterData) {
        // Skip this step if the cache instance is not there
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
        if (!isCacheInstanceValid()) {
-               return false;
+               return FALSE;
        } // 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!');
@@ -83,17 +80,13 @@ function FILTER_CACHE_DESTROY_ALL ($filterData) {
        // Skip this step if the cache instance is not there
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
        if (!isCacheInstanceValid()) {
-               return false;
+               return FALSE;
        } // END - if
 
        // Remove cache files
-       foreach (array('admin', 'admin_acls', 'config', 'extension', 'earning', 'filter', 'imprint', 'modules', '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
+       foreach (array('admin', 'admin_acls', 'config', 'extension', 'earning', 'filter', 'imprint', 'modules', 'payments', 'points_data', 'refdepths', 'refsystem', 'themes') as $cache) {
+               // Rebuild it
+               rebuildCache($cache);
        } // END - foreach
 
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
@@ -105,13 +98,11 @@ function FILTER_CACHE_DESTROY_FILTER ($filterData) {
        // Skip this step if the cache instance is not there
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
        if ((!isCacheInstanceValid()) || ((isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') != 'Y'))) {
-               return false;
+               return FALSE;
        } // END - if
 
        // Remove cache files
-       if ($GLOBALS['cache_instance']->loadCacheFile('filter')) {
-               $GLOBALS['cache_instance']->removeCacheFile();
-       } // END - if
+       rebuildCache('filter', 'filter');
 
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
        return $filterData;