MediaWiki
REL1_19
|
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. | |
doQuery ($users, $caller= '') | |
Preloads genders for given list of users. | |
getGenderOf ($username, $caller= '') | |
Returns the gender for given username. | |
Static Public Member Functions | |
static | singleton () |
Protected Member Functions | |
__construct () | |
getDefault () | |
Returns the default gender option in this wiki. | |
Protected Attributes | |
$cache = array() | |
$default | |
$misses = 0 | |
$missLimit = 1000 |
Caches user genders when needed to use correct namespace aliases.
Definition at line 8 of file GenderCache.php.
GenderCache::__construct | ( | ) | [protected] |
Definition at line 25 of file GenderCache.php.
GenderCache::doLinkBatch | ( | $ | data, |
$ | caller = '' |
||
) |
Wrapper for doQuery that processes raw LinkBatch data.
$data | |
$caller |
Definition at line 80 of file GenderCache.php.
References doQuery(), and MWNamespace\hasGenderDistinction().
GenderCache::doQuery | ( | $ | users, |
$ | caller = '' |
||
) |
Preloads genders for given list of users.
$users | List|String: usernames |
$caller | String: the calling method |
Definition at line 98 of file GenderCache.php.
References $comment, $dbr, $default, $res, getDefault(), and wfGetDB().
Referenced by doLinkBatch(), and getGenderOf().
GenderCache::getDefault | ( | ) | [protected] |
Returns the default gender option in this wiki.
Definition at line 31 of file GenderCache.php.
References User\getDefaultOption().
Referenced by doQuery(), and getGenderOf().
GenderCache::getGenderOf | ( | $ | username, |
$ | caller = '' |
||
) |
Returns the gender for given username.
$username | String: username |
$caller | String: the calling method |
Definition at line 44 of file GenderCache.php.
References $wgUser, doQuery(), getDefault(), User\isValidUserName(), and wfDebug().
static GenderCache::singleton | ( | ) | [static] |
Definition at line 17 of file GenderCache.php.
Referenced by LinkBatch\doGenderQuery(), and Title\getNsText().
GenderCache::$cache = array() [protected] |
Definition at line 9 of file GenderCache.php.
GenderCache::$default [protected] |
Definition at line 10 of file GenderCache.php.
Referenced by doQuery().
GenderCache::$misses = 0 [protected] |
Definition at line 11 of file GenderCache.php.
GenderCache::$missLimit = 1000 [protected] |
Definition at line 12 of file GenderCache.php.