Timeout on cache files removed, may have caused some trouble
authorRoland Häder <roland@mxchange.org>
Sun, 7 Dec 2008 17:57:28 +0000 (17:57 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 7 Dec 2008 17:57:28 +0000 (17:57 +0000)
inc/databases.php
inc/libs/cache_functions.php

index c246776..3982575 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "609");
+define('CURR_SVN_REVISION', "610");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index f135691..29cb7ae 100644 (file)
@@ -38,14 +38,11 @@ if (!defined('__SECURITY')) {
 }
 
 // Caching class
-class mxchange_cache
-{
+class mxchange_cache {
        // Define variables
-       var $update_interval = 0;
        var $ret = "init";
        var $cache_path = "";
        var $cache_inc = "";
-       var $cache_ctime = 0;
        var $cache_pointer = false;
        var $cache_data = "";
        var $cache_version = "";
@@ -56,9 +53,6 @@ class mxchange_cache
                // Failed is the default
                $this->ret = "failed";
 
-               // Remember interval in class
-               $this->update_interval = $interval;
-
                // Remeber path
                $this->cache_path = $path;
 
@@ -99,27 +93,8 @@ class mxchange_cache
                // Rember it + filename in class
                $this->cache_inc = $inc;
 
-               // Check if file exists
-               $status = (FILE_READABLE($inc) && (is_writeable($inc)));
-               if ($status) {
-                       // Yes, it does. So let's get it's last changed date/time
-                       $ctime = filectime($inc);
-               } else {
-                       // No, it doesn't. Zero date/time
-                       $ctime = 0;
-               }
-
-               // Remember change date/time in class
-               $this->cache_ctime = $ctime;
-
-               // Is the cache file outdated?
-               if (($status) && ((time() - $ctime) >= $this->update_interval)) {
-                       // Ok, we need an update!
-                       $status = false;
-               } elseif ($status) {
-                       // Check on 'cache' extension
-                       $status = $this->ext_version_matches("cache");
-               }
+               // Check if file exists and if version matches
+               $status = (FILE_READABLE($inc) && (is_writeable($inc)) && ($this->ext_version_matches("cache")));
 
                // Return status
                return $status;