Pluf_Cache_Apc Class Reference

Inheritance diagram for Pluf_Cache_Apc:

Pluf_Cache

List of all members.

Public Member Functions

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

Private Attributes

 $keyprefix = ''
 $compress = false


Detailed Description

APC based cache.

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;
 

See also:
Pluf_Cache

http://www.php.net/gzdeflate

http://www.php.net/gzinflate


Constructor & Destructor Documentation

Pluf_Cache_Apc::__construct (  ) 

Create the cache object and initialize it from the configuration.


Member Function Documentation

Pluf_Cache_Apc::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_Apc::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)
Returns:
mixed Stored value or default

Reimplemented from Pluf_Cache.


Member Data Documentation

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.


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

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