MediaWiki  REL1_20
ReassignEdits Class Reference

Maintenance script that reassigns edits from a user or IP address to another user. More...

Inheritance diagram for ReassignEdits:
Collaboration diagram for ReassignEdits:

List of all members.

Public Member Functions

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

Private Member Functions

 doReassignEdits (&$from, &$to, $rc=false, $report=false)
 Reassign edits from one user to another.
 initialiseUser ($username)
 Initialise the user object.
 userConditions (&$user, $idfield, $utfield)
 Return the most efficient set of user conditions i.e.
 userSpecification (&$user, $idfield, $utfield)
 Return user specifications i.e.

Detailed Description

Maintenance script that reassigns edits from a user or IP address to another user.

Definition at line 34 of file reassignEdits.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 reassignEdits.php.

References Maintenance\addArg(), and Maintenance\addOption().


Member Function Documentation

ReassignEdits::doReassignEdits ( &$  from,
&$  to,
rc = false,
report = false 
) [private]

Reassign edits from one user to another.

Parameters:
$fromUser to take edits from
$toUser to assign edits to
$rcbool Update the recent changes table
$reportbool Don't change things; just echo numbers
Returns:
integer Number of entries changed, or that would be changed

Definition at line 76 of file reassignEdits.php.

References $res, $total, Maintenance\output(), userConditions(), userSpecification(), and wfGetDB().

Referenced by execute().

Do the actual work.

All child classes will need to implement this

Reimplemented from Maintenance.

Definition at line 45 of file reassignEdits.php.

References doReassignEdits(), Maintenance\error(), Maintenance\getArg(), Maintenance\hasArg(), Maintenance\hasOption(), initialiseUser(), and Maintenance\output().

ReassignEdits::initialiseUser ( username) [private]

Initialise the user object.

Parameters:
$usernamestring Username or IP address
Returns:
User

Definition at line 163 of file reassignEdits.php.

References $user, Maintenance\error(), User\isIP(), and User\newFromName().

Referenced by execute().

ReassignEdits::userConditions ( &$  user,
idfield,
utfield 
) [private]

Return the most efficient set of user conditions i.e.

a user => id mapping, or a user_text => text mapping

Parameters:
$userUser for the condition
$idfieldstring Field name containing the identifier
$utfieldstring Field name containing the user text
Returns:
array

Definition at line 140 of file reassignEdits.php.

References $user.

Referenced by doReassignEdits().

ReassignEdits::userSpecification ( &$  user,
idfield,
utfield 
) [private]

Return user specifications i.e.

user => id, user_text => text

Parameters:
$userUser for the spec
$idfieldstring Field name containing the identifier
$utfieldstring Field name containing the user text
Returns:
array

Definition at line 153 of file reassignEdits.php.

References $user.

Referenced by doReassignEdits().


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