From 49377f8cb208d6405ef512b31abcf672bc3703d7 Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Mon, 12 Jan 2015 14:59:01 -0500 Subject: [PATCH] GuzzleConnection should reuse AbstractConnection's $connectionParams $connectionOpts is redundant with $connectionParams, and interferes with functionality in some cases --- src/Elasticsearch/Connections/GuzzleConnection.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Elasticsearch/Connections/GuzzleConnection.php b/src/Elasticsearch/Connections/GuzzleConnection.php index 0de26e84e..231070bad 100644 --- a/src/Elasticsearch/Connections/GuzzleConnection.php +++ b/src/Elasticsearch/Connections/GuzzleConnection.php @@ -33,8 +33,6 @@ class GuzzleConnection extends AbstractConnection implements ConnectionInterface /** @var Client */ private $guzzle; - private $connectionOpts = array(); - private $lastRequest = array(); @@ -63,12 +61,13 @@ public function __construct($hostDetails, $connectionParams, LoggerInterface $lo } $this->guzzle = $connectionParams['guzzleClient']; + unset($connectionParams['guzzleClient']); if (isset($connectionParams['connectionParams'])) { - $this->connectionOpts = $connectionParams['connectionParams']; + $this->connectionParams += $connectionParams['connectionParams']; } - return parent::__construct($hostDetails, $connectionParams, $log, $trace); + parent::__construct($hostDetails, $connectionParams, $log, $trace); } @@ -99,7 +98,7 @@ public function performRequest($method, $uri, $params = null, $body = null, $opt $uri = $this->getURI($uri, $params); - $options += $this->connectionOpts; + $options += $this->connectionParams; $request = $this->buildGuzzleRequest($method, $uri, $body, $options); $response = $this->sendRequest($request, $body);