From: Brion Vibber Date: Sat, 17 Jun 2006 12:51:41 +0000 (+0000) Subject: * namespaceDupes.php can now accept an arbitrary prefix, for checking rogue X-Git-Tag: 1.31.0-rc.0~56756 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=0587e96140cc150d50c1bb984aef2464c8ad3856;p=lhc%2Fweb%2Fwiklou.git * namespaceDupes.php can now accept an arbitrary prefix, for checking rogue interwikis and such. Not yet fully automated. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f896e0ec79..7163b186be 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -515,6 +515,9 @@ Some default configuration options have changed: * Update to Slovak translation (sk) * Update to Alemannic localization (gsw) * (bug 6300) Bug fixes for sr: variants +* namespaceDupes.php can now accept an arbitrary prefix, for checking rogue + interwikis and such. Not yet fully automated. + == Compatibility == diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index 6ced232a89..929bf73884 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -75,6 +75,14 @@ class NamespaceConflictChecker { } return $ok; } + + /** + * @fixme: do this for reals + */ + function checkInterwiki( $prefix, $fix, $suffix = '' ) { + echo "Checking interwiki prefix \"$prefix\"\n"; + return $this->checkNamespace( 0, $prefix, $fix, $suffix ); + } function getConflicts( $ns, $name ) { $page = $this->newSchema() ? 'page' : 'cur'; @@ -164,9 +172,15 @@ $wgTitle = Title::newFromText( 'Namespace title conflict cleanup script' ); $fix = isset( $options['fix'] ); $suffix = isset( $options['suffix'] ) ? $options['suffix'] : ''; +$prefix = isset( $options['prefix'] ) ? $options['prefix'] : ''; $dbw =& wfGetDB( DB_MASTER ); $duper = new NamespaceConflictChecker( $dbw ); -$retval = $duper->checkAll( $fix, $suffix ); + +if( $prefix ) { + $retval = $duper->checkInterwiki( $prefix, $fix, $suffix ); +} else { + $retval = $duper->checkAll( $fix, $suffix ); +} if( $retval ) { echo "\nLooks good!\n";