Example #1
0
 protected function importFile($path, $out)
 {
     // see if tree is cached
     $realPath = realpath($path);
     if (isset($this->importCache[$realPath])) {
         $tree = $this->importCache[$realPath];
     } else {
         $code = file_get_contents($path);
         $parser = new scss_parser($path, false);
         $tree = $parser->parse($code);
         $this->parsedFiles[] = $path;
         $this->importCache[$realPath] = $tree;
     }
     $pi = pathinfo($path);
     array_unshift($this->importPaths, $pi['dirname']);
     $this->compileChildren($tree->children, $out);
     array_shift($this->importPaths);
 }
Example #2
0
 protected function importFile($path, $out)
 {
     // see if tree is cached
     $realPath = realpath($path);
     if (isset($this->importCache[$realPath])) {
         $tree = $this->importCache[$realPath];
     } else {
         require_once ABSPATH . 'wp-admin/includes/file.php';
         WP_Filesystem();
         global $wp_filesystem;
         $code = $wp_filesystem->get_contents($path);
         $parser = new scss_parser($path, false);
         $tree = $parser->parse($code);
         $this->parsedFiles[] = $path;
         $this->importCache[$realPath] = $tree;
     }
     $pi = pathinfo($path);
     array_unshift($this->importPaths, $pi['dirname']);
     $this->compileChildren($tree->children, $out);
     array_shift($this->importPaths);
 }