Enable preprocessDump.php to work without a db.
authorPlatonides <platonides@users.mediawiki.org>
Thu, 17 Mar 2011 16:06:12 +0000 (16:06 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Thu, 17 Mar 2011 16:06:12 +0000 (16:06 +0000)
Using the new hook added in r84173

maintenance/preprocessDump.php

index b52d288..89268eb 100644 (file)
@@ -56,6 +56,21 @@ class PreprocessDump extends Maintenance {
                return Maintenance::DB_NONE;
        }
 
+       public function finalSetup() {
+               parent::finalSetup();
+
+               global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks;
+               $wgUseDatabaseMessages = false;
+               $wgLocalisationCacheConf['storeClass'] =  'LCStore_Null';
+               $wgHooks['InterwikiLoadPrefix'][] = 'PreprocessDump::disableInterwikis';
+       }
+
+       static function disableInterwikis( $prefix, &$data ) {
+               # Title::newFromText will check on ach namespaced article if it's an interwiki.
+
+               return false;
+       }
+
        public function execute() {
                global $wgParser, $wgParserConf, $wgPreprocessorCacheThreshold;