Cache does no longer try to close non-existing cache
authorRoland Häder <roland@mxchange.org>
Fri, 5 Dec 2008 23:58:36 +0000 (23:58 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 5 Dec 2008 23:58:36 +0000 (23:58 +0000)
inc/databases.php
inc/libs/cache_functions.php

index 04b81d6fd02ae3982207ad3757f6b8bad48008ee..f0865f617a59446ffcbe6e197c691ecfdf965f64 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "602");
+define('CURR_SVN_REVISION', "603");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index d5b3639477adb24ff08b65b35794b764c33a3bc3..c2b92decb910d1aae6054724d6bc358b5636fdcb 100644 (file)
@@ -243,11 +243,16 @@ class mxchange_cache
        function cache_destroy() {
                // Is the cache file there?
                if (FILE_READABLE($this->cache_inc)) {
+                       // Close cache
+                       $this->close_cache();
+
                        // Remove cache file from system
                        unlink($this->cache_inc);
+
+                       // Is the file there?
                        if (!FILE_READABLE($this->cache_inc)) {
-                               // Close cache automatically (we don't need it anymore!)
-                               $this->cache_close();
+                               // The cache does no longer exist so kill the content
+                               unset($this->cache_data[$this->cache_file]);
                        } else {
                                // Not removed!
                                ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);