protected function expire($key = array(), $ttl = 0)
{
if ($ttl === 0) {
// when storing indefinitely, there's no point in keeping it around,
// it won't just expire
return;
}
// $key can be both string (1 key) or array (multiple)
$keys = (array) $key;
$time = time() + $ttl;
foreach ($keys as $key) {
$this->expires[$key] = $time;
}
}