Index: trunk/phase3/maintenance/dumpIterator.php |
— | — | @@ -84,12 +84,23 @@ |
85 | 85 | $this->error( "Memory peak usage of " . memory_get_peak_usage() . " bytes\n" ); |
86 | 86 | } |
87 | 87 | |
88 | | - function stripParameters( $text ) { |
89 | | - if ( !$this->stripParametersEnabled ) { |
90 | | - return $text; |
| 88 | + public function finalSetup() { |
| 89 | + parent::finalSetup(); |
| 90 | + |
| 91 | + if ( $this->getDbType() == Maintenance::DB_NONE ) { |
| 92 | + global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks; |
| 93 | + $wgUseDatabaseMessages = false; |
| 94 | + $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; |
| 95 | + $wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis'; |
91 | 96 | } |
92 | | - return preg_replace( '/(<a) [^>]+>/', '$1>', $text ); |
93 | 97 | } |
| 98 | + |
| 99 | + static function disableInterwikis( $prefix, &$data ) { |
| 100 | + # Title::newFromText will check on each namespaced article if it's an interwiki. |
| 101 | + # We always answer that it is not. |
| 102 | + |
| 103 | + return false; |
| 104 | + } |
94 | 105 | |
95 | 106 | /** |
96 | 107 | * Callback function for each revision, child classes should override |
— | — | @@ -138,6 +149,10 @@ |
139 | 150 | $this->addOption( 'regex', 'Searching regex', true, true ); |
140 | 151 | } |
141 | 152 | |
| 153 | + public function getDbType() { |
| 154 | + return Maintenance::DB_NONE; |
| 155 | + } |
| 156 | + |
142 | 157 | public function processRevision( $rev ) { |
143 | 158 | if ( preg_match( $this->getOption( 'regex' ), $rev->getText() ) ) { |
144 | 159 | $this->output( $rev->getTitle() . " matches at edit from " . $rev->getTimestamp() . "\n" ); |
Index: trunk/phase3/maintenance/preprocessDump.php |
— | — | @@ -48,22 +48,6 @@ |
49 | 49 | return Maintenance::DB_NONE; |
50 | 50 | } |
51 | 51 | |
52 | | - public function finalSetup() { |
53 | | - parent::finalSetup(); |
54 | | - |
55 | | - global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks; |
56 | | - $wgUseDatabaseMessages = false; |
57 | | - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; |
58 | | - $wgHooks['InterwikiLoadPrefix'][] = 'PreprocessDump::disableInterwikis'; |
59 | | - } |
60 | | - |
61 | | - static function disableInterwikis( $prefix, &$data ) { |
62 | | - # Title::newFromText will check on each namespaced article if it's an interwiki. |
63 | | - # We always answer that it is not. |
64 | | - |
65 | | - return false; |
66 | | - } |
67 | | - |
68 | 52 | public function checkOptions() { |
69 | 53 | global $wgParser, $wgParserConf, $wgPreprocessorCacheThreshold; |
70 | 54 | |