mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
Cache for 365 days if $ttl not set
This commit is contained in:
parent
f09c129c6d
commit
cb6509d09d
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user