PHP Class Cachearium\Backend\CacheMemcached

Keys are set up as: [namespace]_[id]_[subgroup] We inherit from CacheRAM to avoid fetching things multiple times.
Inheritance: extends CacheRAM
Show file Open project: corollarium/cachearium Class Usage Examples

Public Methods

Method Description
__clone ( ) Prevent users to clone the instance
addServers ( array $servers ) : boolean
cleanP ( $base, $id ) (non-PHPdoc)
clear ( ) (non-PHPdoc)
delete ( CacheKey $k ) (non-PHPdoc)
errorCallback ( )
get ( CacheKey $k ) (non-PHPdoc)
getFetches ( )
hasMemcachedExt ( ) : boolean Is memcached available in this system?
increment ( $value, CacheKey $k, $default ) (non-PHPdoc)
prefetch ( $data ) (non-PHPdoc)
prefetchClear ( ) Clear prefetched data. This is rarely useful.
prefetchKeys ( $keys )
report ( ) (non-PHPdoc)
singleton ( $servers = [] ) : Cache Cache constructor (this is a singleton).
store ( $data, CacheKey $k, $lifetime ) (non-PHPdoc)

Protected Methods

Method Description
hashKey ( CacheKey $k ) (non-PHPdoc)

Private Methods

Method Description
__construct ( ) Constructor.
getGroupString ( CacheKey $k ) : string Converts cachekey to a string for the data group.

Method Details

__clone() public method

Prevent users to clone the instance
public __clone ( )

addServers() public method

public addServers ( array $servers ) : boolean
$servers array Each entry in servers is supposed to be an array containing hostname, port, and, optionally, weight of the server. $servers = array( array('mem1.domain.com', 11211, 33), array('mem2.domain.com', 11211, 67) );
return boolean

cleanP() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::cleanP()
public cleanP ( $base, $id )

clear() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::clear()
public clear ( )

delete() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::delete()
public delete ( CacheKey $k )
$k Cachearium\CacheKey

errorCallback() public method

public errorCallback ( )

get() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::get()
public get ( CacheKey $k )
$k Cachearium\CacheKey

getFetches() public method

public getFetches ( )

hasMemcachedExt() public static method

Is memcached available in this system?
public static hasMemcachedExt ( ) : boolean
return boolean

hashKey() protected method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::hashKey()
protected hashKey ( CacheKey $k )
$k Cachearium\CacheKey

increment() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::increment()
public increment ( $value, CacheKey $k, $default )
$k Cachearium\CacheKey

prefetch() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::prefetch()
public prefetch ( $data )

prefetchClear() public method

Clear prefetched data. This is rarely useful.
public prefetchClear ( )

prefetchKeys() public method

public prefetchKeys ( $keys )

report() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::report()
public report ( )

singleton() public static method

Cache constructor (this is a singleton).
public static singleton ( $servers = [] ) : Cache
return Cache The cache singleton.

store() public method

(non-PHPdoc)
See also: Cachearium\Backend\CacheRAM::store()
public store ( $data, CacheKey $k, $lifetime )
$k Cachearium\CacheKey