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
448f5ecc
Commit
448f5ecc
authored
Nov 17, 2011
by
Gasol Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor toHttpRequest
parent
fe33751c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
library/Solarium/Client/Adapter/PeclHttp.php
library/Solarium/Client/Adapter/PeclHttp.php
+4
-5
No files found.
library/Solarium/Client/Adapter/PeclHttp.php
View file @
448f5ecc
...
...
@@ -131,6 +131,7 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
protected
function
toHttpRequest
(
$request
)
{
$url
=
$this
->
getBaseUri
()
.
$request
->
getUri
();
$httpRequest
=
new
HttpRequest
(
$url
);
switch
(
$request
->
getMethod
())
{
case
Solarium_Client_Request
::
METHOD_GET
:
...
...
@@ -138,6 +139,7 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
break
;
case
Solarium_Client_Request
::
METHOD_POST
:
$method
=
HTTP_METH_POST
;
$httpRequest
->
setBody
(
$request
->
getRawData
());
break
;
case
Solarium_Client_Request
::
METHOD_HEAD
:
$method
=
HTTP_METH_HEAD
;
...
...
@@ -148,12 +150,9 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
);
}
$httpRequest
->
setMethod
(
$method
);
$options
=
$this
->
_createOptions
(
$request
);
$httpRequest
=
new
HttpRequest
(
$url
,
$method
,
$options
);
if
(
HTTP_METH_POST
==
$httpRequest
->
getMethod
())
{
$httpRequest
->
setBody
(
$request
->
getRawData
());
}
$httpRequest
->
setOptions
(
$options
);
return
$httpRequest
;
}
...
...
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