[TASK] Rename and deprecate config.minifyJS / config.minifyCSS
authorXavier Perseguers <xavier@typo3.org>
Tue, 2 Aug 2011 12:11:02 +0000 (14:11 +0200)
committerOliver Hader <oliver@typo3.org>
Tue, 2 Aug 2011 13:03:06 +0000 (15:03 +0200)
For consistency reasons, config.minifyJS should be renamed to config.compressJs
and config.minifyCSS should be renamed to config.compressCss.

Change-Id: I064e1213263dde5cd410177be6cf68646e8b8f8d
Resolves: #28677
Releases: 4.6
Reviewed-on: http://review.typo3.org/4022
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
NEWS.txt
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/sysext/t3editor/res/tsref/tsref.xml

index b165581..106874a 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -180,13 +180,14 @@ TypoScript / Frontend
 
 * Compression and concatenation of CSS and JavaScript files
 
-New builtin minifcation routines can now be used with config.minifyCSS and
-minifyJS to reduce the file size of all files configured in page.includeCSS
-and includeJS. Single files can be excluded from compression using the new
-option disableCompression. Additionally, files can be concatenated into a
-single file using config.concatenateCss and concatenateJs. Please note that
-there is only limited support for @charset, @import and @namespace statements
-in concatenated CSS files. Furthermore, if minifyCSS/JS is enabled,
+New builtin minification routines can now be used with config.compressCss and
+config.compressJs to reduce the file size of all files configured in
+page.includeCSS and page.includeJS. Single files can be excluded from
+compression using the new option disableCompression. Additionally, files can
+be concatenated into a single file using config.concatenateCss and
+config.concatenateJs. Please note that there is only limited support for
+@charset, @import and @namespace statements in concatenated CSS files.
+Furthermore, if compressCss/compressJs is enabled,
 $TYPO3_CONF_VARS[FE][compressionLevel] now also affects CSS and JS files in
 frontend and applies GZIP compression. This requires the same options as for
 [BE][compressionLevel] to be set in .htaccess.
index fef8aff..f6ca213 100644 (file)
                                                if (!isset($this->config['config']['inlineStyle2TempFile'])) {
                                                        $this->config['config']['inlineStyle2TempFile'] = 1;
                                                }
-                                               if (!isset($this->config['config']['minifyJS'])) {
-                                                       $this->config['config']['minifyJS'] = 1;
+                                               if (isset($this->config['config']['minifyJS'])) {
+                                                       $this->logDeprecatedTyposcript('config.minifyJS = 1', 'It will be removed in TYPO3 4.8. Use config.compressJs instead.');
+                                                       if (!isset($this->config['config']['compressJs'])) {
+                                                               $this->config['config']['compressJs'] = $this->config['config']['minifyJS'];
+                                                       }
+                                               }
+                                               if (!isset($this->config['config']['compressJs'])) {
+                                                       $this->config['config']['compressJs'] = 1;
                                                }
                                        }
 
index 0a10191..6710ed5 100644 (file)
@@ -910,7 +910,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                $inlineFooterJs = $GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['jsFooterInline.'], 'jsFooterInline.');
 
                        // Should minify?
-               if ($GLOBALS['TSFE']->config['config']['minifyJS']) {
+               if ($GLOBALS['TSFE']->config['config']['compressJs']) {
                        $pageRenderer->enableCompressJavascript();
                        $minifyErrorScript = $minifyErrorInline = '';
                        $scriptJsCode = t3lib_div::minifyJavaScript($scriptJsCode, $minifyErrorScript);
@@ -935,13 +935,13 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                if (! $GLOBALS['TSFE']->config['config']['removeDefaultJS']) {
                                // inlude default and inlineJS
                        if ($scriptJsCode) {
-                               $pageRenderer->addJsInlineCode('_scriptCode', $scriptJsCode, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsInlineCode('_scriptCode', $scriptJsCode, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
                        if ($inlineJS) {
-                               $pageRenderer->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
                        if ($inlineFooterJs) {
-                               $pageRenderer->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
                } elseif ($GLOBALS['TSFE']->config['config']['removeDefaultJS'] === 'external') {
                        /*
@@ -956,25 +956,25 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                        $inlineJSint = '';
                        self::stripIntObjectPlaceholder($inlineJS, $inlineJSint);
                        if ($inlineJSint) {
-                               $pageRenderer->addJsInlineCode('TS_inlineJSint', $inlineJSint, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsInlineCode('TS_inlineJSint', $inlineJSint, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
-                       $pageRenderer->addJsFile(TSpagegen::inline2TempFile($scriptJsCode . $inlineJS, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['minifyJS']);
+                       $pageRenderer->addJsFile(TSpagegen::inline2TempFile($scriptJsCode . $inlineJS, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['compressJs']);
 
                        if ($inlineFooterJs) {
                                $inlineFooterJSint = '';
                                self::stripIntObjectPlaceholder($inlineFooterJs, $inlineFooterJSint);
                                if ($inlineFooterJSint) {
-                                       $pageRenderer->addJsFooterInlineCode('TS_inlineFooterJSint', $inlineFooterJSint, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                                       $pageRenderer->addJsFooterInlineCode('TS_inlineFooterJSint', $inlineFooterJSint, $GLOBALS['TSFE']->config['config']['compressJs']);
                                }
-                               $pageRenderer->addJsFooterFile(TSpagegen::inline2TempFile($inlineFooterJs, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsFooterFile(TSpagegen::inline2TempFile($inlineFooterJs, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
                } else {
                                // include only inlineJS
                        if ($inlineJS) {
-                               $pageRenderer->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
                        if ($inlineFooterJs) {
-                               $pageRenderer->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['minifyJS']);
+                               $pageRenderer->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['compressJs']);
                        }
                }
 
@@ -992,10 +992,22 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                }
 
                        // compression and concatenate settings
+               if (isset($GLOBALS['TSFE']->config['config']['minifyCSS'])) {
+                       $GLOBALS['TSFE']->logDeprecatedTyposcript('config.minifyCSS = 1', 'It will be removed in TYPO3 4.8. Use config.compressCss instead.');
+                       if (!isset($GLOBALS['TSFE']->config['config']['compressCss'])) {
+                               $GLOBALS['TSFE']->config['config']['compressCss'] = $GLOBALS['TSFE']->config['config']['minifyCSS'];
+                       }
+               }
                if ($GLOBALS['TSFE']->config['config']['minifyCSS']) {
                        $pageRenderer->enableCompressCss();
                }
-               if ($GLOBALS['TSFE']->config['config']['minifyJS']) {
+               if (isset($GLOBALS['TSFE']->config['config']['minifyJS'])) {
+                       $GLOBALS['TSFE']->logDeprecatedTyposcript('config.minifyJS = 1', 'It will be removed in TYPO3 4.8. Use config.compressJs instead.');
+                       if (!isset($GLOBALS['TSFE']->config['config']['compressJs'])) {
+                               $GLOBALS['TSFE']->config['config']['compressJs'] = $GLOBALS['TSFE']->config['config']['minifyJS'];
+                       }
+               }
+               if ($GLOBALS['TSFE']->config['config']['compressJs']) {
                        $pageRenderer->enableCompressJavascript();
                }
                if ($GLOBALS['TSFE']->config['config']['concatenateCss']) {
index b88caf2..f458a92 100644 (file)
@@ -6465,7 +6465,7 @@ page.jsInline {
 Note:
 
 with config.removeDefaultJS = external, the inlineJS is moved to external file.
-with config.minifyJS = 1, the jsInline will be minified as well.
+with config.compressJs = 1, the jsInline will be minified as well.
 ]]></description>
                        <default><![CDATA[
 ]]></default>