method ttl documentation in bbn\Cache
Returns a length in seconds based on the given parameter, allowing strings such as xl or s to be given as ttl arguments.
function($ttl)
{
if (is_null($ttl)) {
return self::$default_ttl;
}
if (Str::isInteger($ttl)) {
return (int)$ttl;
}
if (\is_string($ttl)) {
switch ($ttl) {
case 'xxs':
return 30;
case 'xs':
return 60;
case 's':
return 300;
case 'm':
return 3600;
case 'l':
return 3600 * 24;
case 'xl':
return 3600 * 24 * 7;
case 'xxl':
return 3600 * 24 * 30;
}
}
ob_start();
var_dump($ttl);
$ttl = ob_get_contents();
ob_end_clean();
X::log($ttl);
throw new Exception(
X::_("Wrong ttl parameter")
);
}
Returns a length in seconds based on the given parameter, allowing strings such as xl or s to be given as ttl arguments. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions