Implement autocompletion for Performer field on Special:Log
[lhc/web/wiklou.git] / maintenance / dumpIterator.php
index 73296b7..4b2ff71 100644 (file)
@@ -5,7 +5,7 @@
  * We implement below the simple task of searching inside a dump.
  *
  * Copyright © 2011 Platonides
- * http://www.mediawiki.org/
+ * https://www.mediawiki.org/
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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" );
        }
 
@@ -112,12 +117,13 @@ abstract class DumpIterator extends Maintenance {
        /**
         * Callback function for each revision, child classes should override
         * processRevision instead.
-        * @param $rev Revision
+        * @param DatabaseBase $rev
         */
        public function handleRevision( $rev ) {
                $title = $rev->getTitle();
                if ( !$title ) {
                        $this->error( "Got bogus revision with null title!" );
+
                        return;
                }
 
@@ -167,7 +173,7 @@ class SearchDump extends DumpIterator {
        }
 
        /**
-        * @param $rev Revision
+        * @param Revision $rev
         */
        public function processRevision( $rev ) {
                if ( preg_match( $this->getOption( 'regex' ), $rev->getContent()->getTextForSearchIndex() ) ) {