Path

ez components / documentation / api reference / 2007.2 / cache


Cache: ezcCacheMemcacheBackend

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcCacheMemcacheBackend

This backend stores data in a Memcache. [source]

Parents

ezcCacheMemoryBackend
   |
   --ezcCacheMemcacheBackend

Constants

COMPRESS_THRESHOLD = 1000000 The compress threshold.

Member Variables

protected resource $memcache
Holds an instance to a Memcache object.
protected ezcCacheStorageMemcacheOptions $options
Holds the options for this class.

Method Summary

public ezcCacheMemcacheBackend __construct( [$options = array()] )
Constructs a new ezcCacheMemcacheBackend object.
public void __destruct( )
Destructor for the Memcache backend.
public bool delete( $key, [$timeout = 0] )
Deletes the data from the cache associated with key $key. Returns true or false depending on the success of the operation.
public mixed fetch( $key )
Returns the data from the cache associated with key $key.
public bool store( $key, $var, [$expire = 0] )
Adds the $var data to the cache under the key $key. Returns true or false depending on the success of the operation.

Inherited Methods

From ezcCacheMemoryBackend :
public abstract bool ezcCacheMemoryBackend::delete()
Deletes the data associated with key $key.
public abstract mixed ezcCacheMemoryBackend::fetch()
Fetches the data associated with key $key.
public abstract bool ezcCacheMemoryBackend::store()
Stores the data $var under the key $key.

Methods

__construct

ezcCacheMemcacheBackend __construct( [ $options = array()] )
Constructs a new ezcCacheMemcacheBackend object.
For options for this backend see ezcCacheStorageMemcacheOptions.

Parameters

Name Type Description
$options array(string=>mixed)  

Throws

ClassDescription
ezcBaseExtensionNotFoundException If the PHP memcache and zlib extensions are not installed.
ezcCacheMemcacheException If the connection to the Memcache host did not succeed.

__destruct

void __destruct( )
Destructor for the Memcache backend.

delete

bool delete( string $key, [int $timeout = 0] )
Deletes the data from the cache associated with key $key. Returns true or false depending on the success of the operation.
The value $timeout specifies the timeout period in seconds for the delete command.

Parameters

Name Type Description
$key string  
$timeout int  

Redefinition of

Method Description
ezcCacheMemoryBackend::delete() Deletes the data associated with key $key.

fetch

mixed fetch( mixed $key )
Returns the data from the cache associated with key $key.

Parameters

Name Type Description
$key mixed  

Redefinition of

Method Description
ezcCacheMemoryBackend::fetch() Fetches the data associated with key $key.

store

bool store( string $key, mixed $var, [int $expire = 0] )
Adds the $var data to the cache under the key $key. Returns true or false depending on the success of the operation.

Parameters

Name Type Description
$key string  
$var mixed  
$expire int  

Redefinition of

Method Description
ezcCacheMemoryBackend::store() Stores the data $var under the key $key.

Last updated: Mon, 17 Dec 2007