=== Configuration changes in 1.27 ===
* Removed $wgUseLinkNamespaceDBFields
+* Deprecated $wgResourceLoaderMinifierStatementsOnOwnLine and
+ $wgResourceLoaderMinifierMaxLineLength, because there was little value in
+ making the behavior configurable. The default values (`false` for the former,
+ 1000 for the latter) are now hard-coded.
=== New features in 1.27 ===
/**
* Put each statement on its own line when minifying JavaScript. This makes
* debugging in non-debug mode a bit easier.
+ *
+ * @deprecated since 1.27: Always false; no longer configurable.
*/
$wgResourceLoaderMinifierStatementsOnOwnLine = false;
* Maximum line length when minifying JavaScript. This is not a hard maximum:
* the minifier will try not to produce lines longer than this, but may be
* forced to do so in certain cases.
+ *
+ * @deprecated since 1.27: Always 1,000; no longer configurable.
*/
$wgResourceLoaderMinifierMaxLineLength = 1000;
private static function applyFilter( $filter, $data, Config $config ) {
switch ( $filter ) {
case 'minify-js':
- return JavaScriptMinifier::minify( $data,
- $config->get( 'ResourceLoaderMinifierStatementsOnOwnLine' ),
- $config->get( 'ResourceLoaderMinifierMaxLineLength' )
- );
+ return JavaScriptMinifier::minify( $data );
case 'minify-css':
return CSSMin::minify( $data );
}
"Directory for output. If this is not specified, and neither is --outfile, then the\n" .
"output files will be sent to the same directories as the input files.",
false, true );
- $this->addOption( 'js-statements-on-own-line',
- "Boolean value for putting statements on their own line when minifying JavaScript.",
- false, true );
- $this->addOption( 'js-max-line-length',
- "Maximum line length for JavaScript minification.",
- false, true );
$this->mDescription = "Minify a file or set of files.\n\n" .
"If --outfile is not specified, then the output file names will have a .min extension\n" .
"added, e.g. jquery.js -> jquery.min.js.";
}
public function minify( $inPath, $outPath ) {
- global $wgResourceLoaderMinifierStatementsOnOwnLine, $wgResourceLoaderMinifierMaxLineLength;
-
$extension = $this->getExtension( $inPath );
$this->output( basename( $inPath ) . ' -> ' . basename( $outPath ) . '...' );
switch ( $extension ) {
case 'js':
- $outText = JavaScriptMinifier::minify( $inText,
- $this->getOption( 'js-statements-on-own-line', $wgResourceLoaderMinifierStatementsOnOwnLine ),
- $this->getOption( 'js-max-line-length', $wgResourceLoaderMinifierMaxLineLength )
- );
+ $outText = JavaScriptMinifier::minify( $inText );
break;
case 'css':
$outText = CSSMin::minify( $inText );