MediaWiki  REL1_20
ProcessCacheLRU Class Reference

Handles per process caching of items. More...

Inheritance diagram for ProcessCacheLRU:

List of all members.

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.
 has ($key, $prop)
 Check if a property field exists for a cache entry.
 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()
 *
 $maxCacheKeys

Detailed Description

Handles per process caching of items.

Definition at line 28 of file ProcessCacheLRU.php.


Constructor & Destructor Documentation

Parameters:
$maxKeysinteger Maximum number of entries allowed (min 1).
Exceptions:
MWExceptionWhen $maxCacheKeys is not an int or =< 0.

Definition at line 37 of file ProcessCacheLRU.php.


Member Function Documentation

ProcessCacheLRU::clear ( keys = null)

Clear one or several cache entries, or all cache entries.

Parameters:
$keysstring|Array
Returns:
void

Definition at line 99 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.

Parameters:
$keystring
$propstring
Returns:
mixed

Definition at line 84 of file ProcessCacheLRU.php.

ProcessCacheLRU::has ( key,
prop 
)

Check if a property field exists for a cache entry.

Parameters:
$keystring
$propstring
Returns:
bool

Definition at line 71 of file ProcessCacheLRU.php.

ProcessCacheLRU::ping ( key) [protected]

Push an entry to the top of the cache.

Parameters:
$keystring

Definition at line 114 of file ProcessCacheLRU.php.

ProcessCacheLRU::set ( key,
prop,
value 
)

Set a property field for a cache entry.

This will prune the cache if it gets too large. If the item is already set, it will be pushed to the top of the cache.

Parameters:
$keystring
$propstring
$valuemixed
Returns:
void

Definition at line 54 of file ProcessCacheLRU.php.


Member Data Documentation

Array ProcessCacheLRU::$cache = array() [protected]

*

Reimplemented in ProcessCacheLRUTestable.

Definition at line 29 of file ProcessCacheLRU.php.

ProcessCacheLRU::$maxCacheKeys [protected]

Definition at line 31 of file ProcessCacheLRU.php.


The documentation for this class was generated from the following file: