]> git.mxchange.org Git - mailer.git/commitdiff
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 c2467768865f1d5ac36882308c90c4447f6d0828..3982575640eb3f1f320334bf186eef4350bd7f41 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 f1356910d97398e23b953594039edd0e149640ff..29cb7aea70fcfff6007293932af40f9fbc54c801 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;