
Public Member Functions | |
| __construct () | |
| set ($key, $value, $timeout=null) | |
| get ($key, $default=null) | |
Private Attributes | |
| $memcache = null | |
| $keyprefix = '' | |
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)
| Pluf_Cache_Memcached::__construct | ( | ) |
| Pluf_Cache_Memcached::set | ( | $ | key, | |
| $ | value, | |||
| $ | timeout = null | |||
| ) |
Set a value in the cache.
| string | Key to store the information | |
| mixed | Value to store | |
| int | Timeout in seconds (null) |
Reimplemented from Pluf_Cache.
| Pluf_Cache_Memcached::get | ( | $ | key, | |
| $ | default = null | |||
| ) |
Get value from the cache.
| string | Key to get the information | |
| mixed | Default value to return if cache miss (null) | |
| mixed | Stored value or default |
Reimplemented from Pluf_Cache.
Pluf_Cache_Memcached::$memcache = null [private] |
Pluf_Cache_Memcached::$keyprefix = '' [private] |