X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fcache_functions.php;h=53e4847e901fb0526959b214b132ba8674e953d0;hp=ca0aee8331aebeb06611e7661d97b930e790755e;hb=36c3c8b749a88ce05ad0fda81e00047f9cb5433f;hpb=06a24901c58897845bafc1e5b428fee99024bc64 diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index ca0aee8331..53e4847e90 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -176,7 +176,7 @@ class CacheSystem { // Remove pointer $this->pointer = false; - //* DEBUG: */ print __METHOD__."(".__LINE__."): {$this->name} - FINALIZED!
\n"; + //* DEBUG: */ OUTPUT_HTML(__METHOD__."(".__LINE__."): {$this->name} - FINALIZED!
"); } // END - if } @@ -226,13 +226,13 @@ class CacheSystem { } // Destroy an existing cache file - function destroyCacheFile ($removeArray = false) { + function destroyCacheFile ($removeArray = false, $force = false) { // Only run in regular output mode - if (getOutputMode() != 0) { + if ((getOutputMode() != 0) && ($force === false)) { // Debug message if allowed if (isDebugModeEnabled()) { // Debug message - DEBUG_LOG(__METHOD__, __LINE__, 'Not removing cache ' . $this->name . ' in output_mode=' . getOutputMode()); + debug_report_bug('Not removing cache ' . $this->name . ' in output_mode=' . getOutputMode()); } // END - if // Abort here @@ -381,7 +381,7 @@ class CacheSystem { // Add the extension version to object (DO NOT REMOVE IT! Endless loop...) $this->version[$this->name][$ext_name] = $ext_ver; - //* DEBUG: */ print __METHOD__."(".__LINE__."): {$this->name} - {$ext_name}={$ext_ver}
\n"; + //* DEBUG: */ OUTPUT_HTML(__METHOD__."(".__LINE__."): {$this->name} - {$ext_name}={$ext_ver}
"); } else { // Cannot create file addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".getMessage('CACHE_PROBLEMS_DETECTED')); @@ -398,7 +398,7 @@ class CacheSystem { // Debug messages if (isset($this->version[$this->name][$ext_name])) { - //* DEBUG: */ print __METHOD__."(".__LINE__."): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}
\n"; + //* DEBUG: */ OUTPUT_HTML(__METHOD__."(".__LINE__."): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}
"); } else { // No cache version found! DEBUG_LOG(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}!"); @@ -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