Provides an interface into the APC caching system. Requires the APC extension be loaded and configured correctly.
// store an item using defaults
$oWriter = new cacheWriterApc();
$oWriter->setCacheId('MyCachedObject');
$oWriter->setData(new stdClass());
$oWriter->save();
// check if cached and fetch the previous item
$oWriter = new cacheWriterApc();
$oWriter->setCacheId('MyCachedObject');
if ( $oWriter->isCached() ) {
$oWriter->load();
$oWriter->getData();
//...
}
// clear the cache
$oWriter = new cacheWriterApc();
$oWriter->setCacheId('MyCachedObject');
$oWriter->delete();
if ( $oWriter->isCached() ) {
// this should not execute...
}
public __construct([$inCacheId = null])
Returns a new apc writer for the cache controller
public static clearCache()
Removes all cached records from apc user space
public runGc()
Runs garbage collection