示例#1
0
 /**
  * Returns filter manager
  * 
  * @return \Assetic\FilterManager
  */
 public function getFilterManager()
 {
     if (!$this->filterManager) {
         $options = $this->getOptions();
         $this->filterManager = new \Assetic\FilterManager();
         $lessFilter = new \Assetic\Filter\LessFilter(null, $options['nodePath']);
         $lessFilter->setCompress(true);
         $this->filterManager->set('less', $lessFilter);
         $this->filterManager->set('closure', new \Assetic\Filter\GoogleClosure\CompilerJarFilter($options['closureCompilerPath'], $options['javaPath']));
         $jpegOptimFilter = new \Assetic\Filter\JpegoptimFilter($options['jpegOptimPath']);
         $jpegOptimFilter->setStripAll(true);
         $this->filterManager->set('jpegoptim', $jpegOptimFilter);
         $optiPngFilter = new \Assetic\Filter\OptiPngFilter($options['optiPngPath']);
         $optiPngFilter->setLevel(2);
         $this->filterManager->set('optipng', $optiPngFilter);
         // $this->filterManager->set('closure', new \Assetic\Filter\UglifyJsFilter($options['uglifyPath']));
     }
     return $this->filterManager;
 }
 /**
  * Gets the 'assetic.filter.optipng' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Assetic\Filter\OptiPngFilter A Assetic\Filter\OptiPngFilter instance.
  */
 protected function getAssetic_Filter_OptipngService()
 {
     $this->services['assetic.filter.optipng'] = $instance = new \Assetic\Filter\OptiPngFilter($this->targetDirs[4] . '/repo/branch/app/landing/bin/image_optim/optipng');
     $instance->setTimeout(NULL);
     $instance->setLevel(NULL);
     return $instance;
 }