Permalink
Browse files

Apply refactoring

  • Loading branch information...
1 parent 66120fe commit a6130607b2d5ee83a8a2f75d4ceae1454ec778ba @vicb vicb committed Jul 5, 2010
Showing with 11 additions and 7 deletions.
  1. +1 −1 lib/config/LESSConfig.class.php
  2. +9 −5 lib/debug/sfWebDebugPanelLESS.class.php
  3. +1 −1 lib/less/sfLESS.class.php
View
2 lib/config/LESSConfig.class.php
@@ -16,7 +16,7 @@
* @author Konstantin Kudryashov <ever.zet@gmail.com>
* @version 1.0.0
*/
-class sfLESSConfig
+class LESSConfig
{
/**
* Do we need to check dates before compile
View
14 lib/debug/sfWebDebugPanelLESS.class.php
@@ -23,13 +23,17 @@ class sfWebDebugPanelLESS extends sfWebDebugPanel
*/
protected $compiled = false;
-
/**
* Some errors where triggered during the compilation
*/
protected $errors = false;
/**
+ * Configuration
+ */
+ protected $config;
+
+ /**
* Listens to LoadDebugWebPanel event & adds this panel to the Web Debug toolbar
*
* @param sfEvent $event
@@ -85,8 +89,8 @@ public function getPanelContent()
protected function getConfigurationContent()
{
$debugInfo = '<dl id="less_debug" style="display: none;">';
- $lessHelper = new sfLESS;
- foreach ($lessHelper->getDebugInfo() as $name => $value)
+ $this->config = new sfLESSConfig;
+ foreach ($this->config->getDebugInfo() as $name => $value)
{
$debugInfo .= sprintf('<dt style="float:left; width: 100px"><strong>%s:</strong></dt>
<dd>%s</dd>', $name, $value);
@@ -115,7 +119,7 @@ protected function getInfoContent($info, $error = false)
// File link for preferred editor
$fileLink = $this->formatFileLink(
- $info['lessFile'], 1, str_replace(sfLESS::getLessPaths(), '', $info['lessFile'])
+ $info['lessFile'], 1, str_replace($this->config->getLessPaths(), '', $info['lessFile'])
);
// Checking compile & error statuses
@@ -146,7 +150,7 @@ protected function getInfoContent($info, $error = false)
EOF
,$trStyle
,$fileLink
- ,str_replace(sfLESS::getCssPaths(), '', $info['cssFile'])
+ ,str_replace($this->config->getCssPaths(), '', $info['cssFile'])
,($info['isCompiled'] ? $info['compTime'] * 1000 : 0)
,$errorId
,$info['error']
View
2 lib/less/sfLESS.class.php
@@ -120,7 +120,7 @@ public function findLessFiles()
*
* @return string CSS file path
*/
- static public function getCssPathOfLess($lessFile)
+ public function getCssPathOfLess($lessFile)
{
return str_replace(
array($this->config->getLessPaths(), '.less'),

0 comments on commit a613060

Please sign in to comment.