MediaWiki
master
|
Public Member Functions | |
__construct (LoggerInterface $logger, IConnectionProvider $dbProvider, LinkBatchFactory $linkBatchFactory) | |
Uses dependency injection since 1.36. More... | |
doQuery (array $userIds, $options=[], $caller='') | |
Preloads user names for given list of users. More... | |
getProp ( $userId, $prop) | |
Get a property of a user based on their user ID. More... | |
getUserName ( $userId, $ip) | |
Get the name of a user or return $ip if the user ID is 0. More... | |
Static Public Member Functions | |
static | singleton () |
Protected Member Functions | |
queryNeeded ( $uid, $type, array $options) | |
Check if a cache type is in $options and was not loaded for this user. More... | |
Protected Attributes | |
$cache = [] | |
$typesCached = [] | |
Definition at line 32 of file UserCache.php.
UserCache::__construct | ( | LoggerInterface | $logger, |
IConnectionProvider | $dbProvider, | ||
LinkBatchFactory | $linkBatchFactory | ||
) |
Uses dependency injection since 1.36.
LoggerInterface | $logger | |
IConnectionProvider | $dbProvider | |
LinkBatchFactory | $linkBatchFactory |
Definition at line 59 of file UserCache.php.
UserCache::doQuery | ( | array | $userIds, |
$options = [] , |
|||
$caller = '' |
|||
) |
Preloads user names for given list of users.
array | $userIds | List of user IDs |
array | $options | Option flags; include 'userpage' and 'usertalk' |
string | $caller | The calling method |
Definition at line 109 of file UserCache.php.
References NS_USER, NS_USER_TALK, and queryNeeded().
Referenced by getProp().
UserCache::getProp | ( | $userId, | |
$prop | |||
) |
Get a property of a user based on their user ID.
int | $userId | |
string | $prop | User property |
Definition at line 76 of file UserCache.php.
References doQuery().
Referenced by getUserName().
UserCache::getUserName | ( | $userId, | |
$ip | |||
) |
Get the name of a user or return $ip if the user ID is 0.
int | $userId | |
string | $ip |
Definition at line 99 of file UserCache.php.
References getProp().
|
protected |
Check if a cache type is in $options and was not loaded for this user.
int | $uid | User ID |
string | $type | Cache type |
array | $options | Requested cache types |
Definition at line 174 of file UserCache.php.
Referenced by doQuery().
|
static |
Definition at line 48 of file UserCache.php.
Referenced by MediaWiki\User\User\whoIs(), and MediaWiki\User\User\whoIsReal().
|
protected |
Definition at line 33 of file UserCache.php.
|
protected |
Definition at line 34 of file UserCache.php.