* namespaceDupes.php can now accept an arbitrary prefix, for checking rogue
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 17 Jun 2006 12:51:41 +0000 (12:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 17 Jun 2006 12:51:41 +0000 (12:51 +0000)
  interwikis and such. Not yet fully automated.

RELEASE-NOTES
maintenance/namespaceDupes.php

index f896e0e..7163b18 100644 (file)
@@ -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 ==
 
index 6ced232..929bf73 100644 (file)
@@ -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";