Timeout on cache files removed, may have caused some trouble
[mailer.git] / inc / libs / cache_functions.php
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;