MediaWiki REL1_37
|
Caches user genders when needed to use correct namespace aliases. More...
Public Member Functions | |
__construct (NamespaceInfo $nsInfo=null, ILoadBalancer $loadBalancer=null, UserOptionsLookup $userOptionsLookup=null) | |
doLinkBatch ( $data, $caller='') | |
Wrapper for doQuery that processes raw LinkBatch data. | |
doQuery ( $users, $caller='') | |
Preloads genders for given list of users. | |
doTitlesArray ( $titles, $caller='') | |
Wrapper for doQuery that processes a title array. | |
getGenderOf ( $username, $caller='') | |
Returns the gender for given username. | |
Protected Member Functions | |
getDefault () | |
Returns the default gender option in this wiki. | |
Protected Attributes | |
$cache = [] | |
$default | |
$misses = 0 | |
$missLimit = 1000 | |
Static Private Member Functions | |
static | normalizeUsername ( $username) |
Private Attributes | |
ILoadBalancer null | $loadBalancer |
NamespaceInfo | $nsInfo |
UserOptionsLookup | $userOptionsLookup |
Caches user genders when needed to use correct namespace aliases.
Definition at line 36 of file GenderCache.php.
GenderCache::__construct | ( | NamespaceInfo | $nsInfo = null , |
ILoadBalancer | $loadBalancer = null , |
||
UserOptionsLookup | $userOptionsLookup = null |
||
) |
Definition at line 51 of file GenderCache.php.
References $loadBalancer, and $userOptionsLookup.
GenderCache::doLinkBatch | ( | $data, | |
$caller = '' |
|||
) |
Wrapper for doQuery that processes raw LinkBatch data.
array | $data | |
string | $caller |
Definition at line 113 of file GenderCache.php.
References doQuery().
GenderCache::doQuery | ( | $users, | |
$caller = '' |
|||
) |
Preloads genders for given list of users.
string[] | string | $users | Usernames |
string | $caller | The calling method |
Definition at line 151 of file GenderCache.php.
References $dbr, $default, $res, DB_REPLICA, and getDefault().
Referenced by doLinkBatch(), doTitlesArray(), and getGenderOf().
GenderCache::doTitlesArray | ( | $titles, | |
$caller = '' |
|||
) |
Wrapper for doQuery that processes a title array.
LinkTarget[] | $titles | |
string | $caller | The calling method |
Definition at line 134 of file GenderCache.php.
References doQuery().
|
protected |
Returns the default gender option in this wiki.
Definition at line 65 of file GenderCache.php.
Referenced by doQuery(), and getGenderOf().
GenderCache::getGenderOf | ( | $username, | |
$caller = '' |
|||
) |
Returns the gender for given username.
string | UserIdentity | $username | |
string | $caller | The calling method |
Definition at line 79 of file GenderCache.php.
References doQuery(), getDefault(), and wfDebug().
|
staticprivate |
Definition at line 194 of file GenderCache.php.
|
protected |
Definition at line 37 of file GenderCache.php.
|
protected |
Definition at line 38 of file GenderCache.php.
Referenced by doQuery().
|
private |
Definition at line 46 of file GenderCache.php.
Referenced by __construct().
|
protected |
Definition at line 39 of file GenderCache.php.
|
protected |
Definition at line 40 of file GenderCache.php.
|
private |
Definition at line 43 of file GenderCache.php.
|
private |
Definition at line 49 of file GenderCache.php.