From 3bd890f49df3709ba6f56c6e5d328bf30ecfe381 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 7 Dec 2008 17:57:28 +0000 Subject: [PATCH] Timeout on cache files removed, may have caused some trouble --- inc/databases.php | 2 +- inc/libs/cache_functions.php | 31 +++---------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index c246776886..3982575640 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index f1356910d9..29cb7aea70 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -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; -- 2.30.2