1: <?php
2:
3: namespace Guzzle\Cache;
4:
5: /**
6: * Zend Framework 1 cache adapter
7: *
8: * @link http://framework.zend.com/manual/en/zend.cache.html
9: */
10: class Zf1CacheAdapter extends AbstractCacheAdapter
11: {
12: /**
13: * @param \Zend_Cache_Backend $cache Cache object to wrap
14: */
15: public function __construct(\Zend_Cache_Backend $cache)
16: {
17: $this->cache = $cache;
18: }
19:
20: /**
21: * {@inheritdoc}
22: */
23: public function contains($id, array $options = null)
24: {
25: return $this->cache->test($id);
26: }
27:
28: /**
29: * {@inheritdoc}
30: */
31: public function delete($id, array $options = null)
32: {
33: return $this->cache->remove($id);
34: }
35:
36: /**
37: * {@inheritdoc}
38: */
39: public function fetch($id, array $options = null)
40: {
41: return $this->cache->load($id);
42: }
43:
44: /**
45: * {@inheritdoc}
46: */
47: public function save($id, $data, $lifeTime = false, array $options = null)
48: {
49: return $this->cache->save($data, $id, array(), $lifeTime);
50: }
51: }
52: