$sinks[] = $sink;
}
if ( !isset( $this->outputTypes[$val] ) ) {
- wfDie( "Unrecognized output sink type '$val'\n" );
+ $this->fatalError( "Unrecognized output sink type '$val'" );
}
$type = $this->outputTypes[$val];
$sink = new $type( $param );
$sink = new DumpOutput();
}
if ( !isset( $this->filterTypes[$val] ) ) {
- wfDie( "Unrecognized filter type '$val'\n" );
+ $this->fatalError( "Unrecognized filter type '$val'" );
}
$type = $this->filterTypes[$val];
$filter = new $type( $sink, $param );
if ( !function_exists( 'utf8_normalize' ) ) {
wfDl( "php_utfnormal.so" );
if ( !function_exists( 'utf8_normalize' ) ) {
- wfDie( "Failed to load UTF-8 normalization extension. " .
- "Install or remove --force-normal parameter to use slower code.\n" );
+ $this->fatalError( "Failed to load UTF-8 normalization extension. " .
+ "Install or remove --force-normal parameter to use slower code." );
}
}
break;
function progress( $string ) {
fwrite( $this->stderr, $string . "\n" );
}
+
+ function fatalError( $msg ) {
+ $this->progress( "$msg\n" );
+ die(1);
+ }
}
class ExportProgressFilter extends DumpFilter {
$pages = file( $options['pagelist'] );
chdir( $olddir );
if ( $pages === false ) {
- wfDie( "Unable to open file {$options['pagelist']}\n" );
+ echo( "Unable to open file {$options['pagelist']}\n" );
+ die(1);
}
$pages = array_map( 'trim', $pages );
$dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) );