mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
Automatically convert to relative TTL if Unix timestamp is given
This commit is contained in:
parent
8bd7f6e466
commit
ca56ff474f
1 changed files with 4 additions and 0 deletions
|
|
@ -152,6 +152,10 @@ class Cache
|
|||
{
|
||||
if (self::$_driver !== null)
|
||||
{
|
||||
if ($ttl >= (3600 * 24 * 30))
|
||||
{
|
||||
$ttl = min(3600 * 24 * 30, max(0, $ttl - time()));
|
||||
}
|
||||
return self::$_driver->set(self::getRealKey($key, $group_name), $value, intval($ttl)) ? true : false;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue