Lexy::cache_file PHP Method

cache_file() protected method

protected cache_file ( $file, $cachedfile, $filemtime = null, $sandbox = false )
    protected function cache_file($file, $cachedfile, $filemtime = null, $sandbox = false)
    {
        if (!$filemtime) {
            $filemtime = filemtime($file);
        }
        if (file_put_contents($cachedfile, $this->parse(file_get_contents($file), $sandbox, $file))) {
            touch($cachedfile, $filemtime);
            return $cachedfile;
        }
        return false;
    }