Automatically convert to relative TTL if Unix timestamp is given

This commit is contained in:
Kijin Sung 2016-04-17 16:30:06 +09:00
parent 8bd7f6e466
commit ca56ff474f

View file

@ -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