X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fclasses%2Fcachesystem.class.php;h=ae127dc27eb69e79faca27b1fd481cb94310c23b;hp=5a606fb93eb574d57a68be282d49ff46601a1834;hb=aa1d1076b9115580ea07374b9c470f5a0c40ca07;hpb=c3f2beb3f1d47c9593d262d7f5dac47640b4aa52 diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index 5a606fb93e..ae127dc27e 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -18,6 +18,7 @@ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009, 2010 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -435,32 +436,35 @@ class CacheSystem { // Checks wether versions from cache and extension matches function extensionVersionMatches ($ext_name) { - // Default is not matching - $matches = false; - - // Compare only if installed - if (isExtensionInstalled($ext_name)) { - // Get extension version - $ext_ver = getExtensionVersion($ext_name); - - // Debug messages - if (isset($this->version[$this->name][$ext_name])) { - // Does it match? - $matches = ((isset($this->version[$this->name][$ext_name])) && ($this->version[$this->name][$ext_name] == $ext_ver)); - } elseif ($this->isCacheReadable()) { - // No cache version found! - logDebugMessage(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}! Purging cache..."); - - // Remove the cache file - $this->removeCacheFile(true); + // Check cache + if (!isset($GLOBALS[__METHOD__][$ext_name])) { + // Compare only if installed + if (isExtensionInstalled($ext_name)) { + // Get extension version + $ext_ver = getExtensionVersion($ext_name); + + // Debug messages + if (isset($this->version[$this->name][$ext_name])) { + // Does it match? + $GLOBALS[__METHOD__][$ext_name] = ((isset($this->version[$this->name][$ext_name])) && ($this->version[$this->name][$ext_name] == $ext_ver)); + } elseif ($this->isCacheReadable()) { + // No cache version found! + logDebugMessage(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}! Purging cache..."); + + // Remove the cache file + $this->removeCacheFile(true); + } + } else { + // Not installed, does always match + $GLOBALS[__METHOD__][$ext_name] = true; } } else { - // Not installed, does always match - $matches = true; + // Cache entry found, log debug message + //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'ext_name=' . $ext_name . ', matches=' . intval($GLOBALS[__METHOD__][$ext_name])); } // Compare both - return $matches; + return $GLOBALS[__METHOD__][$ext_name]; } // Rewrit the entry so it can be stored in cache file