MediaWiki
1.34.0
|
Caches user genders when needed to use correct namespace aliases. More...
Public Member Functions | |
__construct (NamespaceInfo $nsInfo=null, ILoadBalancer $loadBalancer=null) | |
doLinkBatch ( $data, $caller='') | |
Wrapper for doQuery that processes raw LinkBatch data. More... | |
doQuery ( $users, $caller='') | |
Preloads genders for given list of users. More... | |
doTitlesArray ( $titles, $caller='') | |
Wrapper for doQuery that processes a title or string array. More... | |
getGenderOf ( $username, $caller='') | |
Returns the gender for given username. More... | |
Static Public Member Functions | |
static | singleton () |
Protected Member Functions | |
getDefault () | |
Returns the default gender option in this wiki. More... | |
Protected Attributes | |
$cache = [] | |
$default | |
$misses = 0 | |
$missLimit = 1000 | |
Static Private Member Functions | |
static | normalizeUsername ( $username) |
Private Attributes | |
ILoadBalancer null | $loadBalancer |
NamespaceInfo | $nsInfo |
Caches user genders when needed to use correct namespace aliases.
Definition at line 33 of file GenderCache.php.
GenderCache::__construct | ( | NamespaceInfo | $nsInfo = null , |
ILoadBalancer | $loadBalancer = null |
||
) |
Definition at line 45 of file GenderCache.php.
References $loadBalancer, and $nsInfo.
GenderCache::doLinkBatch | ( | $data, | |
$caller = '' |
|||
) |
Wrapper for doQuery that processes raw LinkBatch data.
array | $data | |
string | $caller |
Definition at line 110 of file GenderCache.php.
References doQuery().
GenderCache::doQuery | ( | $users, | |
$caller = '' |
|||
) |
Preloads genders for given list of users.
array | string | $users | Usernames |
string | $caller | The calling method |
Definition at line 152 of file GenderCache.php.
References $dbr, $default, $res, DB_REPLICA, getDefault(), User\isValidUserName(), and normalizeUsername().
Referenced by doLinkBatch(), doTitlesArray(), and getGenderOf().
GenderCache::doTitlesArray | ( | $titles, | |
$caller = '' |
|||
) |
Wrapper for doQuery that processes a title or string array.
array | $titles | Array of Title objects or strings |
string | $caller | The calling method |
Definition at line 131 of file GenderCache.php.
References $title, doQuery(), and Title\newFromText().
|
protected |
Returns the default gender option in this wiki.
Definition at line 62 of file GenderCache.php.
References $default, and User\getDefaultOption().
Referenced by doQuery(), and getGenderOf().
GenderCache::getGenderOf | ( | $username, | |
$caller = '' |
|||
) |
Returns the gender for given username.
string | User | $username | |
string | $caller | The calling method |
Definition at line 76 of file GenderCache.php.
References doQuery(), getDefault(), normalizeUsername(), and wfDebug().
|
staticprivate |
Definition at line 197 of file GenderCache.php.
Referenced by doQuery(), and getGenderOf().
|
static |
Definition at line 54 of file GenderCache.php.
|
protected |
Definition at line 34 of file GenderCache.php.
|
protected |
Definition at line 35 of file GenderCache.php.
Referenced by doQuery(), and getDefault().
|
private |
Definition at line 43 of file GenderCache.php.
Referenced by __construct().
|
protected |
Definition at line 36 of file GenderCache.php.
|
protected |
Definition at line 37 of file GenderCache.php.
|
private |
Definition at line 40 of file GenderCache.php.
Referenced by __construct().