diff --git a/system/libs/cache_file.php b/system/libs/cache_file.php index 13e34ef8..a4c897c8 100644 --- a/system/libs/cache_file.php +++ b/system/libs/cache_file.php @@ -26,12 +26,11 @@ class Cache_File $file = $this->_name($key); file_put_contents($file, $var); - if($ttl !== 0) { - touch($file, time() + $ttl); - } - else { - touch($file, time() + 24 * 60 * 60); + if ($ttl === 0) { + $ttl = 365 * 24 * 60 * 60; // 365 days } + + touch($file, time() + $ttl); } public function get($key) diff --git a/system/libs/cache_php.php b/system/libs/cache_php.php index e7c2bb5e..5d35ceef 100644 --- a/system/libs/cache_php.php +++ b/system/libs/cache_php.php @@ -31,12 +31,12 @@ class Cache_PHP $file = $this->_name($key); rename($tmp, $file); - if($ttl !== 0) { - touch($file, time() + $ttl); - } - else { - touch($file, time() + 24 * 60 * 60); + + if ($ttl === 0) { + $ttl = 365 * 24 * 60 * 60; // 365 days } + + touch($file, time() + $ttl); } public function get($key)