X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fcachesystem.class.php;h=1c3950bbd0964ca75c3cc98c5a44888bc40d3677;hb=8cd3d68a23aa285f2fe149698a46cf8b4e3ac0ca;hp=f160a6cfdbcede2062f8ce21fe3a14fa40db0858;hpb=09f5758c42a33a56bdd461c946ffe759a59c54aa;p=mailer.git diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index f160a6cfdb..1c3950bbd0 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -436,32 +436,38 @@ 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])) { + // Does never match by default + $GLOBALS[__METHOD__][$ext_name] = 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? + $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