The elgg cache superclass.
More...
|
| __construct () |
| Set the constructor. More...
|
|
| setVariable (string $variable, $value) |
| Set a cache variable. More...
|
|
| getVariable (string $variable) |
| Get variables for this cache. More...
|
|
| __get (string $key) |
| Class member get overloading, returning key using $this->load defaults. More...
|
|
| __set (string $key, $value) |
| Class member set overloading, setting a key using $this->save defaults. More...
|
|
| __isset (string $key) |
| Supporting isset, using $this->load() with default values. More...
|
|
| __unset (string $key) |
| Supporting unsetting of magic attributes. More...
|
|
| save ($key, $data, $expire_after=null) |
| Save data in a cache. More...
|
|
| load ($key) |
| Load data from the cache using a given key. More...
|
|
| delete ($key) |
| Invalidate a key. More...
|
|
| clear () |
| Clear out all the contents of the cache. More...
|
|
| invalidate () |
| Invalidate the contents of the cache. More...
|
|
| purge () |
| Purge old/stale contents of the cache. More...
|
|
| disable () |
| Disable cache Do not write or read from cache. More...
|
|
| enable () |
| Enable disabled cache. More...
|
|
| populate (array $values, int $expires_after=null) |
| Populate cache from an array of key => values. More...
|
|
| add (string $key, $data) |
| Add a key only if it doesn't already exist. More...
|
|
| offsetSet ($key, $value) |
| Assigns a value for the specified key. More...
|
|
| offsetGet ($key) |
| Get the value for specified key. More...
|
|
| offsetUnset ($key) |
| Unsets a key. More...
|
|
| offsetExists ($key) |
| Does key exist. More...
|
|
The elgg cache superclass.
This defines the interface for a cache (wherever that cache is stored).
Definition at line 6 of file ElggCache.php.
ElggCache::__construct |
( |
| ) |
|
ElggCache::__get |
( |
string |
$key | ) |
|
Class member get overloading, returning key using $this->load defaults.
- Parameters
-
- Returns
- mixed
Definition at line 55 of file ElggCache.php.
ElggCache::__isset |
( |
string |
$key | ) |
|
Supporting isset, using $this->load() with default values.
- Parameters
-
string | $key | The name of the attribute or metadata. |
- Returns
- bool
Definition at line 78 of file ElggCache.php.
ElggCache::__set |
( |
string |
$key, |
|
|
|
$value |
|
) |
| |
Class member set overloading, setting a key using $this->save defaults.
- Parameters
-
string | $key | Name |
mixed | $value | Value |
- Returns
- void
Definition at line 67 of file ElggCache.php.
ElggCache::__unset |
( |
string |
$key | ) |
|
Supporting unsetting of magic attributes.
- Parameters
-
string | $key | The name of the attribute or metadata. |
- Returns
- void
Definition at line 89 of file ElggCache.php.
ElggCache::add |
( |
string |
$key, |
|
|
|
$data |
|
) |
| |
Add a key only if it doesn't already exist.
Implemented simply here, if you extend this class and your caching engine provides a better way then override this accordingly.
- Parameters
-
string | $key | Name |
mixed | $data | Value |
- Returns
- bool
Definition at line 185 of file ElggCache.php.
Clear out all the contents of the cache.
- Returns
- bool
ElggCache::delete |
( |
|
$key | ) |
|
|
abstract |
Invalidate a key.
- Parameters
-
- Returns
- bool
Disable cache Do not write or read from cache.
- Returns
- void
Definition at line 148 of file ElggCache.php.
Enable disabled cache.
- Returns
- void
Definition at line 156 of file ElggCache.php.
ElggCache::getVariable |
( |
string |
$variable | ) |
|
Get variables for this cache.
- Parameters
-
- Returns
- mixed The variable or null;
Definition at line 44 of file ElggCache.php.
ElggCache::invalidate |
( |
| ) |
|
|
abstract |
Invalidate the contents of the cache.
- Returns
- bool
Load data from the cache using a given key.
- Parameters
-
- Returns
- mixed|null The stored data or null if it's a miss
ElggCache::offsetExists |
( |
|
$key | ) |
|
Does key exist.
- See also
- ::offsetExists()
- Parameters
-
mixed | $key | A key (offset) to check for. |
- Returns
- bool
Definition at line 250 of file ElggCache.php.
ElggCache::offsetGet |
( |
|
$key | ) |
|
Get the value for specified key.
- See also
- ::offsetGet()
- Parameters
-
mixed | $key | The key (offset) to retrieve. |
- Returns
- mixed
Definition at line 220 of file ElggCache.php.
ElggCache::offsetSet |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
Assigns a value for the specified key.
- See also
- ::offsetSet()
- Parameters
-
mixed | $key | The key (offset) to assign the value to. |
mixed | $value | The value to set. |
- Returns
- void
Definition at line 206 of file ElggCache.php.
ElggCache::offsetUnset |
( |
|
$key | ) |
|
Unsets a key.
- See also
- ::offsetUnset()
- Parameters
-
mixed | $key | The key (offset) to unset. |
- Returns
- void
Definition at line 234 of file ElggCache.php.
ElggCache::populate |
( |
array |
$values, |
|
|
int |
$expires_after = null |
|
) |
| |
Populate cache from an array of key => values.
- Parameters
-
array | $values | Values |
int | $expires_after | Expiration duration |
- Returns
- void
Definition at line 168 of file ElggCache.php.
Purge old/stale contents of the cache.
- Returns
- bool
ElggCache::save |
( |
|
$key, |
|
|
|
$data, |
|
|
|
$expire_after = null |
|
) |
| |
|
abstract |
Save data in a cache.
- Parameters
-
string | $key | Name |
mixed | $data | Value |
int | $expire_after | Number of seconds to expire the cache after |
- Returns
- bool
ElggCache::setVariable |
( |
string |
$variable, |
|
|
|
$value |
|
) |
| |
Set a cache variable.
- Parameters
-
string | $variable | Name |
mixed | $value | Value |
- Returns
- void
Definition at line 33 of file ElggCache.php.
ElggCache::$disabled = false |
|
protected |
The documentation for this class was generated from the following file: