private function connection__redis() {
		$this->connection = new \Redis();
		# @note: This emits warning on failure instead of throwing
		# exception, hence the @ sign.
		if (!@$this->connection->connect(
			$this->redishost, $this->redisport,
			$this->redistimeout
		))
			// @codeCoverageIgnoreStart
			return $this->connection_open_fail();
			// @codeCoverageIgnoreEnd
		if ($this->redispassword || $this->redisdatabase) {
			try {
				if ($this->redispassword)
					$this->connection->auth($this->redispassword);
				if ($this->redisdatabase)
					$this->connection->select($this->redisdatabase);
			} catch(\RedisException $e) {
				return $this->connection_open_fail($e->getMessage());
			}
		}
		try {
			$this->connection->ping();
		} catch(\RedisException $e) {
			return $this->connection_open_fail($e->getMessage());
		}
		return $this->connection_open_ok();
	}
private function connection__redis() {
		$this->connection = new \Redis();
		# @note: This emits warning on failure instead of throwing
		# exception, hence the @ sign.
		if (!@$this->connection->connect(
			$this->redishost, $this->redisport,
			$this->redistimeout
		))
			// @codeCoverageIgnoreStart
			return $this->connection_open_fail();
			// @codeCoverageIgnoreEnd
		if ($this->redispassword || $this->redisdatabase) {
			try {
				if ($this->redispassword)
					$this->connection->auth($this->redispassword);
				if ($this->redisdatabase)
					$this->connection->select($this->redisdatabase);
			} catch(\RedisException $e) {
				return $this->connection_open_fail($e->getMessage());
			}
		}
		try {
			$this->connection->ping();
		} catch(\RedisException $e) {
			return $this->connection_open_fail($e->getMessage());
		}
		return $this->connection_open_ok();
	}
private function connection__redis ( ) { $ this -> connection = new \ Redis ( ) ; # @note: This emits warning on failure instead of throwing # exception, hence the @ sign. if ( ! @ $ this -> connection -> connect ( $ this -> redishost , $ this -> redisport , $ this -> redistimeout ) ) // @codeCoverageIgnoreStart return $ this -> connection_open_fail ( ) ; // @codeCoverageIgnoreEnd if ( $ this -> redispassword || $ this -> redisdatabase ) { try { if ( $ this -> redispassword ) $ this -> connection -> auth ( $ this -> redispassword ) ; if ( $ this -> redisdatabase ) $ this -> connection -> select ( $ this -> redisdatabase ) ; } catch ( \ RedisException $ e ) { return $ this -> connection_open_fail ( $ e -> getMessage ( ) ) ; } } try { $ this -> connection -> ping ( ) ; } catch ( \ RedisException $ e ) { return $ this -> connection_open_fail ( $ e -> getMessage ( ) ) ; } return $ this -> connection_open_ok ( ) ; }
Open connection with ext-redis.
Open connection with ext - redis .