MediaWiki REL1_31
|
Class to parse and build external user names. More...
Public Member Functions | |
__construct ( $usernamePrefix, $assignKnownUsers) | |
addPrefix ( $name) | |
Add an interwiki prefix to the username regardless of circumstances. | |
applyPrefix ( $name) | |
Add an interwiki prefix to the username, if appropriate. | |
Static Public Member Functions | |
static | getLocal ( $username) |
Get local part of the user name. | |
static | getUserLinkTitle ( $userName) |
Get a target Title to link a username. | |
static | isExternal ( $username) |
Tells whether the username is external or not. | |
Private Attributes | |
$assignKnownUsers = false | |
$triedCreations = [] | |
$usernamePrefix = 'imported' | |
Class to parse and build external user names.
Definition at line 29 of file ExternalUserNames.php.
ExternalUserNames::__construct | ( | $usernamePrefix, | |
$assignKnownUsers ) |
string | $usernamePrefix | Prefix to apply to unknown (and possibly also known) usernames |
bool | $assignKnownUsers | Whether to apply the prefix to usernames that exist locally |
Definition at line 38 of file ExternalUserNames.php.
References $assignKnownUsers, and $usernamePrefix.
ExternalUserNames::addPrefix | ( | $name | ) |
Add an interwiki prefix to the username regardless of circumstances.
string | $name | Name being imported |
Definition at line 105 of file ExternalUserNames.php.
Referenced by applyPrefix().
ExternalUserNames::applyPrefix | ( | $name | ) |
Add an interwiki prefix to the username, if appropriate.
string | $name | Name being imported |
Definition at line 75 of file ExternalUserNames.php.
References $name, addPrefix(), User\idFromName(), and User\isUsableName().
|
static |
Get local part of the user name.
string | $username | Username to get |
Definition at line 125 of file ExternalUserNames.php.
References $username.
Referenced by ExternalUserNamesTest\testGetLocal().
|
static |
Get a target Title to link a username.
string | $userName | Username to link |
Definition at line 50 of file ExternalUserNames.php.
References $title, and NS_MAIN.
Referenced by ExternalUserNamesTest\testGetUserLinkTitle(), and Linker\userLink().
|
static |
Tells whether the username is external or not.
string | $username | Username to check |
Definition at line 115 of file ExternalUserNames.php.
References $username.
Referenced by SpecialContributions\execute(), ApiQueryContributions\execute(), ExternalUserNamesTest\testIsExternal(), Linker\userLink(), Linker\userToolLinks(), and ApiBase\validateUser().
|
private |
Definition at line 31 of file ExternalUserNames.php.
Referenced by __construct().
|
private |
Definition at line 32 of file ExternalUserNames.php.
|
private |
Definition at line 30 of file ExternalUserNames.php.
Referenced by __construct().