[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/maintenance/ -> userDupes.inc (summary)

Helper class for update.php. Copyright © 2005 Brion Vibber <[email protected]> https://www.mediawiki.org/

File Size: 297 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

UserDupes:: (13 methods):
  __construct()
  out()
  hasUniqueIndex()
  clearDupes()
  checkDupes()
  lock()
  lockTable()
  unlock()
  getDupes()
  examine()
  editCount()
  reassignEdits()
  trimAccount()


Class: UserDupes  - X-Ref

Look for duplicate user table entries and optionally prune them.

This is still used by our MysqlUpdater at:
includes/installer/MysqlUpdater.php

__construct( &$database, $outputCallback )   X-Ref
No description

out( $str )   X-Ref
Output some text via the output callback provided

param: string $str Text to print

hasUniqueIndex()   X-Ref
Check if this database's user table has already had a unique
user_name index applied.

return: bool

clearDupes()   X-Ref
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.

return: bool

checkDupes( $doDelete = false )   X-Ref
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.

param: bool $doDelete Pass true to actually remove things
return: bool

lock()   X-Ref
We don't want anybody to mess with our stuff...


lockTable( $table )   X-Ref
No description

unlock()   X-Ref


getDupes()   X-Ref
Grab usernames for which multiple records are present in the database.

return: array

examine( $name, $doDelete )   X-Ref
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.

param: string $name
param: bool $doDelete

editCount( $userid )   X-Ref
Count the number of edits attributed to this user.
Does not currently check log table or other things
where it might show up...

param: int $userid
return: int

reassignEdits( $from, $to )   X-Ref

param: int $from
param: int $to

trimAccount( $userid )   X-Ref
Remove a user account line.

param: int $userid



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1