Make readonly work for OOUI forms
[lhc/web/wiklou.git] / maintenance / dumpIterator.php
index c6b3958..d8bc3a4 100644 (file)
@@ -54,11 +54,14 @@ abstract class DumpIterator extends Maintenance {
                $this->checkOptions();
 
                if ( $this->hasOption( 'file' ) ) {
-                       $revision = new WikiRevision;
+                       $revision = new WikiRevision( $this->getConfig() );
 
                        $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,9 +70,10 @@ 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 );
+               $importer = new WikiImporter( $source, $this->getConfig() );
 
                $importer->setRevisionCallback(
                        array( &$this, 'handleRevision' ) );
@@ -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() ) ) {