MediaWiki
1.28.3
|
Caches user genders when needed to use correct namespace aliases. More...
Public Member Functions | |
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) |
Caches user genders when needed to use correct namespace aliases.
Definition at line 31 of file GenderCache.php.
GenderCache::doLinkBatch | ( | $data, | |
$caller = '' |
|||
) |
Wrapper for doQuery that processes raw LinkBatch data.
array | $data | |
string | $caller |
Definition at line 97 of file GenderCache.php.
References $username, as, doQuery(), and MWNamespace\hasGenderDistinction().
GenderCache::doQuery | ( | $users, | |
$caller = '' |
|||
) |
Preloads genders for given list of users.
array | string | $users | Usernames |
string | $caller | The calling method |
Definition at line 139 of file GenderCache.php.
References $comment, $dbr, $default, $name, $res, $value, array(), as, cache, DB_REPLICA, getDefault(), User\isValidUserName(), and wfGetDB().
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 118 of file GenderCache.php.
References $title, $titles, as, doQuery(), MWNamespace\hasGenderDistinction(), and Title\newFromText().
|
protected |
Returns the default gender option in this wiki.
Definition at line 49 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 | Username |
string | $caller | The calling method |
Definition at line 63 of file GenderCache.php.
References $username, $wgUser, cache, doQuery(), getDefault(), global, and wfDebug().
|
staticprivate |
Definition at line 178 of file GenderCache.php.
References $username.
|
static |
Definition at line 41 of file GenderCache.php.
Referenced by CoreParserFunctions\gender(), ApiPageSet\initFromQueryResult(), ApiPageSet\processTitlesArray(), ApiQueryAllPages\run(), GenderCacheTest\testStripSubpages(), GenderCacheTest\testUserName(), and GenderCacheTest\testUserObjects().
|
protected |
Definition at line 32 of file GenderCache.php.
|
protected |
Definition at line 33 of file GenderCache.php.
Referenced by doQuery(), and getDefault().
|
protected |
Definition at line 34 of file GenderCache.php.
|
protected |
Definition at line 35 of file GenderCache.php.