X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter%2Fcache_filter.php;h=41549df5faa73d111c06daec0a3b3dcbb02f8d14;hb=a524135c24dd0a8fa359c9a92399467d50fd69e0;hp=dd9d22b7d8be6df9dde9e6f4d6e02dfd163ca0b5;hpb=964a3b539e335f6d70e7779630fd3d25fd38398d;p=mailer.git diff --git a/inc/filter/cache_filter.php b/inc/filter/cache_filter.php index dd9d22b7d8..41549df5fa 100644 --- a/inc/filter/cache_filter.php +++ b/inc/filter/cache_filter.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -41,80 +41,71 @@ if (!defined('__SECURITY')) { } // END - if // Destroy the cache on extension changes -function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { +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; + if (!isValidCacheInstance()) { + return FALSE; } // END - if // Remove cache - foreach (array('config','extension','filter','modules') as $cache) { - if ($GLOBALS['cache_instance']->loadCacheFile($cache)) { - $GLOBALS['cache_instance']->removeCacheFile(); - } // END - if + foreach (array('config', 'extension', 'filter', 'modules', 'earning', 'points_data') as $cache) { + // Rebuild cache + rebuildCache($cache); } // END - foreach // Return it //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); - return $data; + return $filterData; } // Destroy the cache on changing admin -function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) { +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; + if (!isValidCacheInstance()) { + 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!'); - return $data; + return $filterData; } // Destroy all cache files -function FILTER_CACHE_DESTROY_ALL ($data) { +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; + if (!isValidCacheInstance()) { + return FALSE; } // END - if // Remove cache files - foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') 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!'); - return $data; + return $filterData; } // Filter for purging 'filter' cache -function FILTER_CACHE_DESTROY_FILTER ($data) { +function FILTER_CACHE_DESTROY_FILTER ($filterData) { // Skip this step if the cache instance is not there //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); - if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) { - return false; + if ((!isValidCacheInstance()) || ((isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') != 'Y'))) { + 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 $data; + return $filterData; } // [EOF]