Commit 6da31abc authored by Bas de Nooijer's avatar Bas de Nooijer

- fixed a bug in the ZendHttp adapter

- added set/get adapteroptions methods to client
parent 4862e4d7
......@@ -283,6 +283,32 @@ class Solarium_Client extends Solarium_Configurable
return $this->_adapter;
}
/**
* Set adapter options
*
* @param array|object $options
* @return Solarium_Client Provides fluent interface
*/
public function setAdapterOptions($options)
{
// covert config object into an array if needed
if (is_object($options)) {
$options = $options->toArray();
}
return $this->_setOption('adapteroptions', $options);
}
/**
* Get adapteroptions
*
* @return array
*/
public function getAdapterOptions()
{
return $this->getOption('adapteroptions');
}
/**
* Execute a ping query
*
......
......@@ -77,9 +77,18 @@ class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter_Http
{
parent::setOptions($options);
if (null !== $this->_zendHttp
&& isset($this->_options['adapteroptions'])) {
$this->_zendHttp->setOptions($this->_options['adapteroptions']);
// forward options to zendHttp instance
if (null !== $this->_zendHttp) {
// forward timeout setting
$this->_zendHttp->setConfig(
array('timeout' => $this->getOption('timeout'))
);
// forward adapter options if available
if( isset($this->_options['adapteroptions'])) {
$this->_zendHttp->setConfig($this->_options['adapteroptions']);
}
}
return $this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment