X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fminify.php;h=16e4d1c9727ca5c18d98da013cfa8e50bbf7e669;hb=2c085ac5a3c8020958d52554e13317feef30ffaf;hp=ec936c830ee021de3d426f09e1dc3eceadddb4e7;hpb=7636bea2bf3ccc33389a97d968bdda64036f59c0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/minify.php b/maintenance/minify.php index ec936c830e..16e4d1c972 100644 --- a/maintenance/minify.php +++ b/maintenance/minify.php @@ -40,16 +40,10 @@ class MinifyScript extends Maintenance { "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" . + $this->addDescription( "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."; - + "added, e.g. jquery.js -> jquery.min.js." + ); } public function execute() { @@ -66,6 +60,7 @@ class MinifyScript extends Maintenance { // Minify one file $this->minify( $this->getArg( 0 ), $this->getOption( 'outfile' ) ); + return; } @@ -103,12 +98,11 @@ class MinifyScript extends Maintenance { $this->error( "No file extension, cannot determine type: $fileName" ); exit( 1 ); } + return substr( $fileName, $dotPos + 1 ); } public function minify( $inPath, $outPath ) { - global $wgResourceLoaderMinifierStatementsOnOwnLine, $wgResourceLoaderMinifierMaxLineLength; - $extension = $this->getExtension( $inPath ); $this->output( basename( $inPath ) . ' -> ' . basename( $outPath ) . '...' ); @@ -125,10 +119,7 @@ class MinifyScript extends Maintenance { 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 );