Pluf_Cache_Memcached Class Reference

Inheritance diagram for Pluf_Cache_Memcached:

Pluf_Cache

List of all members.

Public Member Functions

 __construct ()
 set ($key, $value, $timeout=null)
 get ($key, $default=null)

Private Attributes

 $memcache = null
 $keyprefix = ''


Detailed Description

Memcached based cache.

A special 'cache_memcached_keyprefix' can be set to use one memcached for different applications and avoid conflict.

Example of configuration:

 $cfg['cache_engine'] = 'Pluf_Cache_Memcached';
 $cfg['cache_timeout'] = 300;
 $cfg['cache_memcached_keyprefix'] = 'uniqueforapp';
 $cfg['cache_memcached_server'] = 'localhost';
 $cfg['cache_memcached_port'] = 11211;
 $cfg['cache_memcached_compress'] = 0; (or MEMCACHE_COMPRESSED)
 

Constructor & Destructor Documentation

Pluf_Cache_Memcached::__construct (  ) 


Member Function Documentation

Pluf_Cache_Memcached::set ( key,
value,
timeout = null 
)

Set a value in the cache.

Parameters:
string Key to store the information
mixed Value to store
int Timeout in seconds (null)
Returns:
bool Success

Reimplemented from Pluf_Cache.

Pluf_Cache_Memcached::get ( key,
default = null 
)

Get value from the cache.

Parameters:
string Key to get the information
mixed Default value to return if cache miss (null)
mixed Stored value or default

Reimplemented from Pluf_Cache.


Member Data Documentation

Pluf_Cache_Memcached::$memcache = null [private]

Pluf_Cache_Memcached::$keyprefix = '' [private]


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

Generated on Wed Feb 3 15:44:51 2010 for Pluf by  doxygen