Пример #1
0
 /**
  * Compile function. Returns a compile content, or writes it to a file if path is specified.
  *
  * @param null|string $file
  * @return string|true
  */
 public function compile($path = null)
 {
     parent::compile();
     $file = $this->getMinifiedResource();
     $file->rewind();
     $filePath = $file->getPath() . '/' . $file->getFilename();
     $stylus = new StylusCompiler();
     $string = $stylus->parseFile($filePath);
     if (null !== $path) {
         $file2 = new FileObject($path, 'w+');
         $file2->write($string);
         $string = true;
     }
     unset($file);
     unset($file2);
     return $string;
 }