diff -r 000000000000 -r 7f95f8617b0b vendor/doctrine-common/lib/Doctrine/Common/Cache/ZendDataCache.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/doctrine-common/lib/Doctrine/Common/Cache/ZendDataCache.php Sat Sep 24 15:40:41 2011 +0200 @@ -0,0 +1,76 @@ +. + */ + +namespace Doctrine\Common\Cache; + +/** + * Zend Data Cache cache driver. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Ralph Schindler + */ +class ZendDataCache extends AbstractCache +{ + public function __construct() + { + $this->setNamespace('doctrine::'); // zend data cache format for namespaces ends in :: + } + + /** + * {@inheritdoc} + */ + public function getIds() + { + throw new \BadMethodCallException("getIds() is not supported by ZendDataCache"); + } + + /** + * {@inheritdoc} + */ + protected function _doFetch($id) + { + return zend_shm_cache_fetch($id); + } + + /** + * {@inheritdoc} + */ + protected function _doContains($id) + { + return (zend_shm_cache_fetch($id) !== FALSE); + } + + /** + * {@inheritdoc} + */ + protected function _doSave($id, $data, $lifeTime = 0) + { + return zend_shm_cache_store($id, $data, $lifeTime); + } + + /** + * {@inheritdoc} + */ + protected function _doDelete($id) + { + return zend_shm_cache_delete($id); + } +} \ No newline at end of file