Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Apply refactoring

  • Loading branch information...
commit a6130607b2d5ee83a8a2f75d4ceae1454ec778ba 1 parent 66120fe
Victor Berchet vicb authored
2  lib/config/LESSConfig.class.php
@@ -16,7 +16,7 @@
16 16 * @author Konstantin Kudryashov <ever.zet@gmail.com>
17 17 * @version 1.0.0
18 18 */
19   -class sfLESSConfig
  19 +class LESSConfig
20 20 {
21 21 /**
22 22 * Do we need to check dates before compile
14 lib/debug/sfWebDebugPanelLESS.class.php
@@ -23,13 +23,17 @@ class sfWebDebugPanelLESS extends sfWebDebugPanel
23 23 */
24 24 protected $compiled = false;
25 25
26   -
27 26 /**
28 27 * Some errors where triggered during the compilation
29 28 */
30 29 protected $errors = false;
31 30
32 31 /**
  32 + * Configuration
  33 + */
  34 + protected $config;
  35 +
  36 + /**
33 37 * Listens to LoadDebugWebPanel event & adds this panel to the Web Debug toolbar
34 38 *
35 39 * @param sfEvent $event
@@ -85,8 +89,8 @@ public function getPanelContent()
85 89 protected function getConfigurationContent()
86 90 {
87 91 $debugInfo = '<dl id="less_debug" style="display: none;">';
88   - $lessHelper = new sfLESS;
89   - foreach ($lessHelper->getDebugInfo() as $name => $value)
  92 + $this->config = new sfLESSConfig;
  93 + foreach ($this->config->getDebugInfo() as $name => $value)
90 94 {
91 95 $debugInfo .= sprintf('<dt style="float:left; width: 100px"><strong>%s:</strong></dt>
92 96 <dd>%s</dd>', $name, $value);
@@ -115,7 +119,7 @@ protected function getInfoContent($info, $error = false)
115 119
116 120 // File link for preferred editor
117 121 $fileLink = $this->formatFileLink(
118   - $info['lessFile'], 1, str_replace(sfLESS::getLessPaths(), '', $info['lessFile'])
  122 + $info['lessFile'], 1, str_replace($this->config->getLessPaths(), '', $info['lessFile'])
119 123 );
120 124
121 125 // Checking compile & error statuses
@@ -146,7 +150,7 @@ protected function getInfoContent($info, $error = false)
146 150 EOF
147 151 ,$trStyle
148 152 ,$fileLink
149   - ,str_replace(sfLESS::getCssPaths(), '', $info['cssFile'])
  153 + ,str_replace($this->config->getCssPaths(), '', $info['cssFile'])
150 154 ,($info['isCompiled'] ? $info['compTime'] * 1000 : 0)
151 155 ,$errorId
152 156 ,$info['error']
2  lib/less/sfLESS.class.php
@@ -120,7 +120,7 @@ public function findLessFiles()
120 120 *
121 121 * @return string CSS file path
122 122 */
123   - static public function getCssPathOfLess($lessFile)
  123 + public function getCssPathOfLess($lessFile)
124 124 {
125 125 return str_replace(
126 126 array($this->config->getLessPaths(), '.less'),

0 comments on commit a613060

Please sign in to comment.
Something went wrong with that request. Please try again.