X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpIterator.php;h=4b2ff717e35ccbc373754ea2e5c77c2afebbaef0;hb=2d89bdf1182df1178b9aada67a080011d29e142c;hp=cf3523e61b4923c336bc3f1d83689f008d542e99;hpb=e78776373e14c8dc208b0045bf83a44e671d6f00;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php index cf3523e61b..4b2ff717e3 100644 --- a/maintenance/dumpIterator.php +++ b/maintenance/dumpIterator.php @@ -57,8 +57,11 @@ abstract class DumpIterator extends Maintenance { $revision = new WikiRevision; $revision->setText( file_get_contents( $this->getOption( 'file' ) ) ); - $revision->setTitle( Title::newFromText( rawurldecode( basename( $this->getOption( 'file' ), '.txt' ) ) ) ); + $revision->setTitle( Title::newFromText( + rawurldecode( basename( $this->getOption( 'file' ), '.txt' ) ) + ) ); $this->handleRevision( $revision ); + return; } @@ -67,7 +70,8 @@ abstract class DumpIterator extends Maintenance { if ( $this->getOption( 'dump' ) == '-' ) { $source = new ImportStreamSource( $this->getStdin() ); } else { - $this->error( "Sorry, I don't support dump filenames yet. Use - and provide it on stdin on the meantime.", true ); + $this->error( "Sorry, I don't support dump filenames yet. " + . "Use - and provide it on stdin on the meantime.", true ); } $importer = new WikiImporter( $source ); @@ -86,8 +90,9 @@ abstract class DumpIterator extends Maintenance { $this->error( round( $this->count / $delta, 2 ) . " pages/sec" ); } - # Perform the memory_get_peak_usage() when all the other data has been output so there's no damage if it dies. - # It is only available since 5.2.0 (since 5.2.1 if you haven't compiled with --enable-memory-limit) + # Perform the memory_get_peak_usage() when all the other data has been + # output so there's no damage if it dies. It is only available since + # 5.2.0 (since 5.2.1 if you haven't compiled with --enable-memory-limit) $this->error( "Memory peak usage of " . memory_get_peak_usage() . " bytes\n" ); } @@ -118,6 +123,7 @@ abstract class DumpIterator extends Maintenance { $title = $rev->getTitle(); if ( !$title ) { $this->error( "Got bogus revision with null title!" ); + return; }