Stash_model::flush_cache PHP Method

flush_cache() public method

Flush the entire cache for a given site, immediately
public flush_cache ( integer $site_id = 1 ) : boolean
$site_id integer
return boolean
    function flush_cache($site_id = 1)
    {
        // delete all variables saved in the db
        if ($result = $this->EE->db->where('site_id', $site_id)->delete('stash')) {
            // remove all files in the static dir, if static caching is enabled
            if ($this->EE->config->item('stash_static_cache_enabled')) {
                $this->_delete_dir('/', $site_id);
            }
            // -------------------------------------
            // 'stash_flush_cache' hook
            // -------------------------------------
            if ($this->EE->extensions->active_hook('stash_flush_cache') === TRUE) {
                $this->EE->extensions->call('stash_flush_cache', $site_id);
            }
            return $result;
        }
        return FALSE;
    }