|
MediaWiki master
|
Public Member Functions | |
| __construct (LoggerInterface $logger, IConnectionProvider $dbProvider, LinkBatchFactory $linkBatchFactory) | |
| Uses dependency injection since 1.36. | |
| doQuery (array $userIds, $options=[], $caller='') | |
| Preloads user names for given list of users. | |
| getProp ( $userId, $prop) | |
| Get a property of a user based on their user ID. | |
| getUserName ( $userId, $ip) | |
| Get the name of a user or return $ip if the user ID is 0. | |
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. | |
Protected Attributes | |
| array | $cache = [] |
| (uid => property => value) | |
| array | $typesCached = [] |
| (uid => cache type => 1) | |
| MediaWiki\Cache\UserCache::__construct | ( | LoggerInterface | $logger, |
| IConnectionProvider | $dbProvider, | ||
| LinkBatchFactory | $linkBatchFactory ) |
Uses dependency injection since 1.36.
| LoggerInterface | $logger | |
| IConnectionProvider | $dbProvider | |
| LinkBatchFactory | $linkBatchFactory |
Definition at line 51 of file UserCache.php.
| MediaWiki\Cache\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 101 of file UserCache.php.
References NS_USER, NS_USER_TALK, and MediaWiki\Cache\UserCache\queryNeeded().
Referenced by MediaWiki\Cache\UserCache\getProp().
| MediaWiki\Cache\UserCache::getProp | ( | $userId, | |
| $prop ) |
Get a property of a user based on their user ID.
| int | $userId | |
| string | $prop | User property |
Definition at line 68 of file UserCache.php.
References MediaWiki\Cache\UserCache\doQuery().
Referenced by MediaWiki\Cache\UserCache\getUserName().
| MediaWiki\Cache\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 91 of file UserCache.php.
References MediaWiki\Cache\UserCache\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 167 of file UserCache.php.
Referenced by MediaWiki\Cache\UserCache\doQuery().
|
static |
Definition at line 39 of file UserCache.php.
References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().
|
protected |
(uid => property => value)
Definition at line 22 of file UserCache.php.
|
protected |
(uid => cache type => 1)
Definition at line 24 of file UserCache.php.