From 5c4ddbbd525c2f250cc00fa1baad24e00dd61b53 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 6 Jul 2011 19:57:52 +0000 Subject: [PATCH] Remove last wfDie()s from maintenance --- maintenance/backup.inc | 13 +++++++++---- maintenance/dumpBackup.php | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/maintenance/backup.inc b/maintenance/backup.inc index 206d4433fe..583b1093aa 100644 --- a/maintenance/backup.inc +++ b/maintenance/backup.inc @@ -120,7 +120,7 @@ class BackupDumper { $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 ); @@ -130,7 +130,7 @@ class BackupDumper { $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 ); @@ -150,8 +150,8 @@ class BackupDumper { 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; @@ -302,6 +302,11 @@ class BackupDumper { function progress( $string ) { fwrite( $this->stderr, $string . "\n" ); } + + function fatalError( $msg ) { + $this->progress( "$msg\n" ); + die(1); + } } class ExportProgressFilter extends DumpFilter { diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index 16400297db..e058198c58 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -44,7 +44,8 @@ if ( isset( $options['pagelist'] ) ) { $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 !== "";' ) ); -- 2.20.1