Index: trunk/phase3/maintenance/namespaceDupes.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | -# Copyright (C) 2005 Brion Vibber <brion@pobox.com> |
| 3 | +# Copyright (C) 2005-2007 Brion Vibber <brion@pobox.com> |
4 | 4 | # http://www.mediawiki.org/ |
5 | 5 | # |
6 | 6 | # This program is free software; you can redistribute it and/or modify |
— | — | @@ -21,7 +21,6 @@ |
22 | 22 | |
23 | 23 | /** */ |
24 | 24 | require_once( 'commandLine.inc' ); |
25 | | -#require_once( 'maintenance/userDupes.inc' ); |
26 | 25 | |
27 | 26 | if(isset( $options['help'] ) ) { |
28 | 27 | print <<<END |
— | — | @@ -30,21 +29,38 @@ |
31 | 30 | --fix : attempt to automatically fix errors |
32 | 31 | --suffix=<text> : dupes will be renamed with correct namespace with <text> |
33 | 32 | appended after the article name. |
| 33 | + --prefix=<text> : Do an explicit check for the given title prefix |
| 34 | + in place of the standard namespace list. |
34 | 35 | |
35 | 36 | END; |
36 | 37 | die; |
37 | 38 | } |
38 | 39 | |
39 | 40 | class NamespaceConflictChecker { |
40 | | - function NamespaceConflictChecker( &$db ) { |
41 | | - $this->db =& $db; |
| 41 | + function NamespaceConflictChecker( $db ) { |
| 42 | + $this->db = $db; |
42 | 43 | } |
43 | 44 | |
44 | 45 | function checkAll( $fix, $suffix = '' ) { |
45 | | - global $wgContLang; |
46 | | - $spaces = $wgContLang->getNamespaces(); |
| 46 | + global $wgContLang, $wgNamespaceAliases, $wgCanonicalNamespaceNames; |
| 47 | + |
| 48 | + $spaces = array(); |
| 49 | + foreach( $wgContLang->getNamespaces() as $ns => $name ) { |
| 50 | + $spaces[$name] = $ns; |
| 51 | + } |
| 52 | + foreach( $wgCanonicalNamespaceNames as $ns => $name ) { |
| 53 | + $spaces[$name] = $ns; |
| 54 | + } |
| 55 | + foreach( $wgNamespaceAliases as $name => $ns ) { |
| 56 | + $spaces[$name] = $ns; |
| 57 | + } |
| 58 | + foreach( $wgContLang->namespaceAliases as $name => $ns ) { |
| 59 | + $spaces[$name] = $ns; |
| 60 | + } |
| 61 | + asort( $spaces ); |
| 62 | + |
47 | 63 | $ok = true; |
48 | | - foreach( $spaces as $ns => $name ) { |
| 64 | + foreach( $spaces as $name => $ns ) { |
49 | 65 | $ok = $this->checkNamespace( $ns, $name, $fix, $suffix ) && $ok; |
50 | 66 | } |
51 | 67 | return $ok; |
— | — | @@ -85,7 +101,7 @@ |
86 | 102 | } |
87 | 103 | |
88 | 104 | function getConflicts( $ns, $name ) { |
89 | | - $page = $this->newSchema() ? 'page' : 'cur'; |
| 105 | + $page = 'page'; |
90 | 106 | $table = $this->db->tableName( $page ); |
91 | 107 | |
92 | 108 | $prefix = $this->db->strencode( $name ); |
— | — | @@ -134,9 +150,7 @@ |
135 | 151 | $title = Title::makeTitleSafe( $row->namespace, $row->title ); |
136 | 152 | echo "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n"; |
137 | 153 | } |
138 | | - $tables = $this->newSchema() |
139 | | - ? array( 'page' ) |
140 | | - : array( 'cur', 'old' ); |
| 154 | + $tables = array( 'page' ); |
141 | 155 | foreach( $tables as $table ) { |
142 | 156 | $this->resolveConflictOn( $row, $table ); |
143 | 157 | } |
— | — | @@ -160,10 +174,6 @@ |
161 | 175 | echo "ok.\n"; |
162 | 176 | return true; |
163 | 177 | } |
164 | | - |
165 | | - function newSchema() { |
166 | | - return class_exists( 'Revision' ); |
167 | | - } |
168 | 178 | } |
169 | 179 | |
170 | 180 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -212,7 +212,9 @@ |
213 | 213 | Special:Prefixindex; making forms prettier for RTL wikis. |
214 | 214 | * (bug 10334) Replace normal spaces before percent (%) signs with non-breaking |
215 | 215 | spaces |
| 216 | +* (bug 10372) namespaceDupes.php no longer ignores namespace aliases |
216 | 217 | |
| 218 | + |
217 | 219 | == API changes since 1.10 == |
218 | 220 | |
219 | 221 | (For ongoing development discussion, see http://www.mediawiki.org/wiki/API) |