Exemplo n.º 1
0
 /**
  * Process a single stylesheet
  *
  * @author oncletom
  * @since 1.1
  * @version 1.3
  * @param string $handle
  * @param $force boolean If set to true, rebuild all stylesheets, without considering they are updated or not
  * @return WPLessStylesheet
  */
 public function processStylesheet($handle, $force = false)
 {
     $force = !!$force ? $force : $this->configuration->alwaysRecompile();
     $wp_styles = $this->getStyles();
     $stylesheet = new WPLessStylesheet($wp_styles->registered[$handle], $this->compiler->getVariables());
     if ($this->configuration->getCompilationStrategy() === 'legacy' && $stylesheet->hasToCompile()) {
         $this->compiler->saveStylesheet($stylesheet);
     } elseif ($this->configuration->getCompilationStrategy() !== 'legacy') {
         $this->compiler->cacheStylesheet($stylesheet, $force);
     }
     $wp_styles->registered[$handle]->src = $stylesheet->getTargetUri();
     return $stylesheet;
 }