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

1081 Commits

Author SHA1 Message Date
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
Michael Dowling
87470bf043 Ensuring exceptions are not thrown in pool 2014-10-05 23:49:15 -07:00
Michael Dowling
17fe94cf01 Not relying on validated deferred 2014-10-05 18:59:19 -07:00
Michael Dowling
b1fb453098 Fixing Pool tests 2014-10-05 18:51:07 -07:00
Michael Dowling
0998cfccf9 Updating FSM to run and stop at until, not run through it.
Performance tuning.
2014-10-05 18:28:11 -07:00
Michael Dowling
86600dec15 Starting to fix the pool object 2014-10-05 17:24:34 -07:00
Michael Dowling
6d1cf961a5 Getting most of the tests passing 2014-10-05 16:37:25 -07:00
Michael Dowling
4c62a79d16 Fixing max_handles and proxying 2014-10-05 16:33:10 -07:00
Michael Dowling
f52625f59b Fixing cancelling support 2014-10-05 14:48:36 -07:00
Michael Dowling
dd8cfa8cc6 Merge pull request #834 from michaelmoussa/master
Allow optional configuration of the pruneThreshold for releasing multihandles.
2014-10-05 12:23:03 -07:00
Michael Dowling
b4de302c8c Using STDOUT only if defined. Closes 846 2014-10-05 12:21:02 -07:00
Michael Dowling
3c0acec6a0 Using getenv instead of $_SERVER 2014-10-05 12:18:17 -07:00
Michael Dowling
c38ff16378 Merge pull request #838 from GrahamCampbell/cs
CS Fixes
2014-10-05 00:16:12 -07:00
Michael Dowling
5251f1067d Performance and updating to latest changes
Removing double-dispatch from MessageFactory and using a switch.
2014-10-05 00:11:40 -07:00
Michael Dowling
311122efa5 Fixing cancellation and some tests 2014-10-04 12:16:39 -07:00
Michael Dowling
7f863435c9 Fixing RingBridge tests 2014-10-03 16:56:29 -07:00
Ján Koščo
06e7e28e95 Extend the exception with error information when parsing XML 2014-10-03 14:48:39 +02:00
Ján Koščo
1eacc32f1c Minor CS improvements 2014-10-03 14:44:25 +02:00
Michael Dowling
d57c66dbc8 Fixing intercepting with cancelled response. Adding some tests 2014-10-03 00:43:28 -07:00
Michael Dowling
ac261dc68e Trying to get stuff working 2014-10-02 22:10:54 -07:00
Michael Dowling
43c7f468ae Updating to use future proxies 2014-10-02 21:14:42 -07:00