You are here

public static function SassFile::set_cached_file in Sassy 7.3

Saves a cached version of the file.

Parameters

SassRootNode Sass tree to save:

string filename to save:

string path to cache location:

Return value

mixed the cached file if available or false if it is not

2 calls to SassFile::set_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 166

Class

SassFile
SassFile class. @package PHamlP @subpackage Sass

Code

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