some more die-with-proper-return-code
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 14 Jan 2006 08:04:38 +0000 (08:04 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 14 Jan 2006 08:04:38 +0000 (08:04 +0000)
includes/GlobalFunctions.php
maintenance/dumpBackup.php
maintenance/dumpTextPass.php

index 3e9783b..cc1285f 100644 (file)
@@ -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 );
 }
 
 /**
index 6afaaec..6f90fc5 100644 (file)
@@ -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 !== "";' ) );
index 195a42d..ca03e70 100644 (file)
@@ -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 ) {