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);
}
// 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 = "";
// Failed is the default
$this->ret = "failed";
- // Remember interval in class
- $this->update_interval = $interval;
-
// Remeber path
$this->cache_path = $path;
// 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;