Fix --pagelist for dumpBackup.php
authorAndrew H <crazy4sb@gmail.com>
Tue, 5 Jan 2016 23:42:23 +0000 (23:42 +0000)
committerAndrew H <crazy4sb@gmail.com>
Wed, 6 Jan 2016 03:23:06 +0000 (03:23 +0000)
Followup patch for I2473ee119c185d1b2b00ac4b1e70ee8a6cafe4a3,
which broke the --pagelist option for dumpBackup.

Somehow this slipped by in review.

Change-Id: Ifa1fd0f63f7b8db4d51a760e37ac0876430f2e88

maintenance/dumpBackup.php

index 6b5792a..18737a4 100644 (file)
@@ -95,13 +95,10 @@ TEXT;
                $this->reporting = !$this->hasOption( 'quiet' );
 
                if ( $this->hasOption( 'pagelist' ) ) {
-                       $olddir = getcwd();
-                       chdir( $originalDir );
-                       $pages = file( $this->getOption( 'quiet' ) );
-                       chdir( $olddir );
+                       $filename = $this->getOption( 'pagelist' );
+                       $pages = file( $filename );
                        if ( $pages === false ) {
-                               echo "Unable to open file {$options['pagelist']}\n";
-                               die( 1 );
+                               $this->fatalError( "Unable to open file {$filename}\n" );
                        }
                        $pages = array_map( 'trim', $pages );
                        $this->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) );