Definition at line 16 of file LRUCache.php.
Elgg_Cache_LRUCache::__construct |
( |
|
$size | ) |
|
Create a LRU Cache.
- Parameters
-
int | $size | The size of the cache |
- Exceptions
-
Definition at line 33 of file LRUCache.php.
Elgg_Cache_LRUCache::clear |
( |
| ) |
|
Elgg_Cache_LRUCache::containsKey |
( |
|
$key | ) |
|
Does the cache contain an element with this key.
- Parameters
-
- Returns
- boolean
Definition at line 92 of file LRUCache.php.
Elgg_Cache_LRUCache::get |
( |
|
$key, |
|
|
|
$default = null |
|
) |
| |
Get the value cached with this key.
- Parameters
-
int | string | $key | The key. Strings that are ints are cast to ints. |
mixed | $default | The value to be returned if key not found. (Optional) |
- Returns
- mixed
Definition at line 47 of file LRUCache.php.
Elgg_Cache_LRUCache::offsetExists |
( |
|
$key | ) |
|
Does key exist?
- See also
- ArrayAccess::offsetExists()
- Parameters
-
int | string | $key | A key to check for. |
- Returns
- boolean
Definition at line 178 of file LRUCache.php.
Elgg_Cache_LRUCache::offsetGet |
( |
|
$key | ) |
|
Get the value for specified key.
- See also
- ArrayAccess::offsetGet()
- Parameters
-
int | string | $key | The key to retrieve. |
- Returns
- mixed
Definition at line 154 of file LRUCache.php.
Elgg_Cache_LRUCache::offsetSet |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
Assigns a value for the specified key.
- See also
- ArrayAccess::offsetSet()
- Parameters
-
int | string | $key | The key to assign the value to. |
mixed | $value | The value to set. |
- Returns
- void
Definition at line 142 of file LRUCache.php.
Elgg_Cache_LRUCache::offsetUnset |
( |
|
$key | ) |
|
Unsets a key.
- See also
- ArrayAccess::offsetUnset()
- Parameters
-
int | string | $key | The key to unset. |
- Returns
- void
Definition at line 166 of file LRUCache.php.
Elgg_Cache_LRUCache::recordAccess |
( |
|
$key | ) |
|
|
protected |
Moves the element from current position to end of array.
- Parameters
-
- Returns
- void
Definition at line 127 of file LRUCache.php.
Elgg_Cache_LRUCache::remove |
( |
|
$key | ) |
|
Remove the element with this key.
- Parameters
-
- Returns
- mixed Value or null if not set
Definition at line 102 of file LRUCache.php.
Elgg_Cache_LRUCache::set |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
Add something to the cache.
- Parameters
-
int | string | $key | The key. Strings that are ints are cast to ints. |
mixed | $value | The value to cache |
- Returns
- void
Definition at line 63 of file LRUCache.php.
Elgg_Cache_LRUCache::size |
( |
| ) |
|
Get the number of elements in the cache.
- Returns
- int
Definition at line 82 of file LRUCache.php.
Elgg_Cache_LRUCache::$data = array() |
|
protected |
Elgg_Cache_LRUCache::$maximumSize |
|
protected |
The documentation for this class was generated from the following file: