MediaWiki master
MediaWiki\RenameUser\RenameuserSQL Class Reference

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.
 

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 of the user being renamed.
 
string $old
 The old username of the user being renamed.
 
array $tables
 The [ tables => fields ] to be updated.
 
array[] $tablesJob
 [ tables => fields ] to be updated in a deferred job
 
int $uid
 The user ID of the user being renamed.
 
const NAME_COL = 0
 
const TIME_COL = 2
 
const UID_COL = 1
 

Protected Member Functions

 debug ( $msg)
 

Detailed Description

Class which performs the actual renaming of users.

Definition at line 25 of file RenameuserSQL.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\RenameUser\RenameuserSQL::__construct ( $old,
$new,
$uid,
User $renamer,
$options = [] )

Constructor.

Parameters
string$oldThe old username
string$newThe new username
int$uid
User$renamer
array$optionsOptional 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 128 of file RenameuserSQL.php.

References MediaWiki\RenameUser\RenameuserSQL\$new, MediaWiki\RenameUser\RenameuserSQL\$old, MediaWiki\RenameUser\RenameuserSQL\$uid, MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\UpdateRowsPerJob.

Member Function Documentation

◆ debug()

MediaWiki\RenameUser\RenameuserSQL::debug ( $msg)
protected

Definition at line 164 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\rename().

◆ rename()

Member Data Documentation

◆ $checkIfUserExists

bool MediaWiki\RenameUser\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 67 of file RenameuserSQL.php.

◆ $new

string MediaWiki\RenameUser\RenameuserSQL::$new

The new username of the user being renamed.

Definition at line 38 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\__construct(), and MediaWiki\RenameUser\RenameuserSQL\rename().

◆ $old

string MediaWiki\RenameUser\RenameuserSQL::$old

The old username of the user being renamed.

Definition at line 31 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\__construct(), and MediaWiki\RenameUser\RenameuserSQL\rename().

◆ $tables

array MediaWiki\RenameUser\RenameuserSQL::$tables

The [ tables => fields ] to be updated.

Definition at line 52 of file RenameuserSQL.php.

◆ $tablesJob

array [] MediaWiki\RenameUser\RenameuserSQL::$tablesJob

[ tables => fields ] to be updated in a deferred job

Definition at line 59 of file RenameuserSQL.php.

◆ $uid

int MediaWiki\RenameUser\RenameuserSQL::$uid

The user ID of the user being renamed.

Definition at line 45 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\__construct(), and MediaWiki\RenameUser\RenameuserSQL\rename().

◆ NAME_COL

const MediaWiki\RenameUser\RenameuserSQL::NAME_COL = 0

Definition at line 91 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\rename().

◆ TIME_COL

const MediaWiki\RenameUser\RenameuserSQL::TIME_COL = 2

Definition at line 93 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\rename().

◆ UID_COL

const MediaWiki\RenameUser\RenameuserSQL::UID_COL = 1

Definition at line 92 of file RenameuserSQL.php.

Referenced by MediaWiki\RenameUser\RenameuserSQL\rename().


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