private function connect() { $this->redis = new \Redis(); $success = $this->redis->connect($this->host, $this->port, $this->timeout, null, 100); if ($success && !empty($this->password)) { $success = $this->redis->auth($this->password); } if (!empty($this->database) || 0 === $this->database) { $this->redis->select($this->database); } return $success; }