/** * @param $key * @return null|mixed */ public function get($key) { $file = $this->getFilename($key); if ($this->exists($file) && $this->valid($file)) { return $this->serializer->deserialize(file_get_contents($file)); } return null; }
/** * Sets a cache entry * * @param $key * @param $value * @return void */ public function set($key, $value) { $item = $this->pool->getItem($key); $item->set($this->serializer->serialize($value), $this->expire); }
/** * Sets a cache entry * * @param $key * @param $value * @return void */ public function set($key, $value) { if ($this->ttl === null) { $this->client->set($key, $this->serializer->serialize($value)); } else { $this->client->set($key, $this->serializer->serialize($value), 'ex', $this->ttl); } }