From 8c63b503b162a9e6d8fe3d1cb03919a55a2d897e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 14 Jan 2006 08:04:38 +0000 Subject: [PATCH] some more die-with-proper-return-code --- includes/GlobalFunctions.php | 4 ++-- maintenance/dumpBackup.php | 3 +-- maintenance/dumpTextPass.php | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3e9783bbe1..cc1285f8e5 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -550,7 +550,7 @@ function wfAbruptExit( $error = false ){ global $wgLoadBalancer; static $called = false; if ( $called ){ - exit(); + exit( -1 ); } $called = true; @@ -571,7 +571,7 @@ function wfAbruptExit( $error = false ){ if ( !$error ) { $wgLoadBalancer->closeAll(); } - exit(); + exit( -1 ); } /** diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index 6afaaeca0d..6f90fc5d11 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -48,8 +48,7 @@ if ( isset( $options['pagelist'] ) ) { $pages = file( $options['pagelist'] ); chdir( $olddir ); if ( $pages === false ) { - print "Unable to open file {$options['pagelist']}\n"; - exit; + wfDie( "Unable to open file {$options['pagelist']}\n" ); } $pages = array_map( 'trim', $pages ); $dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) ); diff --git a/maintenance/dumpTextPass.php b/maintenance/dumpTextPass.php index 195a42d1bd..ca03e70e87 100644 --- a/maintenance/dumpTextPass.php +++ b/maintenance/dumpTextPass.php @@ -54,7 +54,7 @@ class TextPassDumper extends BackupDumper { $result = $this->readDump( $input ); if( WikiError::isError( $result ) ) { - $this->progress( $result->getMessage() ); + wfDie( $result->getMessage() ); } $this->report( true ); @@ -113,6 +113,8 @@ class TextPassDumper extends BackupDumper { $offset += strlen( $chunk ); } while( $chunk !== false && !feof( $input ) ); xml_parser_free( $parser ); + + return true; } function getText( $id ) { -- 2.20.1