3 namespace Doctrine\Common\Cache;
7 * ZendServer SHM cache provider.
10 class ZendShmCache extends \Doctrine\Common\Cache\CacheProvider
13 protected $cache = null;
15 public function __construct()
17 $this->cache = new \Memcache();
18 $this->cache->pconnect('localhost', 11211);
24 protected function doFetch($id)
26 return $this->cache->get(APP_KEY . '.DOC2::' . $id);
32 protected function doContains($id)
34 return (bool) $this->cache->get(APP_KEY . '.DOC2::' . $id);
40 protected function doSave($id, $data, $lifeTime = 0)
42 if ($lifeTime > 30 * 24 * 3600) {
43 $lifeTime = time() + $lifeTime;
45 return $this->cache->set(APP_KEY . '.DOC2::' . $id, $data, 0, (int) $lifeTime);
51 protected function doDelete($id)
53 return $this->cache->delete(APP_KEY . '.DOC2::' . $id);
59 protected function doFlush()
61 return $this->cache->flush();
67 protected function doGetStats()