Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Applying configuration once and not for each stylesheet

  • Loading branch information...
commit 0e278fda3a72146e8568dc8abf6ea523bf57e150 1 parent 3e17e5d
@oncletom authored
Showing with 11 additions and 4 deletions.
  1. +9 −2 lib/Configuration.class.php
  2. +2 −2 lib/Stylesheet.class.php
View
11 lib/Configuration.class.php
@@ -34,6 +34,7 @@ protected function configure()
protected function configureOptions()
{
$this->setVariables(array());
+ $this->alwaysRecompile((defined('WP_DEBUG') && WP_DEBUG) || (defined('WP_LESS_ALWAYS_RECOMPILE') && WP_LESS_ALWAYS_RECOMPILE));
}
/**
@@ -71,10 +72,16 @@ public function setVariables(array $variables)
* Set compilation strategy
*
* @param $bFlag bool
+ * @return bool Actual compilation "strategy"
*/
- public function alwaysRecompile($bFlag)
+ public function alwaysRecompile($bFlag = null)
{
- $this->alwaysRecompile = !!$bFlag;
+ if (!is_null($bFlag))
+ {
+ $this->alwaysRecompile = !!$bFlag;
+ }
+
+ return $this->alwaysRecompile;
}
/**
View
4 lib/Stylesheet.class.php
@@ -180,12 +180,12 @@ public function getTargetUri()
*
* @author oncletom
* @since 1.0
- * @version 1.2
+ * @version 1.3
* @return boolean
*/
public function hasToCompile()
{
- return ($this->is_new || (defined('WP_DEBUG') && WP_DEBUG));
+ return $this->is_new;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.