Habari\FileCache::_extend PHP Method

_extend() protected method

Extend the expiration of the named cached value.
protected _extend ( string $name, integer $expiry, $group )
$name string The name of the cached item
$expiry integer The duration in seconds to extend the cache expiration by
    protected function _extend($name, $expiry, $group)
    {
        if (!$this->enabled) {
            return null;
        }
        Plugins::act('cache_extend_before', $name, $group, $expiry);
        $hash = $this->get_name_hash($name);
        $ghash = $this->get_group_hash($group);
        if (isset($this->cache_files[$ghash][$hash])) {
            $this->cache_files[$ghash][$hash]['expires'] = time() + $expiry;
            $this->clear_expired();
            file_put_contents($this->index_file, serialize($this->cache_files));
        }
        Plugins::act('cache_extend_after', $name, $group, $expiry);
    }