mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49: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 = $this->_name($key);
|
||||||
file_put_contents($file, $var);
|
file_put_contents($file, $var);
|
||||||
|
|
||||||
if($ttl !== 0) {
|
if ($ttl === 0) {
|
||||||
touch($file, time() + $ttl);
|
$ttl = 365 * 24 * 60 * 60; // 365 days
|
||||||
}
|
|
||||||
else {
|
|
||||||
touch($file, time() + 24 * 60 * 60);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
touch($file, time() + $ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get($key)
|
public function get($key)
|
||||||
|
@ -31,12 +31,12 @@ class Cache_PHP
|
|||||||
|
|
||||||
$file = $this->_name($key);
|
$file = $this->_name($key);
|
||||||
rename($tmp, $file);
|
rename($tmp, $file);
|
||||||
if($ttl !== 0) {
|
|
||||||
touch($file, time() + $ttl);
|
if ($ttl === 0) {
|
||||||
}
|
$ttl = 365 * 24 * 60 * 60; // 365 days
|
||||||
else {
|
|
||||||
touch($file, time() + 24 * 60 * 60);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
touch($file, time() + $ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get($key)
|
public function get($key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user