r72805 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72804‎ | r72805 | r72806 >
Date:14:21, 11 September 2010
Author:ialex
Status:ok
Tags:
Comment:
Don't use echo in maintenance scripts that extends the Maintenance class
Modified paths:
  • /trunk/phase3/maintenance/minify.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/minify.php
@@ -48,13 +48,12 @@
4949 $inDir = dirname( $inPath );
5050
5151 if ( strpos( $inName, '.min.' ) !== false ) {
52 - echo "Skipping $inName\n";
 52+ $this->error( "Skipping $inName\n" );
5353 continue;
5454 }
5555
5656 if ( !file_exists( $inPath ) ) {
57 - $this->error( "File does not exist: $arg" );
58 - exit( 1 );
 57+ $this->error( "File does not exist: $arg", true );
5958 }
6059
6160 $extension = $this->getExtension( $inName );
@@ -80,7 +79,7 @@
8180
8281 public function minify( $inPath, $outPath ) {
8382 $extension = $this->getExtension( $inPath );
84 - echo basename( $inPath ) . ' -> ' . basename( $outPath ) . '...';
 83+ $this->output( basename( $inPath ) . ' -> ' . basename( $outPath ) . '...' );
8584
8685 $inText = file_get_contents( $inPath );
8786 if ( $inText === false ) {
@@ -103,7 +102,7 @@
104103
105104 fwrite( $outFile, $outText );
106105 fclose( $outFile );
107 - echo " ok\n";
 106+ $this->output( " ok\n" );
108107 }
109108 }
110109

Status & tagging log