Elgg  Version 3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Cache\CompositeCache Class Reference

Composite cache pool. More...

Inheritance diagram for Elgg\Cache\CompositeCache:
ElggCache

Public Member Functions

 __construct ($namespace, Config $config, $flags)
 Constructor. More...
 
 getPool ()
 Returns cache pool. More...
 
 save ($key, $data, $ttl=null)
 Save data in a cache. More...
 
 load ($key, $invalidation_method=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...
 
 setNamespace ($namespace="default")
 Set the namespace of this cache. More...
 
 getNamespace ()
 Get the namespace currently defined. More...
 
 namespaceKey ($key)
 Namespace the key. 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, $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...
 
 disable ()
 Disable cache Do not write or read from cache. More...
 
 enable ()
 Enable disabled cache. More...
 
 populate ($values, $expires_after)
 Populate cache from an array of key => values. 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...
 

Protected Member Functions

 createPool ()
 Create a new composite stash pool. More...
 
 buildApcDriver ()
 Builds APC driver. More...
 
 buildRedisDriver ()
 Builds Redis driver. More...
 
 buildMemcachedDriver ()
 Builds Memcached driver. More...
 
 buildFileSystemDriver ()
 Builds file system driver. More...
 
 buildEphemeralDriver ()
 Builds in-memory driver. More...
 
 buildBlackHoleDriver ()
 Builds null cache driver. More...
 

Protected Attributes

 $ttl = 86400
 TTL of saved items (default timeout after a day to prevent anything getting too stale) More...
 
 $config
 
 $flags
 
 $pool
 
 $namespace
 
- Protected Attributes inherited from ElggCache
 $disabled = false
 

Detailed Description

Composite cache pool.

Definition at line 22 of file CompositeCache.php.

Constructor & Destructor Documentation

Elgg\Cache\CompositeCache::__construct (   $namespace,
Config  $config,
  $flags 
)

Constructor.

Parameters
string$namespaceCache namespace
Config$configElgg config
int$flagsStart flags
Exceptions

Definition at line 58 of file CompositeCache.php.

Member Function Documentation

Elgg\Cache\CompositeCache::buildApcDriver ( )
protected

Builds APC driver.

Returns
null|Apc

Definition at line 241 of file CompositeCache.php.

Elgg\Cache\CompositeCache::buildBlackHoleDriver ( )
protected

Builds null cache driver.

Returns
null|BlackHole

Definition at line 332 of file CompositeCache.php.

Elgg\Cache\CompositeCache::buildEphemeralDriver ( )
protected

Builds in-memory driver.

Returns
null|Ephemeral

Definition at line 320 of file CompositeCache.php.

Elgg\Cache\CompositeCache::buildFileSystemDriver ( )
protected

Builds file system driver.

Returns
null|FileSystem

Definition at line 301 of file CompositeCache.php.

Elgg\Cache\CompositeCache::buildMemcachedDriver ( )
protected

Builds Memcached driver.

Returns
null|Memcache

Definition at line 275 of file CompositeCache.php.

Elgg\Cache\CompositeCache::buildRedisDriver ( )
protected

Builds Redis driver.

Returns
null|Redis

Definition at line 257 of file CompositeCache.php.

Elgg\Cache\CompositeCache::clear ( )

Clear out all the contents of the cache.

Returns
bool

Definition at line 168 of file CompositeCache.php.

Elgg\Cache\CompositeCache::createPool ( )
protected

Create a new composite stash pool.

Returns
Pool
Exceptions

Definition at line 212 of file CompositeCache.php.

Elgg\Cache\CompositeCache::delete (   $key)

Invalidate a key.

Parameters
string$keyName
Returns
bool

Definition at line 149 of file CompositeCache.php.

Elgg\Cache\CompositeCache::getNamespace ( )

Get the namespace currently defined.

Returns
string

Definition at line 192 of file CompositeCache.php.

Elgg\Cache\CompositeCache::getPool ( )

Returns cache pool.

Returns
Pool

Definition at line 71 of file CompositeCache.php.

Elgg\Cache\CompositeCache::load (   $key,
  $invalidation_method = null 
)

Load data from the cache using a given key.

Parameters
string$keyName
array$invalidation_methodStash invalidation method arguments
Returns
mixed The stored data or false.

Definition at line 109 of file CompositeCache.php.

Elgg\Cache\CompositeCache::namespaceKey (   $key)

Namespace the key.

Parameters
string$keyValue name
Returns
string

Definition at line 203 of file CompositeCache.php.

Elgg\Cache\CompositeCache::save (   $key,
  $data,
  $ttl = null 
)

Save data in a cache.

Parameters
string$keyName
mixed$dataValue
int | DateTime$ttlExpire value after
Returns
bool

Definition at line 84 of file CompositeCache.php.

Elgg\Cache\CompositeCache::setNamespace (   $namespace = "default")

Set the namespace of this cache.

This is useful for cache types (like memcache or static variables) where there is one large flat area of memory shared across all instances of the cache.

Parameters
string$namespaceNamespace for cache
Returns
void

Definition at line 183 of file CompositeCache.php.

Member Data Documentation

Elgg\Cache\CompositeCache::$config
protected

Definition at line 32 of file CompositeCache.php.

Elgg\Cache\CompositeCache::$flags
protected

Definition at line 37 of file CompositeCache.php.

Elgg\Cache\CompositeCache::$namespace
protected

Definition at line 47 of file CompositeCache.php.

Elgg\Cache\CompositeCache::$pool
protected

Definition at line 42 of file CompositeCache.php.

Elgg\Cache\CompositeCache::$ttl = 86400
protected

TTL of saved items (default timeout after a day to prevent anything getting too stale)

Definition at line 27 of file CompositeCache.php.


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