. */ namespace Doctrine\Common\Cache; /** * APC cache driver. * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 1.0 * @version $Revision: 4910 $ * @author Konsta Vesterinen * @author Roman Borschel */ class ApcCache implements Cache { /** * {@inheritdoc} */ public function __construct() { if ( ! extension_loaded('apc')) { \Doctrine\Common\DoctrineException::updateMe('The apc extension must be loaded in order to use the ApcCache.'); } } /** * {@inheritdoc} */ public function fetch($id) { return apc_fetch($id); } /** * {@inheritdoc} */ public function contains($id) { return apc_fetch($id) === false ? false : true; } /** * {@inheritdoc} */ public function save($id, $data, $lifeTime = false) { return (bool) apc_store($id, $data, $lifeTime); } /** * {@inheritdoc} */ public function delete($id) { return apc_delete($id); } }