You are here

public static function SassFile::getCachedFile in Sassy 7

* Returns a cached version of the file if available. *

Parameters

string filename to fetch: * @param string path to cache location * @return mixed the cached file if available or false if it is not

2 calls to SassFile::getCachedFile()
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 136

Class

SassFile
SassFile class. @package PHamlP @subpackage Sass

Code

public static function getCachedFile($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;
}