Index: trunk/phase3/maintenance/backup.inc |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | $sinks[] = $sink; |
122 | 122 | } |
123 | 123 | if ( !isset( $this->outputTypes[$val] ) ) { |
124 | | - wfDie( "Unrecognized output sink type '$val'\n" ); |
| 124 | + $this->fatalError( "Unrecognized output sink type '$val'" ); |
125 | 125 | } |
126 | 126 | $type = $this->outputTypes[$val]; |
127 | 127 | $sink = new $type( $param ); |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | $sink = new DumpOutput(); |
132 | 132 | } |
133 | 133 | if ( !isset( $this->filterTypes[$val] ) ) { |
134 | | - wfDie( "Unrecognized filter type '$val'\n" ); |
| 134 | + $this->fatalError( "Unrecognized filter type '$val'" ); |
135 | 135 | } |
136 | 136 | $type = $this->filterTypes[$val]; |
137 | 137 | $filter = new $type( $sink, $param ); |
— | — | @@ -150,8 +150,8 @@ |
151 | 151 | if ( !function_exists( 'utf8_normalize' ) ) { |
152 | 152 | wfDl( "php_utfnormal.so" ); |
153 | 153 | 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." ); |
156 | 156 | } |
157 | 157 | } |
158 | 158 | break; |
— | — | @@ -302,6 +302,11 @@ |
303 | 303 | function progress( $string ) { |
304 | 304 | fwrite( $this->stderr, $string . "\n" ); |
305 | 305 | } |
| 306 | + |
| 307 | + function fatalError( $msg ) { |
| 308 | + $this->progress( "$msg\n" ); |
| 309 | + die(1); |
| 310 | + } |
306 | 311 | } |
307 | 312 | |
308 | 313 | class ExportProgressFilter extends DumpFilter { |
Index: trunk/phase3/maintenance/dumpBackup.php |
— | — | @@ -44,7 +44,8 @@ |
45 | 45 | $pages = file( $options['pagelist'] ); |
46 | 46 | chdir( $olddir ); |
47 | 47 | if ( $pages === false ) { |
48 | | - wfDie( "Unable to open file {$options['pagelist']}\n" ); |
| 48 | + echo( "Unable to open file {$options['pagelist']}\n" ); |
| 49 | + die(1); |
49 | 50 | } |
50 | 51 | $pages = array_map( 'trim', $pages ); |
51 | 52 | $dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) ); |