diff -r 000000000000 -r 7f95f8617b0b vendor/doctrine-common/lib/Doctrine/Common/Cache/ApcCache.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/doctrine-common/lib/Doctrine/Common/Cache/ApcCache.php Sat Sep 24 15:40:41 2011 +0200 @@ -0,0 +1,90 @@ +. + */ + +namespace Doctrine\Common\Cache; + +/** + * APC cache driver. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision$ + * @author Benjamin Eberlei + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author David Abdemoulaie + * @todo Rename: APCCache + */ +class ApcCache extends AbstractCache +{ + /** + * {@inheritdoc} + */ + public function getIds() + { + $ci = apc_cache_info('user'); + $keys = array(); + + foreach ($ci['cache_list'] as $entry) { + $keys[] = $entry['info']; + } + + return $keys; + } + + /** + * {@inheritdoc} + */ + protected function _doFetch($id) + { + return apc_fetch($id); + } + + /** + * {@inheritdoc} + */ + protected function _doContains($id) + { + $found = false; + + apc_fetch($id, $found); + + return $found; + } + + /** + * {@inheritdoc} + */ + protected function _doSave($id, $data, $lifeTime = 0) + { + return (bool) apc_store($id, $data, (int) $lifeTime); + } + + /** + * {@inheritdoc} + */ + protected function _doDelete($id) + { + return apc_delete($id); + } +} \ No newline at end of file