
Public Member Functions | |
| __construct () | |
| set ($key, $value, $timeout=null) | |
| get ($key, $default=null) | |
Private Attributes | |
| $keyprefix = '' | |
| $compress = false | |
You need APC installed on your server for this cache system to work. You can install APC with $ sudo pecl install apc on most systems.
A special 'cache_apc_keyprefix' can be set to use APC for different applications and avoid conflict. Compression is performed at the PHP level using the gz(in|de)flate functions.
Example of configuration:
$cfg['cache_engine'] = 'Pluf_Cache_Apc'; $cfg['cache_timeout'] = 300; $cfg['cache_apc_keyprefix'] = 'uniqueforapp'; $cfg['cache_apc_compress'] = true;
| Pluf_Cache_Apc::__construct | ( | ) |
Create the cache object and initialize it from the configuration.
| Pluf_Cache_Apc::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_Apc::get | ( | $ | key, | |
| $ | default = null | |||
| ) |
Get value from the cache.
| string | Key to get the information | |
| mixed | Default value to return if cache miss (null) |
Reimplemented from Pluf_Cache.
Pluf_Cache_Apc::$keyprefix = '' [private] |
Prefix added to all the keys.
Pluf_Cache_Apc::$compress = false [private] |
Auto compress the data to save memory against a small performance loss.