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
Posted by: Scorpio Documentor (Writer), in Cache on 19 Nov 2009 @ 20:30
Tags: cache, cachewriter, cachewriterapc,
This
work is licenced under a
Creative Commons Licence.