Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
6da31abc
Commit
6da31abc
authored
Mar 30, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed a bug in the ZendHttp adapter
- added set/get adapteroptions methods to client
parent
4862e4d7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
+38
-3
library/Solarium/Client.php
library/Solarium/Client.php
+26
-0
library/Solarium/Client/Adapter/ZendHttp.php
library/Solarium/Client/Adapter/ZendHttp.php
+12
-3
No files found.
library/Solarium/Client.php
View file @
6da31abc
...
@@ -283,6 +283,32 @@ class Solarium_Client extends Solarium_Configurable
...
@@ -283,6 +283,32 @@ class Solarium_Client extends Solarium_Configurable
return
$this
->
_adapter
;
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
* Execute a ping query
*
*
...
...
library/Solarium/Client/Adapter/ZendHttp.php
View file @
6da31abc
...
@@ -77,9 +77,18 @@ class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter_Http
...
@@ -77,9 +77,18 @@ class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter_Http
{
{
parent
::
setOptions
(
$options
);
parent
::
setOptions
(
$options
);
if
(
null
!==
$this
->
_zendHttp
// forward options to zendHttp instance
&&
isset
(
$this
->
_options
[
'adapteroptions'
]))
{
if
(
null
!==
$this
->
_zendHttp
)
{
$this
->
_zendHttp
->
setOptions
(
$this
->
_options
[
'adapteroptions'
]);
// 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
;
return
$this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment