MediaWiki
REL1_22
|
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. | |
doTitlesArray ($titles, $caller= '') | |
Wrapper for doQuery that processes a title or string array. | |
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 | |
Static Private Member Functions | |
static | normalizeUsername ($username) |
Caches user genders when needed to use correct namespace aliases.
Definition at line 30 of file GenderCache.php.
GenderCache::__construct | ( | ) | [protected] |
Definition at line 47 of file GenderCache.php.
GenderCache::doLinkBatch | ( | $ | data, |
$ | caller = '' |
||
) |
Wrapper for doQuery that processes raw LinkBatch data.
$data | |
$caller |
Definition at line 100 of file GenderCache.php.
References array(), as, doQuery(), and MWNamespace\hasGenderDistinction().
GenderCache::doQuery | ( | $ | users, |
$ | caller = '' |
||
) |
Preloads genders for given list of users.
$users | List|String: usernames | |
string | $caller | the calling method |
Definition at line 142 of file GenderCache.php.
References $comment, $dbr, $default, $name, $res, $value, array(), as, cache, getDefault(), User\isValidUserName(), normalizeUsername(), and wfGetDB().
Referenced by doLinkBatch(), doTitlesArray(), and getGenderOf().
GenderCache::doTitlesArray | ( | $ | titles, |
$ | caller = '' |
||
) |
Wrapper for doQuery that processes a title or string array.
$titles | List: array of Title objects or strings | |
string | $caller | the calling method |
Definition at line 121 of file GenderCache.php.
References $title, $titles, array(), as, doQuery(), MWNamespace\hasGenderDistinction(), and Title\newFromText().
GenderCache::getDefault | ( | ) | [protected] |
Returns the default gender option in this wiki.
Definition at line 53 of file GenderCache.php.
References User\getDefaultOption().
Referenced by doQuery(), and getGenderOf().
GenderCache::getGenderOf | ( | $ | username, |
$ | caller = '' |
||
) |
Returns the gender for given username.
string | $username | or User: username |
string | $caller | the calling method |
Definition at line 66 of file GenderCache.php.
References $wgUser, cache, doQuery(), getDefault(), global, normalizeUsername(), and wfDebug().
static GenderCache::normalizeUsername | ( | $ | username | ) | [static, private] |
Definition at line 181 of file GenderCache.php.
Referenced by doQuery(), and getGenderOf().
static GenderCache::singleton | ( | ) | [static] |
Definition at line 39 of file GenderCache.php.
Referenced by LinkBatch\doGenderQuery(), SpecialEditWatchlist\extractTitles(), CoreParserFunctions\gender(), Title\getNsText(), SpecialEditWatchlist\getWatchlist(), ApiQueryAllPages\run(), GenderCacheTest\testStripSubpages(), GenderCacheTest\testUserName(), and GenderCacheTest\testUserObjects().
Definition at line 31 of file GenderCache.php.
GenderCache::$default [protected] |
Definition at line 32 of file GenderCache.php.
Referenced by doQuery().
GenderCache::$misses = 0 [protected] |
Definition at line 33 of file GenderCache.php.
GenderCache::$missLimit = 1000 [protected] |
Definition at line 34 of file GenderCache.php.