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

1241 Commits

Author SHA1 Message Date
Michael Dowling
a02c22fcb7 Removing (optional) from docblocks 2012-05-16 00:55:45 -07:00
Michael Dowling
18b6bf284e Updating to latest version of composer 2012-05-15 08:38:38 -07:00
Michael Dowling
f63b853605 Adding an addRequest method to the BatchQueuePlugin. Fixing a docblock for CurlMulti 2012-05-14 22:34:10 -07:00
Michael Dowling
800ac34b5f Trimming up the default User-Agent header and putting entries in order of importance 2012-05-14 21:46:23 -07:00
Michael Dowling
9863ff6a06 Reafactoring Cookie parsing a bit 2012-05-14 21:36:28 -07:00
Michael Dowling
4a7f4870b7 [Http] Moving UriTemplates to Guzzle\Http\Parser\UriTemplate namespace (hoping for a C implementation at some point for PHP). 2012-05-14 13:48:52 -07:00
Michael Dowling
f8e8c0302b Refactoring service builders and service factories
[BC] [Service] Moving Guzzle\Service\Builder to
Guzzle\Service\Builder\ServiceBuilder
[Service] Creating an AbstractFactory used to delegate class
instantiation to a concrete factory. Used with service builders and
service descriptions
[Service] Making service descriptions and builders cacheable
[Service] Adding the ability to set global option overrides to service
builder configs. These options are applied to each service owned by a
service builder.  This can be used to globally specify access keys for
example.
[Service] Adding the ability to include other service builder config
files from within XML and JSON files.
[Service] Changing the format of XML and JSON configs.  Old format still
works too.
[Service] Moving XML service description includes to the end of
execution, so that includes are at the beginning of the parsed array.
[Service] Adding a Guzzle\Service\JsonLoader for loading JSON files that
have an { "includes": [] } array
2012-05-13 23:30:13 -07:00
Michael Dowling
72b8a76b4e Moving getUrlPartsFromMessage from a static method to an abstract class 2012-05-13 14:43:12 -07:00
Michael Dowling
764d935694 Changes to support a Guzzle\Http\Parser namespace
[Common] Adding keySearch method to Collection
[Http] Moving POST curl option logic from EntityEnclosingRequest to the
curl factory method
Directly using the HTTP request object when creating curl handles in the
factory method
No longer adding a read callback when sending POSTs through
CURLOPT_POSTFIELDS
In an effort to mitigate random segfaults and bus errors, using a queue
for removing curl and close handles from a multi object so that they are
only removed when the multi handle has finished sending all requests.
Calling reset() each time a curl multi handle has finished all requests.
EntityEnclosingRequest::getPostFields() now returns a Collection object
Simplifying the EntityEnclosingRequest::getPostFiles method
Adding an array cache to header objects
Moving the header comparison DSL from the Tests namespace to
Guzzle\Http\Message\HeaderComparison, and adding tests.
Adding message, cookie, and url parser interfaces and default
implementations.
Using a parser registry to manage globally registered parsers.  Removing parsing from Response and RequestFactory.
Renaming protocol_version to version
Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args.
Simplifying the chunked encoding handling in RequestFactory
Moving cookie parsing out of the cookie plugin and into Guzzle\Http\Parser\Cookie\CookieParser
Removing regexps from the cookie parser and simply using stripos
Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method.
Adding more logging to node.js test webserver
Adding pecl_http message parser.
Installing pecl when travis boots up
2012-05-13 01:23:32 -07:00
Michael Dowling
82d483d0e8 [Service] Inspector can be injected into a Command object 2012-05-12 00:42:07 -07:00
Michael Dowling
dc4c2d089b Getting rid of Guzzle\Common\Guzzle
Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject
Adding Guzzle\Version class to give version information
Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and
getHttpDate()
Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data
2012-05-12 00:28:36 -07:00
Michael Dowling
ff6cd9e5c0 Moving Guzzle\Guzzle to Guzzle\Common\Guzzle 2012-05-11 22:20:41 -07:00
Michael Dowling
4fa45e6816 Changing else if to elseif 2012-05-11 21:04:42 -07:00
Michael Dowling
4749e67cff Fixing a bug with iterators when no command options are specified 2012-05-11 17:26:18 -07:00
Michael Dowling
dd975e6a76 Fixing a bug in the service builder when using json configs and no class attribute is specified. 2012-05-11 17:21:23 -07:00
Michael Dowling
776818c90e [Service] Adding a setOnComplete method to commands that is used to specify a callable that is called when a command completes. This callable can also be specified in the command.on_complete option of a command in the constructor. 2012-05-10 22:26:50 -07:00
Michael Dowling
bf36281fcb Fixing broken test 2012-05-09 15:11:37 -07:00
Michael Dowling
2a10ffca92 Trying to fix failing Travis test 2012-05-09 14:43:44 -07:00
Michael Dowling
666e0439c3 [Service] Moving resource iterator classes to Guzzle\Service\Resource.
Adding ResourceIteratorFactoryInterface with a class name resolution
implementation.  Adding a resource iterator factory to
Guzzle\Service\Client and adding a getIterator method to make it easy to
retrieve iterators from the client.
2012-05-09 14:07:55 -07:00
Michael Dowling
bf1fd13ac0 Merge branch 'execute_command_returns_result' 2012-05-09 09:11:55 -07:00
Michael Dowling
b29c7adc51 [Service] Adding a ResourceIteratorInterface. Adding get() and set()
methods for easy manipulation of resource iterator data options.  Adding
setLimit() and setPageSize() methods to resource iterators.  Fixing a
bug in the resource iterator that caused endless iteration if a result
is fetched with no resources returned from the sendRequest method.
2012-05-08 21:25:11 -07:00
Michael Dowling
5ff7456cc0 [Service] Adding an 'array' type validator
[Tests] Returning the mock plugin created by calling $this->setMockResponse()
2012-05-08 17:23:32 -07:00
Michael Dowling
a9f3ad89b4 [Http] Keeping track of mocked requests in the MockPlugin (similar to
the test server)
[Service] More broadly attempting to marshal XML and JSON results
2012-05-08 16:05:05 -07:00
Michael Dowling
f5a9e9bf82 [Service] Allowing commands to be sent more than once through a client
Allowing cloned commands that have previously been sent to be sent again.
Redesigning the ResourceIterator class so that it accepts a command and iterates over the command until the sendRequest() method returns an empty array.
Adding the name of the parameter that received a type validation error to Inpector error messages
2012-05-08 14:28:45 -07:00
Michael Dowling
5903347648 [Service] BC: Executing a command returns the command result rather than the command object 2012-05-08 09:37:03 -07:00
Michael Dowling
63100af1ff Adding a NullCacheAdapter
Returning a NullCacheAdapter from the CacheAdapterFactory if no cache.adapter is provided
Changing DescriptionBuilders to not be static method classes
Adding ServiceDescriptionFactory and making service descriptions cachable
2012-05-07 23:32:42 -07:00
Michael Dowling
a32e6c098d [Service] Adding a Serializable interface to ServiceDescriptions. Adding a ServiceDescription interface. 2012-05-07 21:25:47 -07:00
Michael Dowling
023662e5c2 Fixing typo and fixing type tests 2012-05-06 23:26:56 -07:00
Michael Dowling
0c51598851 [Common] Optimizing configuration injection. No longer supporting the {{}} format for configuration injection. You must use {} from now on. 2012-05-06 23:16:16 -07:00
Michael Dowling
ead1c418f8 Adding tests for ApiParam 2012-05-06 21:22:19 -07:00
Michael Dowling
3f67ee6678 [Service] Using an ApiParam object for parameters instead of a Collection object 2012-05-06 20:49:37 -07:00
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
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
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
Gordon Franke
ee4529d4b6 add test for invalid json response 2012-04-25 08:51:23 +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
2012-04-23 17:54:02 -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