X-Git-Url: http://git.cyclocoop.org/%24action?a=blobdiff_plain;f=maintenance%2FmoveBatch.php;h=ae47008482498257686f701e72b48b8952cb8fa1;hb=7bbe971aec2d548de981a12ed08a7b56a536dcdb;hp=6355bc46012eead16e3f7111b6fe61b9c49bafbf;hpb=53335b60b844ad144a9e54d0b53b55dcd7cbb035;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 6355bc4601..ae47008482 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -2,8 +2,8 @@ # Move a batch of pages # Usage: php moveBatch.php [-u ] [-r ] [-i ] -# where -# is a file where each line has two titles separated by a pipe +# where +# is a file where each line has two titles separated by a pipe # character. The first title is the source, the second is the destination. # is the username # is the move reason @@ -43,6 +43,7 @@ $wgUser = User::newFromName( $user ); $file = fopen( $filename, 'r' ); if ( !$file ) { print "Unable to read file, exiting\n"; + exit; } $dbw =& wfGetDB( DB_MASTER ); @@ -65,14 +66,16 @@ for ( $linenum = 1; !feof( $file ); $linenum++ ) { } + print $source->getPrefixedText(); $dbw->begin(); $source->moveTo( $dest, false, $reason ); $dbw->immediateCommit(); + print "\n"; - wfWaitForSlaves( 5 ); if ( $interval ) { sleep( $interval ); } + wfWaitForSlaves( 5 ); }