You are here

public static function SassFile::resolve_paths in Sassy 7.3

1 call to SassFile::resolve_paths()
SassFile::get_file in phpsass/SassFile.php
Returns the full path to a file to parse. The file is looked for recursively under the load_paths directories and the template_location directory. If the filename does not end in .sass or .scss try the current syntax first then, if a file is not…

File

phpsass/SassFile.php, line 58

Class

SassFile
SassFile class. @package PHamlP @subpackage Sass

Code

public static function resolve_paths($matches, $inc_url = TRUE) {

  // Resolve the path into something nicer...
  $path = (self::$parser ? self::$parser->basepath : '') . self::$path;
  $path = substr($path, 0, strrpos($path, '/')) . '/';
  $path = $path . $matches[1];
  $last = '';
  while ($path != $last) {
    $last = $path;
    $path = preg_replace('`(^|/)(?!\\.\\./)([^/]+)/\\.\\./`', '$1', $path);
  }
  return $inc_url ? 'url("' . $path . '")' : $path;
}