Handles per process caching of items.
More...
|
| __construct ( $maxKeys) |
|
| clear ( $keys=null) |
| Clear one or several cache entries, or all cache entries. More...
|
|
| get ( $key, $prop) |
| Get a property field for a cache entry. More...
|
|
| has ( $key, $prop, $maxAge=0) |
| Check if a property field exists for a cache entry. More...
|
|
| set ( $key, $prop, $value) |
| Set a property field for a cache entry. More...
|
|
Handles per process caching of items.
Definition at line 28 of file ProcessCacheLRU.php.
◆ __construct()
ProcessCacheLRU::__construct |
( |
|
$maxKeys | ) |
|
- Parameters
-
$maxKeys | integer Maximum number of entries allowed (min 1). |
- Exceptions
-
UnexpectedValueException | When $maxCacheKeys is not an int or =< 0. |
Definition at line 38 of file ProcessCacheLRU.php.
◆ clear()
ProcessCacheLRU::clear |
( |
|
$keys = null | ) |
|
◆ get()
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.
- Parameters
-
- Returns
- mixed
Definition at line 93 of file ProcessCacheLRU.php.
References cache, and ping().
◆ has()
ProcessCacheLRU::has |
( |
|
$key, |
|
|
|
$prop, |
|
|
|
$maxAge = 0 |
|
) |
| |
Check if a property field exists for a cache entry.
- Parameters
-
$key | string |
$prop | string |
$maxAge | integer Ignore items older than this many seconds (since 1.21) |
- Returns
- bool
Definition at line 76 of file ProcessCacheLRU.php.
References cache.
◆ ping()
ProcessCacheLRU::ping |
( |
|
$key | ) |
|
|
protected |
◆ set()
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.
- Parameters
-
$key | string |
$prop | string |
$value | mixed |
- Returns
- void
Definition at line 55 of file ProcessCacheLRU.php.
References $value, cache, key, and ping().
◆ $cache
Array ProcessCacheLRU::$cache = array() |
|
protected |
◆ $cacheTimes
Array ProcessCacheLRU::$cacheTimes = array() |
|
protected |
◆ $maxCacheKeys
ProcessCacheLRU::$maxCacheKeys |
|
protected |
The documentation for this class was generated from the following file: