* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class Pool implements CacheItemPoolInterface { /** @var \Doctrine\Common\Cache\CacheProvider */ protected $handler; /** @var array */ protected $items; public function __construct(CacheProvider $handler) { $this->handler = $handler; $this->items = []; } public function setHandler(CacheProvider $handler) { $this->handler = $handler; } public function getItem($key) { $data = $this->handler->fetch($key); if ($data !== false) { return new Item($key, $data, true); } else { return new Item($key, null, false); } } public function getItems(array $keys = array()) { $result = []; $data = $this->handler->fetchMultiple($keys); foreach ($keys as $key) { if (isset($data[$key]) && $data[$key] !== false) { $result[] = new Item($key, $data[$key], true); } else { $result[] = new Item($key, null, false); } } return $result; } public function hasItem($key) { return $this->handler->contains($key); } public function clear() { return $this->handler->flushAll(); } public function deleteItem($key) { return $this->handler->delete($key); } public function deleteItems(array $keys) { $result = true; foreach ($keys as $key) { if ($this->handler->delete($key) === false) { $result = false; } } return $result; } public function save(CacheItemInterface $item) { return $this->handler->save($item->getKey(), $item->get(), $item->getTtl()); } public function saveDeferred(CacheItemInterface $item) { $this->items[] = $item; return true; } public function commit() { $result = true; foreach ($this->items as $item) { if ($this->save($item) === false) { $result = false; } } $this->items = []; return $result; } } __halt_compiler();----SIGNATURE:----H36KLbCw9iFZKngKDPvhy/YLcTU8Xo216QP/OTZjQo8saCNrt60mX/3bLN9zdk9dzTEK4xGeiExdO9u/lm8Zf05gchoIsyCYTw5mnld1acEDyRL+0Us034UHYJU3gl2QAPdk+Zw6iS/htv8K8F7U8fQQT90uBU5RK4baNC30EmUdDTVoNzCO7MFjj1VtCgpsDn5jH/INQAw7y7hDAAYvMQa18d/ixs2aZe4/dnXLdSAqYiBYjAHpfh6kZ419I+iFhB75Nm2tu/HRDH02LHNzPgGxCPKhBqyMWzuXjk1QNSu8O1N0UB6gpUJrd6P9hjkRAV71C1d86Gg0vqYev6osyCYBHWY9dflFFZhlwVTCtNpLQl1mOx/9PPRfAJgUoHFsIDp3wbdmZrhxuYYlBRlXWu/sCy4nwR79JPgY91cwGBF8yhrLR6xJpRNg6nCNQ4VmSoseXremuSKC/FgjSSvh6dIYop75+aXNususBghsyOnzKNp0EJVpuU/r9PW/D1573/oSIPmDlVLlU/20e8gUTm3t5f510eqdRdDcYSe9CSw3O9yQ0U2lC53J8yAd+7xPWP3j8a5Cio4pCvg9lIjmUri9Q1Cd+paguDxEe0SXWYVPHndiEg4JAKavhgiv45Rkma760CMaMsmfSLD2N4Sm2Mht1iZR52QEK6rLG7rxSXc=----ATTACHMENT:----MjA3NzIzOTk2NDI5OTk1NiA0NzM4ODQwOTk0MzgzMDU0IDgyNTEwMDA2NjE2NTYwNzg=