forked from everzet/sfLESSPlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote branch 'upstream/master'
- Loading branch information
Showing
22 changed files
with
777 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the sfLESSPlugin. | ||
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* sfLESSConfig is configuration manager. | ||
* | ||
* @package sfLESSPlugin | ||
* @subpackage lib | ||
* @author Konstantin Kudryashov <ever.zet@gmail.com> | ||
* @version 1.0.0 | ||
*/ | ||
class sfLESSConfig | ||
{ | ||
/** | ||
* Do we need to check dates before compile | ||
* | ||
* @var boolean | ||
*/ | ||
protected $checkDates; | ||
|
||
/** | ||
* Do we need compression for CSS files | ||
* | ||
* @var boolean | ||
*/ | ||
protected $useCompression; | ||
|
||
/** | ||
* Creates config instance | ||
* | ||
* @param boolean $checkDates whether we check dates before compile | ||
* @param boolean $useCompression whether we compress result styles | ||
*/ | ||
public function __construct($checkDates = true, $useCompression = false) | ||
{ | ||
$this->checkDates = $checkDates; | ||
$this->useCompression = $useCompression; | ||
} | ||
|
||
/** | ||
* Do we need to check dates before compile | ||
* | ||
* @return boolean | ||
*/ | ||
public function isCheckDates() | ||
{ | ||
return $this->checkDates; | ||
} | ||
|
||
/** | ||
* Set need of check dates before compile | ||
* | ||
* @param boolean $checkDates Do we need to check dates before compile | ||
*/ | ||
public function setIsCheckDates($checkDates) | ||
{ | ||
$this->checkDates = $checkDates; | ||
} | ||
|
||
/** | ||
* Do we need compression for CSS files | ||
* | ||
* @return boolean | ||
*/ | ||
public function isUseCompression() | ||
{ | ||
return $this->useCompression; | ||
} | ||
|
||
/** | ||
* Set need of compression for CSS files | ||
* | ||
* @param boolean $useCompression Do we need compression for CSS files | ||
*/ | ||
public function setIsUseCompression($useCompression) | ||
{ | ||
$this->useCompression = $useCompression; | ||
} | ||
|
||
/** | ||
* Returns paths to CSS files | ||
* | ||
* @return string a path to CSS files directory | ||
*/ | ||
public function getCssPaths() | ||
{ | ||
return 'web/css/'; | ||
} | ||
|
||
/** | ||
* Returns paths to LESS files | ||
* | ||
* @return string a path to LESS files directories | ||
*/ | ||
public function getLessPaths() | ||
{ | ||
return 'web/less/'; | ||
} | ||
|
||
/** | ||
* Returns debug info of the current state | ||
* | ||
* @return array state | ||
*/ | ||
public function getDebugInfo() | ||
{ | ||
return array( | ||
'dates' => var_export($this->isCheckDates(), true), | ||
'compress' => var_export($this->isUseCompression(), true), | ||
'less' => $this->getLessPaths(), | ||
'css' => $this->getCssPaths() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the sfLESSPlugin. | ||
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* sfLESS is helper class to provide LESS compiling in symfony projects. | ||
* | ||
* @package sfLESSPlugin | ||
* @subpackage lib | ||
* @author Konstantin Kudryashov <ever.zet@gmail.com> | ||
* @version 1.0.0 | ||
*/ | ||
class sfLESSConfig extends LESSConfig | ||
{ | ||
/** | ||
* @see LESSConfig | ||
*/ | ||
public function isCheckDates() | ||
{ | ||
return sfConfig::get('app_sf_less_plugin_check_dates', parent::isCheckDates()); | ||
} | ||
|
||
/** | ||
* @see LESSConfig | ||
*/ | ||
public function isUseCompression() | ||
{ | ||
return sfConfig::get('app_sf_less_plugin_use_compression', parent::isUseCompression()); | ||
} | ||
|
||
/** | ||
* @see LESSConfig | ||
*/ | ||
public function getCssPaths() | ||
{ | ||
return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) . '/css/'; | ||
} | ||
|
||
/** | ||
* @see LESSConfig | ||
*/ | ||
public function getLessPaths() | ||
{ | ||
return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) . '/less/'; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.