connect($config['redis_host'], $config['redis_port']); if (isset($config['redis_password'])) $this->auth($config['redis_password']); } catch (RedisException $e) { return apiresult(['error' => 'Could not connect to Redis: '.strval($e)]); } if ($this->ping()) return true; return false; } }