MediaWiki  REL1_19
NamespaceConflictChecker Class Reference

Check for articles to fix after adding/deleting namespaces. More...

Inheritance diagram for NamespaceConflictChecker:
Collaboration diagram for NamespaceConflictChecker:

List of all members.

Public Member Functions

 __construct ()
 Default constructor.
 execute ()
 Do the actual work.

Protected Attributes

 $db

Private Member Functions

 checkAll ($fix, $suffix= '')
 checkNamespace ($ns, $name, $fix, $suffix= '')
 checkPrefix ($key, $prefix, $fix, $suffix= '')
 getConflicts ($ns, $name)
 Find pages in mainspace that have a prefix of the new namespace so we know titles that will need migrating.
 getInterwikiList ()
 Get the interwiki list.
 reportConflict ($row, $suffix)
 Report any conflicts we find.
 resolveConflict ($row, $resolvable, $suffix)
 Resolve any conflicts.
 resolveConflictOn ($row, $table, $prefix)
 Resolve a given conflict.

Detailed Description

Check for articles to fix after adding/deleting namespaces.

Copyright (C) 2005-2007 Brion Vibber <[email protected]> http://www.mediawiki.org/

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Definition at line 28 of file namespaceDupes.php.


Constructor & Destructor Documentation

Default constructor.

Children should call this *first* if implementing their own constructors

Reimplemented from Maintenance.

Definition at line 35 of file namespaceDupes.php.

References Maintenance\addOption().

Here is the call graph for this function:


Member Function Documentation

NamespaceConflictChecker::checkAll ( fix,
suffix = '' 
) [private]
Todo:
Document
Parameters:
$fixBoolean: whether or not to fix broken entries
$suffixString: suffix to append to renamed articles
Returns:
bool

Definition at line 76 of file namespaceDupes.php.

References $ok, $wgCapitalLinks, $wgContLang, $wgNamespaceAliases, checkNamespace(), MWNamespace\getCanonicalNamespaces(), and getInterwikiList().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

NamespaceConflictChecker::checkNamespace ( ns,
name,
fix,
suffix = '' 
) [private]
Todo:
Document
Parameters:
$nsInteger: a namespace id
$nameString
$fixBoolean: whether to fix broken entries
$suffixString: suffix to append to renamed articles
Returns:
bool

Definition at line 163 of file namespaceDupes.php.

References $count, $ok, getConflicts(), reportConflict(), and resolveConflict().

Referenced by checkAll(), and checkPrefix().

Here is the call graph for this function:

Here is the caller graph for this function:

NamespaceConflictChecker::checkPrefix ( key,
prefix,
fix,
suffix = '' 
) [private]
Todo:
: do this for reals
Parameters:
$key
$prefix
$fix
$suffixstring
Returns:
bool

Definition at line 189 of file namespaceDupes.php.

References checkNamespace(), and Maintenance\output().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Do the actual work.

All child classes will need to implement this

Reimplemented from Maintenance.

Definition at line 45 of file namespaceDupes.php.

References $wgTitle, checkAll(), checkPrefix(), Maintenance\getOption(), Maintenance\hasOption(), Title\newFromText(), Maintenance\output(), and wfGetDB().

Here is the call graph for this function:

NamespaceConflictChecker::getConflicts ( ns,
name 
) [private]

Find pages in mainspace that have a prefix of the new namespace so we know titles that will need migrating.

Parameters:
$nsInteger: namespace id (id for new namespace?)
$nameString: prefix that is being made a namespace
Returns:
array

Definition at line 203 of file namespaceDupes.php.

References $page, and $result.

Referenced by checkNamespace().

Here is the caller graph for this function:

Get the interwiki list.

Todo:
Needs to respect interwiki cache!
Returns:
Array

Definition at line 146 of file namespaceDupes.php.

References $result.

Referenced by checkAll().

Here is the caller graph for this function:

NamespaceConflictChecker::reportConflict ( row,
suffix 
) [private]

Report any conflicts we find.

Returns:
bool

Definition at line 239 of file namespaceDupes.php.

References Title\makeTitleSafe(), and Maintenance\output().

Referenced by checkNamespace().

Here is the call graph for this function:

Here is the caller graph for this function:

NamespaceConflictChecker::resolveConflict ( row,
resolvable,
suffix 
) [private]

Resolve any conflicts.

Parameters:
$rowObject: row from the page table to fix
$resolvableBoolean
$suffixString: suffix to append to the fixed page
Returns:
bool

Definition at line 277 of file namespaceDupes.php.

References $title, Title\makeTitleSafe(), Maintenance\output(), and resolveConflictOn().

Referenced by checkNamespace().

Here is the call graph for this function:

Here is the caller graph for this function:

NamespaceConflictChecker::resolveConflictOn ( row,
table,
prefix 
) [private]

Resolve a given conflict.

Parameters:
$rowObject: row from the old broken entry
$tableString: table to update
$prefixString: prefix for column name, like page or ar
Returns:
bool

Definition at line 309 of file namespaceDupes.php.

References Title\makeTitleSafe(), and Maintenance\output().

Referenced by resolveConflict().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

NamespaceConflictChecker::$db [protected]

Definition at line 33 of file namespaceDupes.php.


The documentation for this class was generated from the following file: