Habari\APCCache::_expire PHP Method

_expire() protected method

Expires the named value from the cache.
protected _expire ( string $name, $group, string $match_mode = 'strict' )
$name string The name of the cached item
$match_mode string (optional) how to match bucket names ('strict', 'regex', 'glob') (default 'strict')
    protected function _expire($name, $group, $match_mode = 'strict')
    {
        if (!$this->enabled) {
            return null;
        }
        $keys = array();
        switch (strtolower($match_mode)) {
            case 'glob':
                if (array_key_exists($group, $this->cache_data)) {
                    $keys = preg_grep(Utils::glob_to_regex($name), array_keys($this->cache_data[$group]));
                }
                break;
            case 'regex':
                if (array_key_exists($group, $this->cache_data)) {
                    $keys = preg_grep($name, array_keys($this->cache_data[$group]));
                }
                break;
            case 'strict':
            default:
                $keys = array($name);
                break;
        }
        foreach ($keys as $key) {
            Plugins::act('cache_expire_before', $name, $group);
            apc_delete(implode(':', array($this->prefix, $group, $key)));
            Plugins::act('cache_expire_after', $name, $group);
        }
    }