|
Elgg
Version 2.3
|
Memcache wrapper class. More...
Public Member Functions | |
| __construct ($namespace='default', \Stash\Pool $pool=null, $ttl=null) | |
| Constructor. More... | |
| setDefaultExpiry ($ttl=0) | |
| Set the default TTL. More... | |
| save ($key, $data, $ttl=null) | |
| Saves a name and value to the cache. More... | |
| load ($key, $unused1=0, $unused2=null) | |
| Retrieves data. More... | |
| delete ($key) | |
| Delete data. More... | |
| clear () | |
| Clears all values in the namespace of this cache. More... | |
| setNamespace ($namespace="default") | |
| Set the namespace of this cache. More... | |
Public Member Functions inherited from ElggSharedMemoryCache | |
| getNamespace () | |
| Get the namespace currently defined. More... | |
Public Member Functions inherited from ElggCache | |
| __construct () | |
| Set the constructor. More... | |
| setVariable ($variable, $value) | |
| Set a cache variable. More... | |
| getVariable ($variable) | |
| Get variables for this cache. More... | |
| __get ($key) | |
| Class member get overloading, returning key using $this->load defaults. More... | |
| __set ($key, $value) | |
| Class member set overloading, setting a key using $this->save defaults. More... | |
| __isset ($key) | |
| Supporting isset, using $this->load() with default values. More... | |
| __unset ($key) | |
| Supporting unsetting of magic attributes. More... | |
| save ($key, $data) | |
| Save data in a cache. More... | |
| add ($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... | |
Memcache wrapper class.
Definition at line 6 of file ElggMemcache.php.
| ElggMemcache::__construct | ( | $namespace = 'default', |
|
| \Stash\Pool | $pool = null, |
||
$ttl = null |
|||
| ) |
Constructor.
| string | $namespace | The namespace for this cache to write to |
| \Stash\Pool | $pool | The cache pool to use. Default is memcache. |
| int | $ttl | The TTL in seconds. Default is from $CONFIG->memcache_expires. |
| ConfigurationException |
Definition at line 29 of file ElggMemcache.php.
| ElggMemcache::clear | ( | ) |
Clears all values in the namespace of this cache.
Reimplemented from ElggCache.
Definition at line 153 of file ElggMemcache.php.
| ElggMemcache::delete | ( | $key | ) |
Delete data.
| string | $key | Name of data |
Reimplemented from ElggCache.
Definition at line 143 of file ElggMemcache.php.
| ElggMemcache::load | ( | $key, | |
$unused1 = 0, |
|||
$unused2 = null |
|||
| ) |
Retrieves data.
| string | $key | Name of data to retrieve |
| int | $unused1 | Unused |
| int | $unused2 | Unused |
Reimplemented from ElggCache.
Definition at line 118 of file ElggMemcache.php.
| ElggMemcache::save | ( | $key, | |
| $data, | |||
$ttl = null |
|||
| ) |
Saves a name and value to the cache.
| string | $key | Name |
| string | $data | Value |
| integer | $ttl | TTL of cache item (seconds), 0 for no expiration, null for default. |
Definition at line 87 of file ElggMemcache.php.
| ElggMemcache::setDefaultExpiry | ( | $ttl = 0 | ) |
Set the default TTL.
| int | $ttl | The TTL in seconds from now. Default is no expiration. |
Definition at line 60 of file ElggMemcache.php.
| ElggMemcache::setNamespace | ( | $namespace = "default" | ) |
Set the namespace of this cache.
This will also add the Memcache namespace prefix as defined in settings.php
| string | $namespace | Namespace for cache |
Reimplemented from ElggSharedMemoryCache.
Definition at line 168 of file ElggMemcache.php.