r91590 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91589‎ | r91590 | r91591 >
Date:19:57, 6 July 2011
Author:demon
Status:ok
Tags:
Comment:
Remove last wfDie()s from maintenance
Modified paths:
  • /trunk/phase3/maintenance/backup.inc (modified) (history)
  • /trunk/phase3/maintenance/dumpBackup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/backup.inc
@@ -120,7 +120,7 @@
121121 $sinks[] = $sink;
122122 }
123123 if ( !isset( $this->outputTypes[$val] ) ) {
124 - wfDie( "Unrecognized output sink type '$val'\n" );
 124+ $this->fatalError( "Unrecognized output sink type '$val'" );
125125 }
126126 $type = $this->outputTypes[$val];
127127 $sink = new $type( $param );
@@ -130,7 +130,7 @@
131131 $sink = new DumpOutput();
132132 }
133133 if ( !isset( $this->filterTypes[$val] ) ) {
134 - wfDie( "Unrecognized filter type '$val'\n" );
 134+ $this->fatalError( "Unrecognized filter type '$val'" );
135135 }
136136 $type = $this->filterTypes[$val];
137137 $filter = new $type( $sink, $param );
@@ -150,8 +150,8 @@
151151 if ( !function_exists( 'utf8_normalize' ) ) {
152152 wfDl( "php_utfnormal.so" );
153153 if ( !function_exists( 'utf8_normalize' ) ) {
154 - wfDie( "Failed to load UTF-8 normalization extension. " .
155 - "Install or remove --force-normal parameter to use slower code.\n" );
 154+ $this->fatalError( "Failed to load UTF-8 normalization extension. " .
 155+ "Install or remove --force-normal parameter to use slower code." );
156156 }
157157 }
158158 break;
@@ -302,6 +302,11 @@
303303 function progress( $string ) {
304304 fwrite( $this->stderr, $string . "\n" );
305305 }
 306+
 307+ function fatalError( $msg ) {
 308+ $this->progress( "$msg\n" );
 309+ die(1);
 310+ }
306311 }
307312
308313 class ExportProgressFilter extends DumpFilter {
Index: trunk/phase3/maintenance/dumpBackup.php
@@ -44,7 +44,8 @@
4545 $pages = file( $options['pagelist'] );
4646 chdir( $olddir );
4747 if ( $pages === false ) {
48 - wfDie( "Unable to open file {$options['pagelist']}\n" );
 48+ echo( "Unable to open file {$options['pagelist']}\n" );
 49+ die(1);
4950 }
5051 $pages = array_map( 'trim', $pages );
5152 $dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r91602Clean up the mess that is wfDie (resolves r85918). wfDie() doesn't exist anym...demon21:01, 6 July 2011

Status & tagging log