mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-27 21:56:50 +01:00
Cache::remember -1 = infinite
This commit is contained in:
@@ -115,6 +115,11 @@ class Cache
|
|||||||
return unserialize($value);
|
return unserialize($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -1 for infinite cache
|
||||||
|
if ($ttl == -1) {
|
||||||
|
$ttl = 10 * 365 * 24 * 60 * 60; // 10 years should be enough
|
||||||
|
}
|
||||||
|
|
||||||
$value = $callback();
|
$value = $callback();
|
||||||
$cache->set($key, serialize($value), $ttl);
|
$cache->set($key, serialize($value), $ttl);
|
||||||
return $value;
|
return $value;
|
||||||
|
|||||||
Reference in New Issue
Block a user