Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Disk.php
Go to the documentation of this file.
1 <?php
25 #require_once 'Zend/Cache/Backend/Interface.php';
26 
28 #require_once 'Zend/Cache/Backend/ZendServer.php';
29 
30 
38 {
45  public function __construct(array $options = array())
46  {
47  if (!function_exists('zend_disk_cache_store')) {
48  Zend_Cache::throwException('Zend_Cache_ZendServer_Disk backend has to be used within Zend Server environment.');
49  }
50  parent::__construct($options);
51  }
52 
61  protected function _store($data, $id, $timeToLive)
62  {
63  if (zend_disk_cache_store($this->_options['namespace'] . '::' . $id,
64  $data,
65  $timeToLive) === false) {
66  $this->_log('Store operation failed.');
67  return false;
68  }
69  return true;
70  }
71 
78  protected function _fetch($id)
79  {
80  return zend_disk_cache_fetch($this->_options['namespace'] . '::' . $id);
81  }
82 
89  protected function _unset($id)
90  {
91  return zend_disk_cache_delete($this->_options['namespace'] . '::' . $id);
92  }
93 
97  protected function _clear()
98  {
99  zend_disk_cache_clear($this->_options['namespace']);
100  }
101 }
_store($data, $id, $timeToLive)
Definition: Disk.php:61
$id
Definition: fieldset.phtml:14
__construct(array $options=array())
Definition: Disk.php:45
_log($message, $priority=4)
Definition: Backend.php:273
static throwException($msg, Exception $e=null)
Definition: Cache.php:205