Elgg  Version 1.11
Public Member Functions | List of all members
ElggMemcache Class Reference
Inheritance diagram for ElggMemcache:
ElggSharedMemoryCache ElggCache

Public Member Functions

 __construct ($namespace= 'default')
 Connect to memcache. More...
 
 setDefaultExpiry ($expires=0)
 Set the default expiry. More...
 
 save ($key, $data, $expires=null)
 Saves a name and value to the cache. More...
 
 load ($key, $offset=0, $limit=null)
 Retrieves data. More...
 
 delete ($key)
 Delete data. More...
 
 clear ()
 Clears the entire cache? More...
 
- Public Member Functions inherited from ElggSharedMemoryCache
 setNamespace ($namespace="default")
 Set the namespace of this cache. More...
 
 getNamespace ()
 Get the namespace currently defined. More...
 
- Public Member Functions inherited from ElggCache
 __construct ()
 Set the constructor. More...
 
 set_variable ($variable, $value)
 Set a cache variable. More...
 
 setVariable ($variable, $value)
 Set a cache variable. More...
 
 get_variable ($variable)
 Get variables for this cache. 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...
 
 load ($key, $offset=0, $limit=null)
 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...
 
 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...
 

Detailed Description

Definition at line 8 of file ElggMemcache.php.

Constructor & Destructor Documentation

ElggMemcache::__construct (   $namespace = 'default')

Connect to memcache.

Parameters
string$namespaceThe namespace for this cache to write to - note, namespaces of the same name are shared!
Exceptions
ConfigurationException

Definition at line 45 of file ElggMemcache.php.

Member Function Documentation

ElggMemcache::clear ( )

Clears the entire cache?

Returns
true

Definition at line 209 of file ElggMemcache.php.

ElggMemcache::delete (   $key)

Delete data.

Parameters
string$keyName of data
Returns
bool

Definition at line 196 of file ElggMemcache.php.

ElggMemcache::load (   $key,
  $offset = 0,
  $limit = null 
)

Retrieves data.

Parameters
string$keyName of data to retrieve
int$offsetOffset
int$limitLimit
Returns
mixed

Definition at line 176 of file ElggMemcache.php.

ElggMemcache::save (   $key,
  $data,
  $expires = null 
)

Saves a name and value to the cache.

Parameters
string$keyName
string$dataValue
integer$expiresExpires (in seconds)
Returns
bool

Definition at line 150 of file ElggMemcache.php.

ElggMemcache::setDefaultExpiry (   $expires = 0)

Set the default expiry.

Parameters
int$expiresThe lifetime as a unix timestamp or time from now. Defaults forever.
Returns
void

Definition at line 119 of file ElggMemcache.php.


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