Releases: guzzle/guzzle
Releases · guzzle/guzzle
5.0.0 release
Adding support for non-blocking responses and some minor API cleanup.
New Features
- Added support for non-blocking responses based on
guzzlehttp/guzzle-ring
. - Added a public API for creating a default HTTP adapter.
- Updated the redirect plugin to be non-blocking so that redirects are sent
concurrently. Other plugins like this can now be updated to be non-blocking. - Added a "progress" event so that you can get upload and download progress
events. - Added
GuzzleHttp\Pool
which implements FutureInterface and transfers
requests concurrently using a capped pool size as efficiently as possible. - Added
hasListeners()
to EmitterInterface. - Removed
GuzzleHttp\ClientInterface::sendAll
and marked
GuzzleHttp\Client::sendAll
as deprecated (it's still there, just not the
recommended way).
Breaking changes
The breaking changes in this release are relatively minor. The biggest thing to
look out for is that request and response objects no longer implement fluent
interfaces.
- Removed the fluent interfaces (i.e.,
return $this
) from requests,
responses,GuzzleHttp\Collection
,GuzzleHttp\Url
,
GuzzleHttp\Query
,GuzzleHttp\Post\PostBody
, and
GuzzleHttp\Cookie\SetCookie
. This blog post provides a good outline of
why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/.
This also makes the Guzzle message interfaces compatible with the current
PSR-7 message proposal. - Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except
for the HTTP request functions from function.php, these functions are now
implemented inGuzzleHttp\Utils
using camelCase.GuzzleHttp\json_decode
moved toGuzzleHttp\Utils::jsonDecode
.GuzzleHttp\get_path
moved to
GuzzleHttp\Utils::getPath
.GuzzleHttp\set_path
moved to
GuzzleHttp\Utils::setPath
.GuzzleHttp\batch
should now be
GuzzleHttp\Pool::batch
, which returns anSplObjectStorage
. Using functions.php
caused problems for many users: they aren't PSR-4 compliant, require an
explicit include, and needed an if-guard to ensure that the functions are not
declared multiple times. - Rewrote adapter layer.
- Removing all classes from
GuzzleHttp\Adapter
, these are now
implemented as callables that are stored inGuzzleHttp\Ring\Client
. - Removed the concept of "parallel adapters". Sending requests serially or
concurrently is now handled using a single adapter. - Moved
GuzzleHttp\Adapter\Transaction
toGuzzleHttp\Transaction
. The
Transaction object now exposes the request, response, and client as public
properties. The getters and setters have been removed.
- Removing all classes from
- Removed the "headers" event. This event was only useful for changing the
body a response once the headers of the response were known. You can implement
a similar behavior in a number of ways. One example might be to use a
FnStream that has access to the transaction being sent. For example, when the
first byte is written, you could check if the response headers match your
expectations, and if so, change the actual stream body that is being
written to. - Removed the
asArray
parameter from
GuzzleHttp\Message\MessageInterface::getHeader
. If you want to get a header
value as an array, then use the newly addedgetHeaderAsArray()
method of
MessageInterface
. This change makes the Guzzle interfaces compatible with
the PSR-7 interfaces. GuzzleHttp\Message\MessageFactory
no longer allows subclasses to add
custom request options using double-dispatch (this was an implementation
detail). Instead, you should now provide an associative array to the
constructor which is a mapping of the request option name mapping to a
function that applies the option value to a request.- Removed the concept of "throwImmediately" from exceptions and error events.
This control mechanism was used to stop a transfer of concurrent requests
from completing. This can now be handled by throwing the exception or by
cancelling a pool of requests or each outstanding future request individually. - Updated to "GuzzleHttp\Streams" 3.0.
GuzzleHttp\Stream\StreamInterface::getContents()
no longer accepts a
maxLen
parameter. This update makes the Guzzle streams project
compatible with the current PSR-7 proposal.GuzzleHttp\Stream\Stream::__construct
,
GuzzleHttp\Stream\Stream::factory
, and
GuzzleHttp\Stream\Utils::create
no longer accept a size in the second
argument. They now accept an associative array of options, including the
"size" key and "metadata" key which can be used to provide custom metadata.
4.2.3
4.2.2
4.2.1
3.8.1
- Bug: Always using GET requests when redirecting from a 303 response
- Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting
$certificateAuthority
to false in
Guzzle\Http\ClientInterface::setSslVerification()
- Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL
- Bug: The body of a request can now be set to
"0"
- Sending PHP stream requests no longer forces
HTTP/1.0
- Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of
each sub-exception - Updated the
$ref
attribute in service descriptions to merge over any existing parameters of a schema (rather than
clobbering everything). - Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators)
- Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling
=
.
For examplefoo&bar=baz
is now correctly parsed and recognized asfoo&bar=baz
rather thanfoo=&bar=baz
. - Now properly escaping the regular expression delimiter when matching Cookie domains.
- Network access is now disabled when loading XML documents
3.8.0
- Added the ability to define a POST name for a file
- JSON response parsing now properly walks additionalProperties
- cURL error code 18 is now retried automatically in the BackoffPlugin
- Fixed a cURL error when URLs contain fragments
- Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were
CurlExceptions - CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e)
- Added the ability for Guzzle to work with older versions of cURL that do not support
CURLOPT_TIMEOUT_MS
- Fixed a bug that was encountered when parsing empty header parameters
- UriTemplate now has a
setRegex()
method to match the docs - The
debug
request parameter now checks if it is truthy rather than if it exists - Setting the
debug
request parameter to true shows verbose cURL output instead of using the LogPlugin - Added the ability to combine URLs using strict RFC 3986 compliance
- Command objects can now return the validation errors encountered by the command
- Various fixes to cache revalidation (#437 and 29797e5)
- Various fixes to the AsyncPlugin
- Cleaned up build scripts
3.7.4
- Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430)
- Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp (see aws/aws-sdk-php#147)
- Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots
- Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420)
Updated the bundled cacert.pem (#419) - OauthPlugin now supports adding authentication to headers or query string (#425)