From: Roland Häder Date: Mon, 15 Sep 2008 00:06:45 +0000 (+0000) Subject: Cache now supports multiple extension versions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7ef451f330894cc47e810faefd0ed35a48086199;p=mailer.git Cache now supports multiple extension versions --- diff --git a/inc/databases.php b/inc/databases.php index 327f7c7a8b..d35cb48bd6 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "329"); +define('CURR_SVN_REVISION', "330"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index f3496a5ccb..e8f750bee8 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -193,6 +193,7 @@ class mxchange_cache if (FILE_READABLE($this->cache_inc)) { // Prepare temporary array $data = array(); + $cache_version = null; // Load cache file $this->cache_data = implode("", file($this->cache_inc)); @@ -205,7 +206,7 @@ class mxchange_cache $this->cache_data = $data; // Cache version found? - if (isset($cache_version)) { + if ((isset($cache_version)) && (is_array($cache_version))) { // Remember it as well... $this->cache_version = $cache_version; } // END - if @@ -351,7 +352,7 @@ class mxchange_cache $ext_ver = GET_EXT_VERSION($ext_name); // Write cache line to file - @fwrite($this->cache_pointer, "\$cache_version = \"".$ext_ver."\";\n"); + @fwrite($this->cache_pointer, "\$cache_version['".$ext_name."'] = \"".$ext_ver."\";\n"); } else { // Cannot create file ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); @@ -367,7 +368,7 @@ class mxchange_cache //* DEBUG: */ echo __METHOD__.": ext_name={$ext_name},ext_ver={$ext_ver},cache_version={$this->cache_version}
\n"; // Compare both - return ($ext_ver == $this->cache_version); + return ((isset($this->cache_version[$ext_name])) && ($this->cache_version[$ext_name] == $ext_ver)); } function add_raw_row ($key, $value) {