Пример #1
0
 public function read()
 {
     parent::read();
     if (!$this->is_cached() && $this->minify) {
         try {
             $this->content = \Helper\Minifier\Scripts::minify($this->content);
         } catch (\System\Error\Format $e) {
             $exp = $e->get_explanation();
             $exp[] = $this->get_file_list($this->base);
             $e->set_explanation($exp);
             throw $e;
         }
     }
 }
Пример #2
0
 public function read()
 {
     parent::read();
     if (!$this->is_cached()) {
         if (class_exists('\\Less_Parser')) {
             $parser = new \Less_Parser();
             $parser->SetOptions(array('compress' => $this->minify));
             try {
                 $parser->parse($this->content);
             } catch (\Exception $e) {
                 throw new \System\Error\Format(sprintf('Error while parsing LESS styles: %s', $e->getMessage()));
             }
             $this->content = $parser->getCss();
         } else {
             throw new \System\Error\MissingDependency('Missing less parser. Please install oyejorge/less.php');
         }
     }
 }