MediaWiki REL1_31
|
Class for process caching individual properties of expiring items. More...
Public Member Functions | |
__construct ( $maxKeys) | |
clear ( $keys=null) | |
Clear one or several cache entries, or all cache entries. | |
get ( $key, $prop) | |
Get a property field for a cache entry. | |
getSize () | |
Get cache size. | |
has ( $key, $prop, $maxAge=0.0) | |
Check if a property field exists for a cache entry. | |
resize ( $maxKeys) | |
Resize the maximum number of cache entries, removing older entries as needed. | |
set ( $key, $prop, $value) | |
Set a property field for a cache entry. | |
Protected Member Functions | |
ping ( $key) | |
Push an entry to the top of the cache. | |
Protected Attributes | |
array | $cache = [] |
array | $cacheTimes = [] |
$maxCacheKeys | |
Class for process caching individual properties of expiring items.
When the key for an entire item is deleted, all properties for it are deleted
Definition at line 32 of file ProcessCacheLRU.php.
ProcessCacheLRU::__construct | ( | $maxKeys | ) |
int | $maxKeys | Maximum number of entries allowed (min 1). |
UnexpectedValueException | When $maxCacheKeys is not an int or =< 0. |
Definition at line 45 of file ProcessCacheLRU.php.
References resize().
ProcessCacheLRU::clear | ( | $keys = null | ) |
Clear one or several cache entries, or all cache entries.
string | array | $keys |
Definition at line 113 of file ProcessCacheLRU.php.
ProcessCacheLRU::get | ( | $key, | |
$prop ) |
Get a property field for a cache entry.
This returns null if the property is not set. If the item is already set, it will be pushed to the top of the cache.
string | $key | |
string | $prop |
Definition at line 99 of file ProcessCacheLRU.php.
Referenced by JobQueueGroup\queuesHaveJobs().
ProcessCacheLRU::getSize | ( | ) |
Get cache size.
Definition at line 160 of file ProcessCacheLRU.php.
References $maxCacheKeys.
ProcessCacheLRU::has | ( | $key, | |
$prop, | |||
$maxAge = 0.0 ) |
Check if a property field exists for a cache entry.
string | $key | |
string | $prop | |
float | $maxAge | Ignore items older than this many seconds (since 1.21) |
Definition at line 80 of file ProcessCacheLRU.php.
References cache.
|
protected |
Push an entry to the top of the cache.
string | $key |
Definition at line 150 of file ProcessCacheLRU.php.
References cache.
ProcessCacheLRU::resize | ( | $maxKeys | ) |
Resize the maximum number of cache entries, removing older entries as needed.
int | $maxKeys |
UnexpectedValueException |
Definition at line 132 of file ProcessCacheLRU.php.
Referenced by __construct().
ProcessCacheLRU::set | ( | $key, | |
$prop, | |||
$value ) |
Set a property field for a cache entry.
This will prune the cache if it gets too large based on LRU. If the item is already set, it will be pushed to the top of the cache.
string | $key | |
string | $prop | |
mixed | $value |
Definition at line 59 of file ProcessCacheLRU.php.
References $value, cache, key, and ping().
Referenced by JobQueueGroup\push().
|
protected |
Definition at line 34 of file ProcessCacheLRU.php.
|
protected |
Definition at line 37 of file ProcessCacheLRU.php.
|
protected |
Definition at line 39 of file ProcessCacheLRU.php.
Referenced by getSize().