1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 18:43:22 +01:00

384 Commits

Author SHA1 Message Date
Michael Dowling
dd7c8b6b35 Lots of refactoring for *greatly* improved performance (4-5x faster)
[Http] cache.* parameters should be prefixed with 'params.' now.

Adding the ability to set arbitrary curl options that don't map to constants (disable_wire, progress, etc)

Added a check to the CurlMulti object that prevents sending a request when the curl multi resource has been destroyed.  This could possibly happen when issuing requests from a destructor.

Adding the ability to disable type validation of configuration options

Adding a cache for all requests owned by a curl multi object

Creating the polling event external to the main CurlMulti loop

Hardening the CurlMulti class so that curl handles that are finished sending are removed from the multi handle.  Adding validation test

[Common] BC: Simplifying Guzzle\Common\Collection so that it is more performant.

[Service] Adding the ability to disable validation on the Inpector class.  Disabling validation on first instantiating commands so that defaults are added but nothing is check until attempting to execute a command.

Using class properties instead of a Collection for ApiCommand

BC: Using a custom validation system that allows a flyweight
implementation for much faster validation. No longer using Symfony2
Validation component.
2012-05-06 19:08:28 -07:00
Michael Dowling
23d53768d1 Merge pull request #46 from missinglink/master
Fixing instances of HttpException since it was changed from a class to an interface
2012-05-05 11:29:23 -07:00
Peter Johnson
48c5668a86 Reverted test to type hint interfaces 2012-05-03 11:04:48 +01:00
Peter Johnson
3f9dfdb267 Renamed generic runtime exceptions to guzzle exceptions 2012-05-03 11:02:39 +01:00
Peter Johnson
1ca5bc54de Fixing instances of HttpException since it was changed from a class to an interface 2012-05-02 23:29:31 +01:00
Michael Dowling
b66489c29d [Http] Fixing a bug in the CurlMulti object that changed the state of the object to idle when a higher scope completed, rather than wait for lower scopes to complete. Moving the retry count of a request in the exponential backoff plugin to the request params object. Rewinding request streams when retrying requests. Using microtime when dealing with exponential backoff checks so that more granular backoff strategies can be utilized. 2012-05-02 12:51:16 -07:00
Michael Dowling
885cda1a8d Fixing OauthPlugin tests. Adding test to cover the new fragment conditional used when building urls. 2012-05-01 22:56:36 -07:00
Donald White
1bc145df02 Fixes Nonce Generation issue. Multiple Requests with the exact same timestamp were using the same nonce. 2012-05-01 22:23:38 -07:00
Donald White
32e56eea85 Fixes a defect that always adds a hashtag (#) to every url. 2012-05-01 22:23:38 -07:00
Michael Dowling
7d72896e6c [Service] Emitting an event each time a client is created through a ServiceBuilder. Closes #44 2012-05-01 22:18:02 -07:00
Michael Dowling
687b04caff [Service] Moving magic method call behavior constants to Guzzle\Service\ClientInterface. Adding magic method call behvaior to Guzzle\Service\Command\AbstractCommand similar to the magic method call behavior of Client objects. When magic method calls are enabled on a client object, they become enabled on commands created by the client. $command->setFoo("x") is the same as $command->set("foo", "x") when magic method calls are enabled. 2012-05-01 10:51:42 -07:00
Michael Dowling
ac0d806613 [Http] Making it so that if a custom callback function used to determine if a request should be retried using exponential backoff returns null that the exponential backoff plugin will do the default checks to see if a request should be retried. 2012-04-25 14:15:38 -07:00
Michael Dowling
fb5cd2dc42 Adding JsonException to ignored code coverage files 2012-04-25 00:30:14 -07:00
Gordon Franke
ee4529d4b6 add test for invalid json response 2012-04-25 08:51:23 +02:00
Gordon Franke
ada6cc3dba add exception when the response body can not be decoded 2012-04-25 08:41:55 +02:00
Michael Dowling
19566ce334 [Http] Adding the ability to pass shared parameters to all requests created by a client by prefixing a configuration property with 'params.'
Moving cURL transfer stderr logic from the CurlMulti class and on to the CurlHandle class
Adding a fix for 'too many open files' that will allow the proper exception to be thrown when this occurs by ensuring that the exception is autoloaded before you run into the issue.
Cleaning up some CurlMulti error checking and adding the ability to allow a request to continue to be sent even after a curl transfer error occurs.
Adding the option to pass in a callable function to the ExponentialBackoffPlugin that determines whether or not a request failed and should be retried.  Adding a method to return a default array of failure codes and curl error numbers.
Adding the ability to retry specific curl handle transfer errors with the ExponentialBackoffPlugin
2012-04-24 18:22:20 -07:00
Michael Dowling
b1570da70c Fixing request parser so that lines are normalized. 2012-04-23 19:07:49 -07:00
Michael Dowling
f5ee3fb453 [Http] Ensuring that cURL blacklisted headers are never set even if they are set by the user.
[Http] Error responses are now never written to the intended response stream of a request, but rather to a temporary stream.  This helps when retrying failed requests so that the intended stream is not polluted with transient errors.
[Http] Adding the ability to retry failed requests with the exponential backoff plugin by checking both the status code and reason phrase.
[Service] Simplifying the loop in Guzzle\Service\Command\DynamicCommand
v2.4.1
2012-04-23 17:54:02 -07:00
Michael Dowling
cc7c7f42ac Bumping the version number v2.4.0 2012-04-22 14:44:37 -07:00
Michael Dowling
5e58f4bf05 [Http] Adding a mediator object between curl and requests. This should speed up curl requests due to reduction in anonymous function creation.
[Http] Using a factory method when creating bad response exceptions.  Adding ClientErrorResponseException and ServerErrorResponseException.
[Http] Removing curl specific protocal version code from RequestInterace and pushing it to the curl namespace
[Http] Renaming parseUrlUtf8 to parseUrl and fixing a typo
2012-04-22 14:23:23 -07:00
Michael Dowling
c0dc85de35 Breaking / Potentially breaking changes:
1. Adopting a marker interface for Guzzle exceptions.
        A. All exceptions emitted from Guzzle are now wrapped with a Guzzle namespaced exception.
        B. Guzzle\Common\GuzzleExceptionInterface was renamed to Guzzle\Common\GuzzleException
        C. Guzzle\Common\ExceptionCollection was renamed to Guzzle\Common\Exception\ExceptionCollection
    2. Using Header objects for Request and Response objects
        A. When you call $request->getHeader('X'), you will get back a Guzzle\Http\Message\Header object that contains all of the headers that case insensitively match.  This object can be cast to a string or iterated like an array.  You can pass true in the second argument to retrieve the header as a string.
        B. Removing the old Guzzle\Common\Collection based searching arguments from most of the request and response header methods.  All retrievals are case-insensitive and return Header objects.
    3. Changing the two headers added by the cache plugin to just one header with key and ttl.
    4. Changing Guzzle\Http\Message\Response::factory() to fromMessage().
    5. Removing the NullObject return value from ServiceDescriptions and instead simply returning null

New Features / enhancements:

    1. Adding Guzzle\Http\Message\AbstractMessage::addHeaders()
    2. Making it simpler to create service descriptions using a unified factory method that delegates to other factories.
    3. Better handling of ports and hosts in Guzzle\Http\Url

Note: This is a noisy diff because I'm removing trailing whitespace and adding a new line at the end of each source file.
2012-04-22 00:17:49 -07:00
Michael Dowling
cbf125fd0f [Service] Using the Serializable interface on Guzzle\Service\ServiceBuilder. Closes #41 2012-04-20 21:47:03 -07:00
Michael Dowling
72a86e86c9 Fixing broken Inspector tests 2012-04-20 17:30:39 -07:00
Michael Dowling
668ef3fe35 Renaming black_list to blacklist 2012-04-20 17:22:15 -07:00
Michael Dowling
503df1835f [Http] Correcting the version reported in the User-Agent header. Shortening the User-Agent header.
Adding a way to black list cURL options and cURL specific headers from being set or sent over the wire.
2012-04-20 17:18:21 -07:00
Michael Dowling
2be94b1981 [Http] Adding support for UTF-8 characters in query strings when parsing URLs 2012-04-20 00:31:07 -07:00
Michael Dowling
c1b29eb062 [Http] Adding the ability to retrieve a URL object from a request. Adding a method to normalize relative paths in URLs. 2012-04-19 21:47:24 -07:00
Michael Dowling
5ec879144d [Http] Using case insensitive matching by default when dealing with headers in HTTP messages.
Adding normalized behavior to Guzzle\Http\Message\AbstractMessage::getHeader() so that it returns an array of headers if multiple header values are found for a specific header key.  It will return a single string if only one header is found.
Updating curl handle to work with multiple headers per key
2012-04-19 16:14:58 -07:00
Michael Dowling
a8089fdc5e [Common] Adding a "cache." prefix to cache settings 2012-04-18 17:16:39 -07:00
Michael Dowling
6191c4f766 [Common] Adding a CacheAdapterFactory so that you can generate cache adapters in your service config files 2012-04-18 16:56:58 -07:00
Michael Dowling
04d858044a [Http] Adding much more error handling to CurlMulti and providing informative error messages 2012-04-18 11:10:38 -07:00
Michael Dowling
0b98e6c46e Adding more late static binding where it makes sense so that things can be easily extended 2012-04-18 08:31:37 -07:00
Michael Dowling
b1beeb68d8 One more time trying to fix the timeout test... 2012-04-17 17:48:55 -07:00
Michael Dowling
e9fa0907bb Using late static binding for the service builder factory method. Closes #40 2012-04-17 17:23:16 -07:00
Michael Dowling
f57169a2d6 Updating to the latest version of composer so that Guzzle uses require-dev and --dev configuration options v2.3.2 2012-04-16 15:13:53 -07:00
Michael Dowling
ce221dfbbe Fixing composer.json 2012-04-16 14:53:42 -07:00
Michael Dowling
8ce1fbed17 Fixing CurlHandleTest to timeout more consistently 2012-04-16 12:37:40 -07:00
Michael Dowling
02f9785f93 [Service] Adding an AliasFactory for aliasing one command name to another. Updating README for new composer setup. Making the build script more generalized. 2012-04-15 12:00:12 -07:00
Michael Dowling
aa1136dd73 Removing code coverage from test runs because I think travis is running out of memory v2.3.1 2012-04-15 00:15:13 -07:00
Michael Dowling
d29e7f3bba [Service] Adding command factories to Guzzle\Service\Client. Gives the ability to add custom handling for associating command names with concrete classes.
Removing command factories from Guzzle\Service\Description\ServiceDescription.  Use Guzzle\Service\Command\Factory\ServiceDescriptionFactory instead.
Setting a service description on a client will update any attached service description factories.
2012-04-15 00:07:45 -07:00
Michael Dowling
e37668e91e Fixing include path issue with ZF1 v2.3.0 2012-04-14 19:04:37 -07:00
Michael Dowling
eabe684b22 [Common] [BC] Renaming ZendLogAdapter to Zf1LogAdater. Adding a Zf2LogAdapter. Renaming ZendCacheAdapter to Zf1CacheAdapter. Adding Zf2CacheAdapter to support Zend Framework 2 caching.
Updating the cache interface to allow passing options to cache methods.
Removing the constructor and removing getCachedObject from CacheAdapterInterface.
Adding a ClosureCacheAdapter.
[Service] Adding the ability to use magic call method behavior for executing commands by name.  Closes #39.
[Tests] Fixing a logging unit test so that it does not spit out to stdout
Separating test dependencies from Guzzle deps by adding a composer-test.json.
Adding unit testing capabilities to the Guzzle phar files.
Updating travis-ci script to use new composer file and adding code coverage to travis runs
[Build] Fixing guzzle-min.phar warning that tried to load index.php
Adding a test-init phing target to help getting setup for testing.
Fixing composer run in travis
2012-04-14 18:49:51 -07:00
Michael Dowling
5ad66ff4d1 [Http] Adding the ability to disable the Expect: 100-Continue header from being sent. Simply remove the "Expect" header from a request before sending. You can remove the Expect header from all requests sent from a client by adding an event listener to a client. Closes #35.
Adding the ability to set HTTP request headers to NULL so that they are still passed to curl.  This is useful for removing some default curl headers.  Empty headers are still not sent to curl.

Not setting "Expect: 100-Continue" when sending with application/x-www-form-urlencoded POST requests
v2.2.4
2012-04-02 17:27:37 -05:00
Michael Dowling
f9a55755a3 Cleaning up the RequestFactory 2012-03-29 13:01:13 -05:00
Michael Dowling
729b346685 Fixing .travis.yml
Commenting out PATCH test that is not working on travis
2012-03-26 23:01:18 -05:00
Michael Dowling
0f9ca9bec8 Fixing composer.json 2012-03-26 21:44:42 -05:00
Michael Dowling
c990901dd3 [BC] Removing prepareRequest() from client interface and making it a protected method of the client
Adding a RequestFactoryInterface and a way to inject a request factory into a Client object
2012-03-26 21:16:19 -05:00
Michael Dowling
85803bdd05 Adding the ability to set default HTTP headers that will be set on all requests created by a client. Closes #37. 2012-03-25 22:23:47 -05:00
Michael Dowling
a68cdd5ebc Merge pull request #36 from stil/patch-2
Ensuring curl specific options are strings before checking to see if they are defined constants
2012-03-25 17:40:39 -07:00
stil
7743386cf4 Update src/Guzzle/Http/Client.php 2012-03-26 02:10:51 +03:00