MediaWiki REL1_31
|
Class which performs the actual renaming of users. More...
Public Member Functions | |
__construct ( $old, $new, $uid, User $renamer, $options=[]) | |
Constructor. | |
rename () | |
Do the rename operation. | |
Static Public Member Functions | |
static | getActorMigrationStage () |
Fetch the core actor table schema migration stage. | |
Public Attributes | |
bool | $checkIfUserExists |
Flag that can be set to false, in case another process has already started the updates and the old username may have already been renamed in the user table. | |
string | $new |
The new username. | |
string | $old |
The old username. | |
array | $tables |
The the tables => fields to be updated. | |
array | $tablesJob |
tables => fields to be updated in a deferred job | |
integer | $uid |
The user ID. | |
const | CONTRIB_JOB = 500 |
Users with more than this number of edits will have their rename operation deferred via the job queue. | |
const | NAME_COL = 0 |
const | TIME_COL = 2 |
const | UID_COL = 1 |
Protected Member Functions | |
debug ( $msg) | |
Static Private Member Functions | |
static | lockUserAndGetId ( $name) |
Private Attributes | |
string | $debugPrefix = '' |
A prefix to use in all debug log messages. | |
string | $reason = '' |
Reason to be used in the log entry. | |
User | $renamer |
User object of the user performing the rename, for logging purposes. | |
Class which performs the actual renaming of users.
Definition at line 9 of file RenameuserSQL.php.
RenameuserSQL::__construct | ( | $old, | |
$new, | |||
$uid, | |||
User | $renamer, | ||
$options = [] ) |
Constructor.
string | $old | The old username |
string | $new | The new username |
int | $uid | |
User | $renamer | |
array | $options | Optional extra options. 'reason' - string, reason for the rename 'debugPrefix' - string, prefixed to debug messages 'checkIfUserExists' - bool, whether to update the user table |
Definition at line 102 of file RenameuserSQL.php.
References $new, $old, $options, $renamer, $uid, MIGRATION_NEW, User\newFromId(), and wfQueriesMustScale().
|
protected |
|
static |
Fetch the core actor table schema migration stage.
Definition at line 404 of file RenameuserSQL.php.
References $wgActorTableSchemaMigrationStage, MIGRATION_NEW, and MIGRATION_OLD.
Referenced by CleanupArchiveUserText\execute(), RenameUserCleanup\execute(), and RenameUserJob\run().
|
staticprivate |
string | $name | Current wiki local user name |
Definition at line 390 of file RenameuserSQL.php.
RenameuserSQL::rename | ( | ) |
Do the rename operation.
Definition at line 179 of file RenameuserSQL.php.
References $job, $new, $old, $oldTitle, $params, $res, $uid, $wgAuth, $wgUpdateRowsPerJob, DB_MASTER, debug(), Job\factory(), SpecialLog\getLogTypesOnUser(), list, MIGRATION_WRITE_BOTH, NAME_COL, User\newFromId(), JobQueueGroup\singleton(), TIME_COL, UID_COL, and wfGetDB().
bool RenameuserSQL::$checkIfUserExists |
Flag that can be set to false, in case another process has already started the updates and the old username may have already been renamed in the user table.
Definition at line 56 of file RenameuserSQL.php.
|
private |
A prefix to use in all debug log messages.
Definition at line 77 of file RenameuserSQL.php.
string RenameuserSQL::$new |
The new username.
Definition at line 24 of file RenameuserSQL.php.
Referenced by __construct(), and rename().
string RenameuserSQL::$old |
The old username.
Definition at line 16 of file RenameuserSQL.php.
Referenced by __construct(), and rename().
|
private |
Reason to be used in the log entry.
Definition at line 70 of file RenameuserSQL.php.
|
private |
User object of the user performing the rename, for logging purposes.
Definition at line 63 of file RenameuserSQL.php.
Referenced by __construct().
array RenameuserSQL::$tables |
The the tables => fields to be updated.
Definition at line 40 of file RenameuserSQL.php.
array RenameuserSQL::$tablesJob |
tables => fields to be updated in a deferred job
Definition at line 47 of file RenameuserSQL.php.
integer RenameuserSQL::$uid |
The user ID.
Definition at line 32 of file RenameuserSQL.php.
Referenced by __construct(), and rename().
const RenameuserSQL::CONTRIB_JOB = 500 |
Users with more than this number of edits will have their rename operation deferred via the job queue.
Definition at line 83 of file RenameuserSQL.php.
const RenameuserSQL::NAME_COL = 0 |
Definition at line 86 of file RenameuserSQL.php.
Referenced by rename().
const RenameuserSQL::TIME_COL = 2 |
Definition at line 88 of file RenameuserSQL.php.
Referenced by rename().
const RenameuserSQL::UID_COL = 1 |
Definition at line 87 of file RenameuserSQL.php.
Referenced by rename().