public static function SassFile::setCachedFile in Sassy 7
* Saves a cached version of the file. *
Parameters
SassRootNode Sass tree to save: * @param string filename to save * @param string path to cache location * @return mixed the cached file if available or false if it is not
2 calls to SassFile::setCachedFile()
- SassFile::getTree in phamlp/
sass/ 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 phamlp/
sass/ 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…
File
- phamlp/
sass/ SassFile.php, line 154
Class
- SassFile
- SassFile class. @package PHamlP @subpackage Sass
Code
public static function setCachedFile($sassc, $filename, $cacheLocation) {
$cacheDir = realpath($cacheLocation);
if (!$cacheDir) {
mkdir($cacheLocation);
@chmod($cacheLocation, 0777);
$cacheDir = realpath($cacheLocation);
}
$cached = $cacheDir . DIRECTORY_SEPARATOR . md5($filename) . '.' . self::SASSC;
return file_put_contents($cached, serialize($sassc));
}