Habari\FileCache::_set PHP Method

_set() protected method

protected _set ( $name, $value, $expiry, $group, $keep )
    protected function _set($name, $value, $expiry, $group, $keep)
    {
        if (!$this->enabled) {
            return null;
        }
        Plugins::act('cache_set_before', $name, $group, $value, $expiry);
        $hash = $this->get_name_hash($name);
        $ghash = $this->get_group_hash($group);
        if (!isset($this->cache_data[$group])) {
            // prime our cache so the local version is up-to-date and complete
            $this->_get_group($group);
        }
        $this->cache_data[$group][$name] = $value;
        file_put_contents($this->cache_location . $ghash . $hash, serialize($value));
        $this->cache_files[$ghash][$hash] = array('file' => $this->cache_location . $ghash . $hash, 'expires' => time() + $expiry, 'name' => $name, 'keep' => $keep);
        $this->clear_expired();
        file_put_contents($this->index_file, serialize($this->cache_files));
        Plugins::act('cache_set_after', $name, $group, $value, $expiry);
        return true;
    }