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rF޵ɧ]3A[z?h䖺;V9y1Ecbq7#D- )>#i2M&ҽ+e(rƚd;js35gƃ9EmzC`a6n3ל *=J;r3:`>=/ Y8jzb KƸ&j{T6% lGz0|JArver. Please check host and port."); } if ($password !== null && self::$redis->auth($password) === false) { throw new Exception("Could not authenticate with Redis server. Please check password."); } if ($database !== null && self::$redis->select($database) === false) { throw new Exception("Could not select Redis database. Please check database setting."); } } catch (Exception $e) { rcube::raise_error($e, true, false); $failures++; } } if (count($hosts) === $failures) { self::$redis = false; } if (self::$redis) { try { $ping = self::$redis->ping(); if ($ping !== true && $ping !== "+PONG") { throw new Exception("Redis connection failure. Ping failed."); } } catch (Exception $e) { self::$redis = false; rcube::raise_error($e, true, false); } } return self::$redis; } /** * Remove cache records older than ttl */ public function expunge() { // No need for GC, entries are expunged automatically } /** * Remove expired records */ public static function gc() { // No need for GC, entries are expunged automatically } /** * Reads cache entry. * * @param string $key Cache internal key name * * @return mixed Cached value */ protected function get_item($key) { if (!self::$redis) { return false; } try { $data = self::$redis->get($key); } catch (Exception $e) { rcube::raise_error($e, true, false); return false; } if ($this->debug) { $this->debug('get', $key, $data); } return $data; } /** * Adds entry into Redis. * * @param string $key Cache internal key name * @param mixed $data Serialized cache data * * @param bool True on success, False on failure */ protected function add_item($key, $data) { if (!self::$redis) { return false; } try { $result = self::$redis->setEx($key, $this->ttl, $data); } catch (Exception $e) { rcube::raise_error($e, true, false); return false; } if ($this->debug) { $this->debug('set', $key, $data, $result); } return $result; } /** * Deletes entry from Redis. * * @param string $key Cache internal key name * * @param bool True on success, False on failure */ protected function delete_item($key) { if (!self::$redis) { return false; } try { $fname = method_exists(self::$redis, 'del') ? 'del' : 'delete'; $result = self::$redis->$fname($key); } catch (Exception $e) { rcube::raise_error($e, true, false); return false; } if ($this->debug) { $this->debug('delete', $key, null, $result); } return $result; } }