Skip to content

Commit

Permalink
GuzzleConnection should reuse AbstractConnection's $connectionParams
Browse files Browse the repository at this point in the history
$connectionOpts is redundant with $connectionParams, and interferes with functionality
in some cases
  • Loading branch information
polyfractal committed Jan 13, 2015
1 parent 06fb3f3 commit 49377f8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Elasticsearch/Connections/GuzzleConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class GuzzleConnection extends AbstractConnection implements ConnectionInterface
/** @var Client */
private $guzzle;

private $connectionOpts = array();

private $lastRequest = array();


Expand Down Expand Up @@ -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);

}

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 49377f8

Please sign in to comment.