diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /maintenance/dumpIterator.php | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'maintenance/dumpIterator.php')
-rw-r--r-- | maintenance/dumpIterator.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php index dd468a9f..4b2ff717 100644 --- a/maintenance/dumpIterator.php +++ b/maintenance/dumpIterator.php @@ -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" ); } @@ -97,7 +102,7 @@ abstract class DumpIterator extends Maintenance { if ( $this->getDbType() == Maintenance::DB_NONE ) { global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks; $wgUseDatabaseMessages = false; - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; + $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; $wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis'; } } @@ -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() ) ) { |