public static function SassFile::get_cached_file in Sassy 7.3
Returns a cached version of the file if available.
Parameters
string filename to fetch:
string path to cache location:
Return value
mixed the cached file if available or false if it is not
2 calls to SassFile::get_cached_file()
- SassFile::get_tree in phpsass/
SassFile.php - Returns the parse tree for a file. If caching is enabled a cached version will be used if possible; if not the parsed file will be cached.
- SassParser::parse in phpsass/
SassParser.php - Parse a sass file or Sass source code and returns the document tree that can then be rendered. The file will be searched for in the directories specified by the load_paths option. If caching is enabled a cached version will be used if possible or…
File
- phpsass/
SassFile.php, line 148
Class
- SassFile
- SassFile class. @package PHamlP @subpackage Sass
Code
public static function get_cached_file($filename, $cacheLocation) {
$cached = realpath($cacheLocation) . DIRECTORY_SEPARATOR . md5($filename) . '.' . self::SASSC;
if ($cached && file_exists($cached) && filemtime($cached) >= filemtime($filename)) {
return unserialize(file_get_contents($cached));
}
return false;
}