http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72805
Revision: 72805
Author: ialex
Date: 2010-09-11 14:21:34 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
Don't use echo in maintenance scripts that extends the Maintenance class
Modified Paths:
--------------
trunk/phase3/maintenance/minify.php
Modified: trunk/phase3/maintenance/minify.php
===================================================================
--- trunk/phase3/maintenance/minify.php 2010-09-11 14:19:44 UTC (rev 72804)
+++ trunk/phase3/maintenance/minify.php 2010-09-11 14:21:34 UTC (rev 72805)
@@ -48,13 +48,12 @@
$inDir = dirname( $inPath );
if ( strpos( $inName, '.min.' ) !== false ) {
- echo "Skipping $inName\n";
+ $this->error( "Skipping $inName\n" );
continue;
}
if ( !file_exists( $inPath ) ) {
- $this->error( "File does not exist: $arg" );
- exit( 1 );
+ $this->error( "File does not exist: $arg", true
);
}
$extension = $this->getExtension( $inName );
@@ -80,7 +79,7 @@
public function minify( $inPath, $outPath ) {
$extension = $this->getExtension( $inPath );
- echo basename( $inPath ) . ' -> ' . basename( $outPath ) .
'...';
+ $this->output( basename( $inPath ) . ' -> ' . basename(
$outPath ) . '...' );
$inText = file_get_contents( $inPath );
if ( $inText === false ) {
@@ -103,7 +102,7 @@
fwrite( $outFile, $outText );
fclose( $outFile );
- echo " ok\n";
+ $this->output( " ok\n" );
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs