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
54cad6a0
Commit
54cad6a0
authored
Aug 25, 2018
by
Jeroen Steggink
Committed by
Markus Kalkbrenner
Aug 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PUT request (#629)
* PUT request * Updated CHANGELOG.md
parent
e116146d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
0 deletions
+19
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
src/Core/Client/Adapter/Curl.php
src/Core/Client/Adapter/Curl.php
+2
-0
src/Core/Client/Adapter/PeclHttp.php
src/Core/Client/Adapter/PeclHttp.php
+3
-0
src/Core/Client/Adapter/Zend2Http.php
src/Core/Client/Adapter/Zend2Http.php
+4
-0
src/Core/Client/Adapter/ZendHttp.php
src/Core/Client/Adapter/ZendHttp.php
+4
-0
src/Core/Client/Request.php
src/Core/Client/Request.php
+5
-0
No files found.
CHANGELOG.md
View file @
54cad6a0
...
...
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [master]
### Added
-
Basic support for PUT requests in the HttpAdapter layer
### Changed
...
...
src/Core/Client/Adapter/Curl.php
View file @
54cad6a0
...
...
@@ -132,6 +132,8 @@ class Curl extends Configurable implements AdapterInterface
curl_setopt
(
$handler
,
CURLOPT_CUSTOMREQUEST
,
'HEAD'
);
}
elseif
(
Request
::
METHOD_DELETE
==
$method
)
{
curl_setopt
(
$handler
,
CURLOPT_CUSTOMREQUEST
,
'DELETE'
);
}
elseif
(
Request
::
METHOD_PUT
==
$method
)
{
curl_setopt
(
$handler
,
CURLOPT_CUSTOMREQUEST
,
'PUT'
);
}
else
{
throw
new
InvalidArgumentException
(
"unsupported method:
$method
"
);
}
...
...
src/Core/Client/Adapter/PeclHttp.php
View file @
54cad6a0
...
...
@@ -109,6 +109,9 @@ class PeclHttp extends Configurable implements AdapterInterface
case
Request
::
METHOD_DELETE
:
$method
=
HTTP_METH_DELETE
;
break
;
case
Request
::
METHOD_PUT
:
$method
=
HTTP_METH_PUT
;
break
;
default
:
throw
new
InvalidArgumentException
(
'Unsupported method: '
.
$request
->
getMethod
()
...
...
src/Core/Client/Adapter/Zend2Http.php
View file @
54cad6a0
...
...
@@ -158,6 +158,10 @@ class Zend2Http extends Configurable implements AdapterInterface
$client
->
setMethod
(
'DELETE'
);
$client
->
setParameterGet
(
$request
->
getParams
());
break
;
case
Request
::
METHOD_PUT
:
$client
->
setMethod
(
'PUT'
);
$client
->
setParameterGet
(
$request
->
getParams
());
break
;
default
:
throw
new
OutOfBoundsException
(
'Unsupported method: '
.
$request
->
getMethod
());
break
;
...
...
src/Core/Client/Adapter/ZendHttp.php
View file @
54cad6a0
...
...
@@ -159,6 +159,10 @@ class ZendHttp extends Configurable implements AdapterInterface
$client
->
setMethod
(
\Zend_Http_Client
::
DELETE
);
$client
->
setParameterGet
(
$request
->
getParams
());
break
;
case
Request
::
METHOD_PUT
:
$client
->
setMethod
(
\Zend_Http_Client
::
PUT
);
$client
->
setParameterGet
(
$request
->
getParams
());
break
;
default
:
throw
new
OutOfBoundsException
(
'Unsupported method: '
.
$request
->
getMethod
());
break
;
...
...
src/Core/Client/Request.php
View file @
54cad6a0
...
...
@@ -34,6 +34,11 @@ class Request extends Configurable implements RequestParamsInterface
*/
const
METHOD_DELETE
=
'DELETE'
;
/**
* Request PUT method.
*/
const
METHOD_PUT
=
'PUT'
;
/**
* Default options.
*
...
...
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