1 | <?php |
||
35 | abstract class DriverAbstract extends ObjectAbstract implements DriverInterface, ErrorAwareInterface |
||
36 | { |
||
37 | use ErrorAwareTrait; |
||
38 | |||
39 | /** |
||
40 | * number of items to defer, 0 means no defer |
||
41 | * |
||
42 | * @var int |
||
43 | * @access protected |
||
44 | */ |
||
45 | protected $defer_count = 0; |
||
46 | |||
47 | /** |
||
48 | * defer pool |
||
49 | * |
||
50 | * @var CacheItemExtendedInterface[] |
||
51 | * @access protected |
||
52 | */ |
||
53 | protected $defer = []; |
||
54 | |||
55 | /** |
||
56 | * @param array $properties |
||
57 | * @access public |
||
58 | */ |
||
59 | public function __construct(array $properties = []) |
||
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | public function has(/*# string */ $key)/*# : array */ |
||
76 | |||
77 | /** |
||
78 | * {@inheritDoc} |
||
79 | */ |
||
80 | public function get(/*# string */ $key) |
||
89 | |||
90 | /** |
||
91 | * {@inheritDoc} |
||
92 | */ |
||
93 | public function saveDeferred(CacheItemInterface $item)/*# : bool */ |
||
105 | |||
106 | /** |
||
107 | * {@inheritDoc} |
||
108 | */ |
||
109 | public function delete(CacheItemInterface $item)/*# : bool */ |
||
117 | |||
118 | /** |
||
119 | * {@inheritDoc} |
||
120 | */ |
||
121 | public function commit()/*# : bool */ |
||
131 | |||
132 | /** |
||
133 | * {@inheritDoc} |
||
134 | */ |
||
135 | public function clear()/*# : bool */ |
||
140 | |||
141 | /** |
||
142 | * {@inheritDoc} |
||
143 | */ |
||
144 | public function purage()/*# : bool */ |
||
148 | |||
149 | /** |
||
150 | * {@inheritDoc} |
||
151 | */ |
||
152 | public function ping()/*# : bool */ |
||
156 | |||
157 | /** |
||
158 | * Flush deferred items |
||
159 | * |
||
160 | * @access protected |
||
161 | */ |
||
162 | protected function flushDeferred() |
||
169 | |||
170 | /** |
||
171 | * In deferred array ? |
||
172 | * |
||
173 | * @param string $key |
||
174 | * @return array |
||
175 | * @access protected |
||
176 | */ |
||
177 | protected function isDeferred(/*# string */ $key)/*# : array */ |
||
185 | |||
186 | /** |
||
187 | * Get value from deferred array |
||
188 | * @param string $key |
||
189 | * @return string |
||
190 | * @access protected |
||
191 | */ |
||
192 | protected function getFromDeferred(/*# string */ $key)/*# : string */ |
||
196 | |||
197 | /** |
||
198 | * Driver specific has() |
||
199 | * |
||
200 | * @param string $key |
||
201 | * @return array |
||
202 | * @access protected |
||
203 | */ |
||
204 | abstract protected function driverHas(/*# string */ $key)/*# : array */; |
||
205 | |||
206 | /** |
||
207 | * Driver specific get() |
||
208 | * |
||
209 | * @param string $key |
||
210 | * @return string|null |
||
211 | * @access protected |
||
212 | */ |
||
213 | abstract protected function driverGet(/*# string */ $key); |
||
214 | |||
215 | /** |
||
216 | * Driver specific delete() |
||
217 | * |
||
218 | * @param CacheItemInterface $item |
||
219 | * @return bool |
||
220 | * @access protected |
||
221 | */ |
||
222 | abstract protected function driverDelete(CacheItemInterface $item)/*# : bool */; |
||
223 | |||
224 | /** |
||
225 | * Driver specific clear() |
||
226 | * |
||
227 | * @return bool |
||
228 | * @access protected |
||
229 | */ |
||
230 | abstract protected function driverClear()/*# : bool */; |
||
231 | } |
||
232 |