MediaWiki REL1_34
ProcessCacheLRU Class Reference

Class for process caching individual properties of expiring items. More...

Collaboration diagram for ProcessCacheLRU:

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 Attributes

MapCacheLRU $cache
 

Detailed Description

Class for process caching individual properties of expiring items.

When the key for an entire item is deleted, all properties for it are deleted

Deprecated:
Since 1.32 Use MapCacheLRU instead

Definition at line 32 of file ProcessCacheLRU.php.

Constructor & Destructor Documentation

◆ __construct()

ProcessCacheLRU::__construct (   $maxKeys)
Parameters
int$maxKeysMaximum number of entries allowed (min 1).
Exceptions
UnexpectedValueExceptionWhen $maxCacheKeys is not an int or =< 0.

Definition at line 40 of file ProcessCacheLRU.php.

Member Function Documentation

◆ clear()

ProcessCacheLRU::clear (   $keys = null)

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

Parameters
string | array | null$keys
Returns
void

Definition at line 89 of file ProcessCacheLRU.php.

References $keys.

◆ 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
string$key
string$prop
Returns
mixed

Definition at line 79 of file ProcessCacheLRU.php.

◆ getSize()

ProcessCacheLRU::getSize ( )

Get cache size.

Returns
int

Definition at line 108 of file ProcessCacheLRU.php.

◆ has()

ProcessCacheLRU::has (   $key,
  $prop,
  $maxAge = 0.0 
)

Check if a property field exists for a cache entry.

Parameters
string$key
string$prop
float$maxAgeIgnore items older than this many seconds (since 1.21)
Returns
bool

Definition at line 66 of file ProcessCacheLRU.php.

◆ resize()

ProcessCacheLRU::resize (   $maxKeys)

Resize the maximum number of cache entries, removing older entries as needed.

Parameters
int$maxKeys
Returns
void
Exceptions
UnexpectedValueException

Definition at line 100 of file ProcessCacheLRU.php.

◆ 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
string$key
string$prop
mixed$value
Returns
void

Definition at line 54 of file ProcessCacheLRU.php.

Member Data Documentation

◆ $cache

MapCacheLRU ProcessCacheLRU::$cache
protected

Definition at line 34 of file ProcessCacheLRU.php.


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