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

1101 Commits

Author SHA1 Message Date
Michael Dowling
58310521b6 Adding client tests 2015-03-21 23:33:02 -07:00
Michael Dowling
f22fefeaea More functionality to MockHandler 2015-03-21 22:52:06 -07:00
Michael Dowling
af5602945d Test coverage 2015-03-21 22:40:21 -07:00
Michael Dowling
fd39fbbca3 Simplifying multipart post file input 2015-03-21 22:28:50 -07:00
Michael Dowling
8f79355c5e Removing get_ prefix 2015-03-21 22:16:16 -07:00
Michael Dowling
035c8a1774 Removing the option to not hydrate test server responses 2015-03-21 19:25:09 -07:00
Michael Dowling
4facbb2583 Removing set_path/get_path 2015-03-21 19:00:34 -07:00
Michael Dowling
acb33e0731 Cleaning up test server and starting on ClientTest 2015-03-21 17:10:17 -07:00
Michael Dowling
ab1ef88b4c Finishing off remaining pool test 2015-03-21 16:16:49 -07:00
Michael Dowling
af06584ec4 Adding functions.php tests 2015-03-21 16:14:23 -07:00
Michael Dowling
46abe49257 Refactoring 2015-03-21 15:53:38 -07:00
Michael Dowling
6386296592 Cleaning up Pool and test server 2015-03-21 15:33:30 -07:00
Michael Dowling
5129164be7 Lots of refactoring and updates 2015-03-20 00:21:42 -07:00
Michael Dowling
fd52370dd7 Updating for PSR7 changes and promise changes 2015-03-15 23:08:26 -07:00
Michael Dowling
9c9a4cdd71 Backwards compat updates 2015-03-03 14:02:24 -08:00
Michael Dowling
99125ec94d Adding batching and multipart tests 2015-02-26 16:43:45 -08:00
Michael Dowling
b08fc28944 Adding pool tests 2015-02-25 22:49:50 -08:00
Michael Dowling
1a9ad6b553 WIP refactor for PSR-7 2015-02-25 14:50:44 -08:00
Michael Dowling
e38282adb2 Simplifying request sending.
- Removing some duplication
- Nested futures are now resolved in the client.
- Simplified injecting in futures in request events and removing now
  extraneous conditional.
2015-01-23 17:07:13 -08:00
Michael Dowling
8edf6d2bbc Updated the RequestFSM to use gotos.
- This commit updates the request FSM to use goto statements to reduce
  function call overhead and removes 5 stack frames from each request.
- Removed `$finalState` from RequestFSM::__invoke
- Finishing FSM transitions is not handled in the FSM rather than the
  RingBridge.
- Slightly related to #964
2015-01-23 10:57:12 -08:00
Michael Dowling
14f66ae8fd URI template arrays always require a list of two elements. Closes #956 2015-01-11 15:52:51 -08:00
Michael Dowling
d86e62bee6 Removing extra check because PHP is broken 2015-01-11 14:23:16 -08:00
Michael Dowling
5f0c9f04cc Adding the ability to limit which redirect protocols are allowed. Closes #841 2014-12-19 12:22:50 -08:00
Michael Dowling
cd167aab57 Merge branch 'nested_futures' 2014-12-19 11:02:55 -08:00
Michael Dowling
e3182afcda Waiting on deep futuress when necessary to deal with retries.
This commit updates the request FSM to resolve deep futures to
ensure that retried synchronous requests are waited on correctly
and produce side-effects when expected. Previously the results of a
retried request were not being properly brought up to the outermost
layer when a client was attempting to dereference a future because the
request was not a future request.
Adding a way to get the number of retries to events
2014-12-19 10:59:24 -08:00
Liam O'Boyle
b2781f7537 Allow dynamic pool sizing.
Allows the number of requests allowed in a pool to vary over time by
retrieving the current pool size from a callback instead of a single
constant number.

This allows us to amend the number of requests ongoing according to our
needs, e.g. by responding to rate limiting information provided by an
upstream API.

Changes are

* Allow a callback to be passed in to specify the pool size instead of a
  constant pool size.
* As each request returns, add enough new requests to the queue to fill
  up to the current pool size limit.
2014-12-16 08:10:08 +11:00
Michael Dowling
8c931e3725 Setting a request option to null will ensure it is not set.
This commit makes it so that setting a request option to null will
ensure that the option is not set by the single request or as a result
of merging in default client settings (like being able to override proxy
on a one-off basis).
2014-12-09 17:06:35 -08:00
Michael Dowling
670220f70c Not forcing typehint and adding test to ensure URL and query string can be customized 2014-12-09 11:31:02 -08:00
Jamie Hannaford
914dac90ac Allow "0" (and any other falsy) URI paths 2014-12-09 13:59:58 +00:00
Michael Dowling
8467cfec77 Preventing infinite recursion in Pool.
When requests are intercepted in a Pool, it can result in infinite
recursion. This commit modifies the Pool to inspect the promise type of
a request to see if it was completed or not. If the request is completed
after sending, then we wait on the request to emit any pending events
and use `goto` to send the next request and prevent the stack from
growing.

Closes #905.
2014-11-16 23:43:56 -08:00
Michael Dowling
1330e3a1fe Query strings should be treated an un-encoded by default.
This change updates query strings so that they are treated as un-encoded
values by default where the value represents an un-encoded value to send
over the wire. A Query object then encodes the value before sending over
the wire. This means that even value query string values (e.g., ":") are
url encoded. This makes the Query class match PHP's http_build_query
function. However, if you want to send requests over the wire using
valid query string characters that do not need to be encoded, then you
can provide a string to Url::setQuery() and pass true as the second
argument to specify that the query string is a raw string that should
not be parsed or encoded (unless a call to getQuery() is subsequently
made, forcing the query-string to be converted into a Query object).
2014-11-03 23:04:06 -08:00
Michael Dowling
241611c4cd Improving URL encoding of path and query.
This commit updates path and query string encoding to better handle
strings that are already percent encoded, and now allows for all of the
characters valid for paths and queries specified in RFC 3986 to be
present in a URL without being encoded.
2014-10-30 16:52:02 -07:00
Michael Dowling
0b02466494 Query strings allow "/" characters 2014-10-29 21:38:20 -07:00
Michael Dowling
bd29143523 Do not overwrite existing header with POST
Existing 'application/x-www-form-urlencoded' content-type headers are no
longer overwritten when applying POST headers to a request before
sending. This allows developers to set custom attributes on each request
(e.g., charset).

Closes #877
Closes #879
2014-10-28 19:45:53 -07:00
Michael Dowling
eeb136826e Adding a Pool::send convenience method. Closes #874 2014-10-24 16:39:53 -07:00
Michael Dowling
bcdc7f3c6b Fixing transfer_info vs transfer_stats.
Closes #866
2014-10-16 10:54:28 -07:00
Michael Dowling
9fc544db12 Fixing error and end events for network errors.
When a networking error occurs, the future response that is created
for the transaction does not receive an exception until after the
future is waited on. When calling getResponse() in an event that
is emitted after a networking error, the response returned will
be a future with no actual data to use and throws when accessed.
This commit updated these events to return null if the response
of the transaction is a future. In these cases, it means that the
response did not complete successfully. I've also added a new method
to make this more explicit: hasResponse().

Closes #867.
2014-10-16 10:42:50 -07:00
Michael Dowling
2a8a75ee4c Adding missing coverage and accepting adapter as constructor arg 2014-10-12 20:02:40 -07:00
Michael Dowling
8f7b953695 Merge conflict fixes 2014-10-12 19:50:12 -07:00
Michael Dowling
fa8f06609a Merge branch 'ring' into 5-0
Conflicts:
	src/Adapter/Curl/CurlAdapter.php
	src/Adapter/Curl/CurlFactory.php
	src/Adapter/Curl/MultiAdapter.php
	src/Adapter/MockAdapter.php
	src/Adapter/StreamAdapter.php
	src/Event/HeadersEvent.php
	tests/Adapter/Curl/CurlAdapterTest.php
	tests/Adapter/Curl/CurlFactoryTest.php
	tests/Adapter/Curl/MultiAdapterTest.php
	tests/Adapter/Curl/RequestMediatorTest.php
	tests/Adapter/FakeParallelAdapterTest.php
	tests/Adapter/MockAdapterTest.php
	tests/Adapter/StreamAdapterTest.php
	tests/Adapter/StreamingProxyAdapterTest.php
	tests/Adapter/TransactionIteratorTest.php
2014-10-12 19:47:31 -07:00
Michael Dowling
2c2f1d7c47 Updating to use RingPHP and s/adapter/handle/g 2014-10-12 18:27:08 -07:00
Michael Dowling
22389c611c Simplifying the Request FSM
FSM is now passed to a client as a callable.
FSM now requires an adapter and message factory rather than a function.
FSM now is merged with RequestFsm to simplify the API (at least for now)
Removed unnecessary circular reference from client/FSM.
2014-10-11 16:01:20 -07:00
Michael Dowling
286525b387 Adding a ConnectException 2014-10-10 00:35:58 -07:00
Michael Dowling
27c4cc3cc4 Updating for Guzzle streams and ring updatres 2014-10-09 12:46:36 -07:00
Michael Dowling
ad3ab69ccb Fixing tests 2014-10-08 18:56:23 -07:00
Michael Dowling
acc07b324b Adding attach() to PostBody 2014-10-08 14:26:14 -07:00
Michael Dowling
46bead5c15 Updating for Guzzle-Ring changes 2014-10-06 22:25:04 -07:00
Michael Dowling
e2561faf8e PSR-7 compliance 2014-10-06 21:07:58 -07:00
Michael Dowling
eaaf949638 removing request "cancellation" 2014-10-06 17:34:56 -07:00
Michael Dowling
84d2531f39 Trying to fix stuff 2014-10-06 17:13:24 -07:00