Config item `cms.enableAssetMinify` can now be set to **null**, in which case assets are only minified if debug mode (`app.debug`) is disabled.

This commit is contained in:
Samuel Georges 2014-12-06 13:43:06 +11:00
parent 33be75af10
commit 48b90e86b6
3 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,6 @@
* **Build 16x** (2014-12-xx) * **Build 16x** (2014-12-xx)
- Config item `cms.customErrorPage` is deprecated, the setting `app.debug` should be used instead. - Config item `cms.customErrorPage` is deprecated, the setting `app.debug` should be used instead.
- Config item `cms.enableAssetMinify` can now be set to **null**, in which case assets are only minified if debug mode (`app.debug`) is disabled.
* **Build 167** (2014-12-06) * **Build 167** (2014-12-06)
- Settings pages now have a *Reset to default* button. - Settings pages now have a *Reset to default* button.

View File

@ -131,12 +131,13 @@ return array(
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| If the minification is enabled, combined assets are compressed (minified). | If the minification is enabled, combined assets are compressed (minified).
| It is recommended to disable the minification during the development, and | It is recommended to disable the minification during development, and
| enable it in the production mode. | enable it in production mode. If set to null, assets are minified
| when debug mode (app.debug) is disabled.
| |
*/ */
'enableAssetMinify' => false, 'enableAssetMinify' => null,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -75,10 +75,14 @@ class CombineAssets
public function __construct() public function __construct()
{ {
/* /*
* Register cache preference * Register preferences
*/ */
$this->useCache = Config::get('cms.enableAssetCache', false); $this->useCache = Config::get('cms.enableAssetCache', false);
$this->useMinify = Config::get('cms.enableAssetMinify', false); $this->useMinify = Config::get('cms.enableAssetMinify', null);
if ($this->useMinify === null) {
$this->useMinify = !Config::get('app.debug', false);
}
/* /*
* Register JavaScript filters * Register JavaScript filters