add some changes
[Snippets.git] / APC.class.php
index 83cf39b974a6f78a51ad47e3c9520e266fd91a07..f3a289ebede358c0f0e6ecd395669fc8f3946ed6 100644 (file)
@@ -59,7 +59,7 @@ class APC {
        public function fetch ($key) {
                if ($this->exists($key)) {
                        $cacheTime = $this->getCacheTime($key);
-                       if ($cacheTime['ttl'] > 0 && (TIME_NOW - $cacheTime['mtime']) > $cacheTime['ttl']) {
+                       if ($cacheTime['ttl'] > 0 && (time() - $cacheTime['mtime']) > $cacheTime['ttl']) {
                                $this->delete($key);
                                return null;
                        }
@@ -182,6 +182,11 @@ class APC {
                                        unset($cache['atime']);
                                }
                                
+                               if (isset($cache['modification_time'])) {
+                                       $cache['mtime'] = $cache['modification_time'];
+                                       unset($cache['modification_time']);
+                               }
+                               
                                $info[] = $cache;
                        }
                }