From cecb985bee3bdd252e1b8dc0bd500b37cd52be01 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 16 May 2007 20:58:53 +0000 Subject: Aktualisierung auf MediaWiki 1.10.0 Plugins angepasst und verbessert kleine Korrekturen am Design --- maintenance/dumpInterwiki.inc | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'maintenance/dumpInterwiki.inc') diff --git a/maintenance/dumpInterwiki.inc b/maintenance/dumpInterwiki.inc index 2039f2df..9af6ccc5 100644 --- a/maintenance/dumpInterwiki.inc +++ b/maintenance/dumpInterwiki.inc @@ -4,16 +4,14 @@ * Wikimedia specific! * * @todo document - * @package MediaWiki - * @subpackage Maintenance + * @addtogroup Maintenance */ /** */ /** * @todo document - * @package MediaWiki - * @subpackage Maintenance + * @addtogroup Maintenance */ class Site { var $suffix, $lateral, $url; @@ -52,15 +50,10 @@ function getRebuildInterwikiDump() { # List of all database names $dblist = array_map( "trim", file( "/home/wikipedia/common/all.dblist" ) ); - # Special-case hostnames - $specials = array( - 'sourceswiki' => 'sources.wikipedia.org', - 'quotewiki' => 'wikiquote.org', - 'textbookwiki' => 'wikibooks.org', - 'sep11wiki' => 'sep11.wikipedia.org', - 'metawiki' => 'meta.wikimedia.org', - 'commonswiki' => 'commons.wikimedia.org', - ); + # Special-case databases + $specials = array_flip( + array_map( "trim", + file( "/home/wikipedia/common/special.dblist" ) ) ); # Extra interwiki links that can't be in the intermap for some reason $extraLinks = array( @@ -106,8 +99,7 @@ function getRebuildInterwikiDump() { wfDie( "m:Interwiki_map not found" ); } - $iwArray = array(); - # Global iterwiki map + # Global iterwiki map foreach ( $lines as $line ) { if ( preg_match( '/^\|\s*(.*?)\s*\|\|\s*(.*?)\s*$/', $line, $matches ) ) { $prefix = strtolower( $matches[1] ); @@ -130,7 +122,7 @@ function getRebuildInterwikiDump() { #Multilanguage sites foreach ($sites as $site) - $sql .= makeLanguageLinks ( $site, "_".$site->suffix ); + makeLanguageLinks ( $site, "_".$site->suffix ); foreach ( $dblist as $db ) { @@ -162,7 +154,6 @@ function getRebuildInterwikiDump() { continue; } $lang = $matches[1]; - $host = "$lang." . $site->url; # Lateral links foreach ( $sites as $targetSite ) { @@ -187,7 +178,7 @@ function getRebuildInterwikiDump() { # ------------------------------------------------------------------------------------------ -# Returns part of an INSERT statement, corresponding to all interlanguage links to a particular site +# Executes part of an INSERT statement, corresponding to all interlanguage links to a particular site function makeLanguageLinks( &$site, $source ) { global $langlist, $languageAliases; # Actual languages with their own databases -- cgit v1.2.3-54-g00ecf