memc = null; } /** * Adding server to server pool. * * @param mixed $data Server data array * * @return void * * @since 1.0.0 */ public function addServer($data) { $this->memc->addServer($data['host'], $data['port'], $data['timeout']); } /** * {@inheritdoc} */ public function set($key, $value, int $expire = -1) /* : void */ { $this->memc->set($key, $value, false, $expire); } /** * {@inheritdoc} */ public function add($key, $value, int $expire = -1) : bool { return $this->memc->add($key, $value, false, $expire); } /** * {@inheritdoc} */ public function get($key, int $expire = -1) { return $this->memc->get($key); } /** * {@inheritdoc} */ public function delete($key, int $expire = -1) : bool { $this->memc->delete($key); } /** * {@inheritdoc} */ public function flush(int $expire = 0) : bool { $this->memc->flush(); return true; } /** * {@inheritdoc} */ public function flushAll() : bool { $this->memc->flush(); return true; } /** * {@inheritdoc} */ public function replace($key, $value, int $expire = -1) : bool { $this->memc->replace($key, $value, false, $expire); } /** * {@inheritdoc} */ public function stats() : array { /** @noinspection PhpMethodOrClassCallIsNotCaseSensitiveInspection */ return $this->memc->getExtendedStats(); } /** * {@inheritdoc} */ public function getThreshold() : int { return $this->threshold; } /** * {@inheritdoc} */ public function setStatus(int $status) /* : void */ { $this->status = $status; } /** * Destructor. * * @since 1.0.0 */ public function __destruct() { $this->close(); } /** * Closing cache. * * @since 1.0.0 */ public function close() { if ($this->memc !== null) { $this->memc->close(); $this->memc = null; } } }