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. See Guzzle\Http\StaticClient::mount.
    • โž• Added command.request_options to Guzzle\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 of Guzzle\Http\ClientInterface: createRequest, head, delete, put, patch, post, options, prepareRequest
    • โž• Added an $options argument to the end of Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()
    • โž• Added an applyOptions() method to Guzzle\Http\Message\Request\RequestFactoryInterface
    • ๐Ÿ”„ Changed Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null) to Guzzle\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 default array()
    • โž• 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 and getUriTemplate 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. Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest() instead.
    • ๐Ÿ—„ Marked Guzzle\Http\Message\Request::canCache() as deprecated. Use Guzzle\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's parse_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 to cache(RequestInterface $request, Response $response);
    • CacheStorageInterface::fetch($key) has changed to fetch(RequestInterface $request);
    • CacheStorageInterface::delete($key) has changed to delete(RequestInterface $request);
    • โž• Added CacheStorageInterface::purge($url)
    • 0๏ธโƒฃ DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin $plugin) has changed to DefaultRevalidation::__construct(CacheStorageInterface $cache, CanCacheStrategyInterface $canCache = null)
    • โž• Added RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)