MediaWiki REL1_35
|
Look for duplicate user table entries and optionally prune them. More...
Public Member Functions | |
__construct (&$database, $outputCallback) | |
clearDupes () | |
Checks the database for duplicate user account records and remove them in preparation for application of a unique index on the user_name field. | |
hasUniqueIndex () | |
Check if this database's user table has already had a unique user_name index applied. | |
Private Member Functions | |
checkDupes ( $doDelete=false) | |
Checks the database for duplicate user account records in preparation for application of a unique index on the user_name field. | |
editCount ( $userid) | |
Count the number of edits attributed to this user. | |
examine ( $name, $doDelete) | |
Examine user records for the given name. | |
getDupes () | |
Grab usernames for which multiple records are present in the database. | |
lock () | |
We don't want anybody to mess with our stuff... | |
lockTable ( $table) | |
out ( $str) | |
Output some text via the output callback provided. | |
reassignEdits ( $from, $to) | |
trimAccount ( $userid) | |
Remove a user account line. | |
unlock () | |
Private Attributes | |
IMaintainableDatabase | $db |
int | $failed |
callable | $outputCallback |
int | $reassigned |
int | $trimmed |
Look for duplicate user table entries and optionally prune them.
This is still used by our MysqlUpdater at: includes/installer/MysqlUpdater.php
Definition at line 37 of file userDupes.inc.
UserDupes::__construct | ( | & | $database, |
$outputCallback | |||
) |
IMaintainableDatabase | &$database | |
callable | $outputCallback |
Definition at line 55 of file userDupes.inc.
References $outputCallback.
|
private |
Checks the database for duplicate user account records in preparation for application of a unique index on the user_name field.
Returns true if the table is clean or if duplicates can be resolved automatically.
Returns false if there are duplicates and resolution was not requested. (If doing resolution, edits may be reassigned.) Status information will be echo'd to stdout.
bool | $doDelete | Pass true to actually remove things from the database; false to just check. |
Definition at line 116 of file userDupes.inc.
References examine(), getDupes(), hasUniqueIndex(), lock(), out(), and unlock().
Referenced by clearDupes().
UserDupes::clearDupes | ( | ) |
Checks the database for duplicate user account records and remove them in preparation for application of a unique index on the user_name field.
Returns true if the table is clean or if duplicates have been resolved automatically.
May return false if there are unresolvable problems. Status information will be echo'd to stdout.
Definition at line 98 of file userDupes.inc.
References checkDupes().
|
private |
Count the number of edits attributed to this user.
Does not currently check log table or other things where it might show up...
int | $userid |
Definition at line 281 of file userDupes.inc.
Referenced by examine().
|
private |
Examine user records for the given name.
Try to see which record will be the one that actually gets used, then check remaining records for edits. If the dupes have no edits, we can safely remove them.
string | $name | |
bool | $doDelete |
Definition at line 233 of file userDupes.inc.
References editCount(), out(), reassignEdits(), and trimAccount().
Referenced by checkDupes().
|
private |
Grab usernames for which multiple records are present in the database.
Definition at line 210 of file userDupes.inc.
Referenced by checkDupes().
UserDupes::hasUniqueIndex | ( | ) |
Check if this database's user table has already had a unique user_name index applied.
Definition at line 73 of file userDupes.inc.
References out().
Referenced by checkDupes().
|
private |
We don't want anybody to mess with our stuff...
Definition at line 187 of file userDupes.inc.
Referenced by checkDupes().
|
private |
Definition at line 195 of file userDupes.inc.
|
private |
Output some text via the output callback provided.
string | $str | Text to print |
Definition at line 64 of file userDupes.inc.
Referenced by checkDupes(), examine(), hasUniqueIndex(), reassignEdits(), and trimAccount().
|
private |
int | $from | |
int | $to |
Definition at line 293 of file userDupes.inc.
References out().
Referenced by examine().
|
private |
Remove a user account line.
int | $userid |
Definition at line 306 of file userDupes.inc.
References out().
Referenced by examine().
|
private |
|
private |
Definition at line 41 of file userDupes.inc.
|
private |
Definition at line 47 of file userDupes.inc.
|
private |
Definition at line 49 of file userDupes.inc.
Referenced by __construct().
|
private |
Definition at line 43 of file userDupes.inc.
|
private |
Definition at line 45 of file userDupes.inc.