Permalink
Browse files

Add the path to less.js to the configuration class

  • Loading branch information...
1 parent 7f69b83 commit fa9d64e39d5f4931004f5666120608db8162ac8c @vicb vicb committed Jul 5, 2010
Showing with 21 additions and 4 deletions.
  1. +10 −0 lib/config/LESSConfig.class.php
  2. +8 −0 lib/config/sfLESSConfig.class.php
  3. +3 −4 lib/less/sfLESSListeners.php
@@ -105,6 +105,16 @@ public function getLessPaths()
}
/**
+ * Returns path to the less.js file
+ *
+ * @return string a path to the less.js file
+ */
+ public function getLessJsPath()
+ {
+ return '/sfLESSPlugin/js/less-1.0.31.min.js';
+ }
+
+ /**
* Returns debug info of the current state
*
* @return array state
@@ -49,4 +49,12 @@ public function getLessPaths()
{
return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) . '/less/';
}
+
+ /**
+ * @see LESSConfig
+ */
+ public function getLessJsPath()
+ {
+ return sfConfig::get('app_sf_less_plugin_js_lib', parent::getLessJsPath());
+ }
}
@@ -60,9 +60,8 @@ static public function findAndFixContentLinks(sfWebResponse $response, $useJs)
}
else
{
- $response->addJavascript(
- sfConfig::get('app_sf_less_plugin_js_lib', '/sfLESSPlugin/js/less-1.0.31.min.js')
- );
+ $config = new sfLESSConfig();
+ $response->addJavascript($config->getLessJsPath());
}
}
}
@@ -78,7 +77,7 @@ static public function findAndCompile(sfEvent $event)
$timer = sfTimerManager::getTimer('Less compilation');
// Create config manager
- $config = new sfLESSConfig;
+ $config = new sfLESSConfig();
// Create new helper object & compile LESS stylesheets with it
$less = new sfLESS($config);

0 comments on commit fa9d64e

Please sign in to comment.