Zf1CacheAdapter.php 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Guzzle\Cache;
  3. use Guzzle\Common\Version;
  4. /**
  5. * Zend Framework 1 cache adapter
  6. *
  7. * @link http://framework.zend.com/manual/en/zend.cache.html
  8. * @deprecated
  9. * @codeCoverageIgnore
  10. */
  11. class Zf1CacheAdapter extends AbstractCacheAdapter
  12. {
  13. /**
  14. * @param \Zend_Cache_Backend $cache Cache object to wrap
  15. */
  16. public function __construct(\Zend_Cache_Backend $cache)
  17. {
  18. Version::warn(__CLASS__ . ' is deprecated. Upgrade to ZF2 or use PsrCacheAdapter');
  19. $this->cache = $cache;
  20. }
  21. public function contains($id, array $options = null)
  22. {
  23. return $this->cache->test($id);
  24. }
  25. public function delete($id, array $options = null)
  26. {
  27. return $this->cache->remove($id);
  28. }
  29. public function fetch($id, array $options = null)
  30. {
  31. return $this->cache->load($id);
  32. }
  33. public function save($id, $data, $lifeTime = false, array $options = null)
  34. {
  35. return $this->cache->save($data, $id, array(), $lifeTime);
  36. }
  37. }