Leafo\ScssPhp\Compiler::importFile PHP Method

importFile() protected method

Import file
protected importFile ( string $path, array $out )
$path string
$out array
    protected function importFile($path, $out)
    {
        // see if tree is cached
        $realPath = realpath($path);
        if (isset($this->importCache[$realPath])) {
            $this->handleImportLoop($realPath);
            $tree = $this->importCache[$realPath];
        } else {
            $code = file_get_contents($path);
            $parser = $this->parserFactory($path);
            $tree = $parser->parse($code);
            $this->importCache[$realPath] = $tree;
        }
        $pi = pathinfo($path);
        array_unshift($this->importPaths, $pi['dirname']);
        $this->compileChildrenNoReturn($tree->children, $out);
        array_shift($this->importPaths);
    }

Usage Example

 protected function importFile($path, $out)
 {
     $this->importedStylesheets[] = $this->removeTlPath($path);
     // call "original" method
     return parent::importFile($path, $out);
 }
Compiler