Stash_model::_write_file PHP Method

_write_file() private method

Write a static file
private _write_file ( string $uri, $site_id, string $parameters = NULL ) : boolean
$uri string
$parameters string
return boolean
    private function _write_file($uri, $site_id, $parameters = NULL)
    {
        $this->EE->load->helper('file');
        if ($path = $this->_path($uri, $site_id)) {
            // Make sure the directory exists
            if (file_exists($path) || @mkdir($path, 0777, TRUE)) {
                // Write the static file
                if (@write_file($path . $this->_static_file, $parameters, 'w+')) {
                    return TRUE;
                }
            }
        }
        return FALSE;
    }