MediaWiki
1.30.0
|
Look for duplicate user table entries and optionally prune them. More...
Public Member Functions | |
__construct (&$database, $outputCallback) | |
checkDupes ( $doDelete=false) | |
Checks the database for duplicate user account records in preparation for application of a unique index on the user_name field. More... | |
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. More... | |
editCount ( $userid) | |
Count the number of edits attributed to this user. More... | |
examine ( $name, $doDelete) | |
Examine user records for the given name. More... | |
getDupes () | |
Grab usernames for which multiple records are present in the database. More... | |
hasUniqueIndex () | |
Check if this database's user table has already had a unique user_name index applied. More... | |
lock () | |
We don't want anybody to mess with our stuff... More... | |
lockTable ( $table) | |
reassignEdits ( $from, $to) | |
trimAccount ( $userid) | |
Remove a user account line. More... | |
unlock () | |
Private Member Functions | |
out ( $str) | |
Output some text via the output callback provided. More... | |
Private Attributes | |
$db | |
$failed | |
$outputCallback | |
$reassigned | |
$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 35 of file userDupes.inc.
UserDupes::__construct | ( | & | $database, |
$outputCallback | |||
) |
Definition at line 42 of file userDupes.inc.
References $outputCallback.
UserDupes::checkDupes | ( | $doDelete = false | ) |
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 103 of file userDupes.inc.
References $name, as, captcha-old\count, examine(), getDupes(), hasUniqueIndex(), lock(), out(), unlock(), and wfWikiID().
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 85 of file userDupes.inc.
References checkDupes().
UserDupes::editCount | ( | $userid | ) |
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 265 of file userDupes.inc.
Referenced by examine().
UserDupes::examine | ( | $name, | |
$doDelete | |||
) |
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 216 of file userDupes.inc.
References $name, as, editCount(), out(), reassignEdits(), and trimAccount().
Referenced by checkDupes().
UserDupes::getDupes | ( | ) |
Grab usernames for which multiple records are present in the database.
Definition at line 192 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 60 of file userDupes.inc.
References out().
Referenced by checkDupes().
UserDupes::lock | ( | ) |
We don't want anybody to mess with our stuff...
Definition at line 168 of file userDupes.inc.
References $tables.
Referenced by checkDupes().
UserDupes::lockTable | ( | $table | ) |
Definition at line 176 of file userDupes.inc.
|
private |
Output some text via the output callback provided.
string | $str | Text to print |
Definition at line 51 of file userDupes.inc.
Referenced by checkDupes(), examine(), hasUniqueIndex(), reassignEdits(), and trimAccount().
UserDupes::reassignEdits | ( | $from, | |
$to | |||
) |
int | $from | |
int | $to |
Definition at line 278 of file userDupes.inc.
References out().
Referenced by examine().
UserDupes::trimAccount | ( | $userid | ) |
Remove a user account line.
int | $userid |
Definition at line 292 of file userDupes.inc.
References out().
Referenced by examine().
UserDupes::unlock | ( | ) |
|
private |
Definition at line 36 of file userDupes.inc.
|
private |
Definition at line 39 of file userDupes.inc.
|
private |
Definition at line 40 of file userDupes.inc.
Referenced by __construct().
|
private |
Definition at line 37 of file userDupes.inc.
|
private |
Definition at line 38 of file userDupes.inc.