Guzzle v3.7.0 Release Notes
Release Date: 2013-06-10 // almost 11 years ago-
- โฌ๏ธ See UPGRADING.md for more information on how to upgrade.
- ๐ Requests now support the ability to specify an array of $options when creating a request to more easily modify a request. You can pass a 'request.options' configuration setting to a client to apply default request options to every request created by a client (e.g. default query string variables, headers, curl options, etc.).
- โ Added a static facade class that allows you to use Guzzle with static methods and mount the class to
\Guzzle
. SeeGuzzle\Http\StaticClient::mount
. - โ Added
command.request_options
toGuzzle\Service\Command\AbstractCommand
to pass request options to requests created by a command (e.g. custom headers, query string variables, timeout settings, etc.). - Stream size in
Guzzle\Stream\PhpStreamRequestFactory
will now be set if Content-Length is returned in the headers of a response - โ Added
Guzzle\Common\Collection::setPath($path, $value)
to set a value into an array using a nested key (e.g.$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];
) - ๐ ServiceBuilders now support storing and retrieving arbitrary data
- ๐ CachePlugin can now purge all resources for a given URI
- ๐ CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource
- ๐ CachePlugin now uses the Vary header to determine if a resource is a cache hit
Guzzle\Http\Message\Response
now implements\Serializable
- โ Added
Guzzle\Cache\CacheAdapterFactory::fromCache()
to more easily create cache adapters Guzzle\Service\ClientInterface::execute()
now accepts an array, single command, or Traversable- ๐ Fixed a bug in
Guzzle\Http\Message\Header\Link::addLink()
- ๐ Better handling of calculating the size of a stream in
Guzzle\Stream\Stream
using fstat() and caching the size - ๐ป
Guzzle\Common\Exception\ExceptionCollection
now creates a more readable exception message - ๐ Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older Symfony users can still use the old version of Monolog.
- ๐ Fixing BC break: Added the implementation back in for
Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()
. Now triggering an E_USER_DEPRECATED warning when used. Use$message->getHeader()->parseParams()
. - ๐ Several performance improvements to
Guzzle\Common\Collection
- โ Added an
$options
argument to the end of the following methods ofGuzzle\Http\ClientInterface
: createRequest, head, delete, put, patch, post, options, prepareRequest - โ Added an
$options
argument to the end ofGuzzle\Http\Message\Request\RequestFactoryInterface::createRequest()
- โ Added an
applyOptions()
method toGuzzle\Http\Message\Request\RequestFactoryInterface
- ๐ Changed
Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)
toGuzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())
. You can still pass in a resource, string, or EntityBody into the $options parameter to specify the download location of the response. - ๐ Changed
Guzzle\Common\Collection::__construct($data)
to no longer accepts a null value for$data
but a defaultarray()
- โ Added
Guzzle\Stream\StreamInterface::isRepeatable
- โ Removed
Guzzle\Http\ClientInterface::setDefaultHeaders(). Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')
. or $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. - โ Removed
Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')
. - โ Removed
Guzzle\Http\ClientInterface::expandTemplate()
- โ Removed
Guzzle\Http\ClientInterface::setRequestFactory()
- โ Removed
Guzzle\Http\ClientInterface::getCurlMulti()
- โ Removed
Guzzle\Http\Message\RequestInterface::canCache
- โ Removed
Guzzle\Http\Message\RequestInterface::setIsRedirect
- โ Removed
Guzzle\Http\Message\RequestInterface::isRedirect
- Made
Guzzle\Http\Client::expandTemplate
andgetUriTemplate
protected methods. - ๐ You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting
Guzzle\Common\Version::$emitWarnings
to true. - ๐ Marked
Guzzle\Http\Message\Request::isResponseBodyRepeatable()
as deprecated. Use$request->getResponseBody()->isRepeatable()
instead. - ๐ Marked
Guzzle\Http\Message\Request::canCache()
as deprecated. UseGuzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()
instead. - ๐ Marked
Guzzle\Http\Message\Request::canCache()
as deprecated. UseGuzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()
instead. - ๐ Marked
Guzzle\Http\Message\Request::setIsRedirect()
as deprecated. Use the HistoryPlugin instead. - ๐ Marked
Guzzle\Http\Message\Request::isRedirect()
as deprecated. Use the HistoryPlugin instead. - ๐ Marked
Guzzle\Cache\CacheAdapterFactory::factory()
as deprecated - Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0
- ๐ Marked 'request.params' for
Guzzle\Http\Client
as deprecated. Use [request.options][params]. - ๐ Marked
Guzzle\Service\Client::enableMagicMethods()
as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. - ๐ Marked
Guzzle\Service\Client::getDefaultHeaders()
as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. - ๐ Marked
Guzzle\Service\Client::setDefaultHeaders()
as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. - ๐ Marked
Guzzle\Parser\Url\UrlParser
as deprecated. Just use PHP'sparse_url()
and percent encode your UTF-8. - ๐ Marked
Guzzle\Common\Collection::inject()
as deprecated. - ๐ Marked
Guzzle\Plugin\CurlAuth\CurlAuthPlugin
as deprecated. Use$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');
- 0๏ธโฃ CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a CacheStorageInterface. These two objects and interface will be removed in a future version.
- Always setting X-cache headers on cached responses
- 0๏ธโฃ Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
CacheStorageInterface::cache($key, Response $response, $ttl = null)
has changed tocache(RequestInterface $request, Response $response);
CacheStorageInterface::fetch($key)
has changed tofetch(RequestInterface $request);
CacheStorageInterface::delete($key)
has changed todelete(RequestInterface $request);
- โ Added
CacheStorageInterface::purge($url)
- 0๏ธโฃ
DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin $plugin)
has changed toDefaultRevalidation::__construct(CacheStorageInterface $cache, CanCacheStrategyInterface $canCache = null)
- โ Added
RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)