require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class NamespaceConflictChecker extends Maintenance {
+
+ /**
+ * @var DatabaseBase
+ */
+ protected $db;
+
public function __construct() {
parent::__construct();
$this->mDescription = "";
* @param $suffix String: suffix to append to renamed articles
*/
private function checkAll( $fix, $suffix = '' ) {
- global $wgContLang, $wgNamespaceAliases, $wgCanonicalNamespaceNames;
- global $wgCapitalLinks;
+ global $wgContLang, $wgNamespaceAliases, $wgCapitalLinks;
$spaces = array();
}
// Now pull in all canonical and alias namespaces...
- foreach ( $wgCanonicalNamespaceNames as $ns => $name ) {
+ foreach ( MWNamespace::getCanonicalNamespaces() as $ns => $name ) {
// This includes $wgExtraNamespaces
if ( $name !== '' ) {
$spaces[$name] = $ns;
*
* @param $ns Integer: namespace id (id for new namespace?)
* @param $name String: prefix that is being made a namespace
+ *
+ * @return array
*/
private function getConflicts( $ns, $name ) {
$page = 'page';
/**
* Report any conflicts we find
+ *
+ * @return bool
*/
private function reportConflict( $row, $suffix ) {
$newTitle = Title::makeTitleSafe( $row->namespace, $row->title );