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

2285 Commits

Author SHA1 Message Date
Michael Dowling
b8ca88c797 Making it easier to represent parts of a message as a string 2014-08-03 09:59:59 -07:00
Michael Dowling
75e58ada12 4.1.5 release 4.1.5 2014-08-02 15:52:37 -07:00
Michael Dowling
2b90245038 Merge branch 'no-rewind-fix' 2014-08-02 15:48:29 -07:00
Michael Dowling
fbf2bf6dbd Allowing mulitple event subscriber listeners to be registered per event name 2014-08-02 15:35:17 -07:00
Michael Dowling
5335ee7933 Merge pull request #753 from meckhardt/patch-1
Fixed typo in subscriber example.
2014-08-01 16:14:21 -07:00
Michael Dowling
8b88478852 Curl cleanup
Ensuring that all curl errors are not retried, just the ones where the
connection could not be rewound.
Ensuring that curl handles are always closed, even if they fail to be
removed from the multi for some reason.
Always calling select in the transfer loop.
2014-08-01 14:04:24 -07:00
Michael Dowling
c41c764430 Merge pull request #748 from GrahamCampbell/whitespace
Removed whitespace in a test
2014-08-01 12:20:04 -07:00
Michael Dowling
d68dc43283 Accounting for random connection issues in multi-adapter
This commit updates the MultiAdapter to account for connecitons
being closed unexpectedly and then retried. When this occurs, curl
attempts to rewind the stream before sending. Because we use a
callback function to stream large payloads, curl fails to rewind
the stream and fails the transaction without associating the correct
error code. This commit checks if a transaction has a response
before processing. If a transaction doesn't have a response, then
we attempt to retry the request transparently (without emitting
another set of before events, essentially doing exactly what
curl would have done if it was possible to rewind the stream). If
the request did not have a body, then an error event is emitted as
it is a very weird error. If the request had a body but wasn't
rewindable, then an error event is emitted. If the request had a
body and a rewindable stream, then it is rewound and retried.

This change also updates the MultiAdapter and BatchContext to
transfer until the number of open handles in the BatchContext
reaches 0. This removes some complexity from the main transfer loop
that had to account for pending transactions.

Closes #710
2014-07-31 21:02:29 -07:00
Martin
b0977ddf0c Fixed typo in subscriber example. 2014-07-31 09:17:18 +02:00
Michael Dowling
119e11a750 Cleaning up StreamAdapter and possibly addressing #726 2014-07-30 12:45:04 -07:00
Graham Campbell
1080a9a8b3 Removed whitespace in a test 2014-07-26 12:54:40 +01:00
Michael Dowling
8e90e67c65 Merge pull request #746 from jeromegamez/fix_timeline_example
Replacing github example with httpbin
2014-07-23 12:40:03 -07:00
Jérôme Gamez
8d89a8900d Replacing github example with httpbin
https://github.com/timeline.json has been removed and delivers a JSON message with a 410 HTTP Status code. The change to http://httpbin.org/get follows the other request examples.
2014-07-23 21:10:03 +02:00
Michael Dowling
5ae164dae6 4.1.4 release 4.1.4 2014-07-22 17:52:39 -07:00
Michael Dowling
f74931ee9f Fixing bug in serialzing POST requests 2014-07-22 17:48:20 -07:00
Michael Dowling
1452c3c7d7 Merge pull request #740 from jamiehannaford/patch-1
Update clients.rst
2014-07-22 17:34:12 -07:00
Michael Dowling
fe72479671 Merge pull request #742 from dkvk/master
Added missing default argument
2014-07-22 14:09:51 -07:00
Daniel Kolvik
021a076aed Added missing default argument
The arguments to the SimpleXMLElement is documented in this way over at PHP.net:
```
data – A well-formed XML string or the path or URL to an XML document if data_is_url is TRUE.
options – Optionally used to specify additional Libxml parameters.
data_is_url – By default, data_is_url is FALSE. Use TRUE to specify that data is a path or URL to an XML document instead of string data.
ns – Namespace prefix or URI.
is_prefix – TRUE if ns is a prefix, FALSE if it's a URI; defaults to FALSE.
```

Even though we never will load XML in directly from a URL in this use case, the thrid argument data_is_url has to explicit be set to false. Otherwise the construct of SimpleXMLElement wont work as expected when the ns and is_prefix is beeing used.
2014-07-22 23:05:12 +02:00
Michael Dowling
e23b264c35 Merge pull request #738 from jamesfurey/master
Added 'options' to Response->xml() $config parameter.
2014-07-22 13:57:11 -07:00
Jamie Hannaford
4364fccf2a Update clients.rst 2014-07-22 12:30:00 +02:00
James Furey
6da39220f3 Renamed 'options' as 'libxml_options'. Updated ResponseInterface->xml() docblock. 2014-07-21 16:40:16 +10:00
Michael Dowling
5ab8c29546 Does not create a save_to stream until it is used. Closes #715 2014-07-19 12:17:17 -07:00
Michael Dowling
c6e07a3e96 Simplifying MultipartBody 2014-07-19 11:50:09 -07:00
James Furey
27de870d6c Added 'options' to Response->xml() $config parameter. 2014-07-19 13:24:09 +10:00
Michael Dowling
9a0a38096c Merge pull request #736 from jamiehannaford/url-combine-0-fix
Ensuring that '0' paths can be combined into empty URLs
2014-07-18 10:22:02 -07:00
Jamie Hannaford
0bfd7230a0 Ensuring that '0' paths can be combined into empty URLs 2014-07-16 13:30:30 +02:00
Michael Dowling
012b2aecbd Prepping for release 4.1.3 2014-07-15 20:01:02 -07:00
Michael Dowling
2c7cc07ba8 Merge remote-tracking branch 'pdt256/master'
Conflicts:
	src/Post/PostBody.php
2014-07-15 18:36:35 -07:00
Jamie Isaacs
4166ecbe79 Allowing PostBody to support multipart/form-data with base64 encoded strings 2014-07-15 17:20:00 -07:00
Michael Dowling
14f0873442 Lots of fixes to multipart/form-data
Using the AppendStream to vastly clean up how a multipart POST is created.
This changes also cleans up how the body is sent over the wire, eliminating
some bugs I discovered when fields are sent before files.
2014-07-15 15:50:36 -07:00
Michael Dowling
b909bd8bef Wrapping functions.php in an if-statement
This change wraps the functions defined in functions.php in an if
statement that checks to see if GUZZLE_FUNCTION_VERSION is defined. If
it is not defined, it is defined and set to the Guzzle version number.
This allows you to use a "global" version of Guzzle alongside a local version,
and still know which functions.php was autoloaded.

Closes #676
2014-07-14 16:55:50 -07:00
Michael Dowling
11810f6895 Fixing an issue with generating event arrays and adding missing tests 2014-07-14 16:34:23 -07:00
Michael Dowling
be4c132422 Merge pull request #732 from guzzle/post_urlencode
Adding more robust query string parsing.
2014-07-14 10:00:54 -07:00
Michael Dowling
0627c9ce03 Updating based on code review feedback 2014-07-11 23:10:15 -07:00
Michael Dowling
20c10129c3 Fix to ensure that repeated values are parsed correctly 2014-07-11 17:54:10 -07:00
Michael Dowling
c97511c0d7 Adding more robust query string parsing.
This commit adds a QueryParser class that is able to perform much more
robust query parsing. The query parser can track whether or not to use
a duplicate aggregator and whether or not to use numeric indices in
mutli-value key value pairs. You can now control how the query string
is url-decoded when parsing as well as disable url-decoding.

This change addresses nested key value pairs using 'a[b][c]=d' syntax
such that when parsed, will produce nested arrays containing
`['a' => ['b' => ['c' => 'd']]]`. This gets Guzzle query strings more
like PHP's parse_str().

This change closes #730 and closes #731 dealing with multipart POST
requests stripping "+" signs from values. POST key value pairs for
multipart requests are no longer modified at all, but rather sent over
the wire exactly as given.
2014-07-11 17:25:13 -07:00
Michael Dowling
49a14b2bbc Not applying POST headers until sending
Closes #706. This commit makes it so that POST headers are not
applied until sending a request. This allows you to do things like
change the query aggregator used before sending a request.
2014-07-07 22:30:38 -07:00
Michael Dowling
0016a005d7 Fixing multi-value header issue with StreamAdapter
Closes #725
2014-07-07 21:38:13 -07:00
Michael Dowling
16767bf79a Fixing a slash URL normalization issue
When using multiple slashes in URLs, normalization caused them to be combined
into a single slash. This commit fixes that issue to work exactly how Chrome
handles these types of URLs. Closes #713.
2014-07-07 16:06:31 -07:00
Michael Dowling
bdf3fb6e7c Merge pull request #728 from jamiehannaford/empty-hostname-fix
Make sure path leading slashes aren't added for empty hosts
2014-07-07 15:24:10 -07:00
Michael Dowling
b33038ee31 Merge pull request #727 from likeuntomurphy/patch-1
Update clients.rst
2014-07-07 14:40:08 -07:00
Jamie Hannaford
597ca11dd1 Make sure path leading slashes aren't added for empty hosts 2014-07-07 16:04:35 +02:00
likeuntomurphy
c972aaa38a Update clients.rst
The path component of the base URL must end with a slash; otherwise, the effective URL of $client->get('example-request') is https://api.twitter.com/example-request instead of https://api.twitter.com/v1.1/example-request.
2014-07-05 10:17:14 -04:00
Michael Dowling
095cf4db55 4.1.2 release 4.1.2 2014-06-18 11:22:41 -07:00
Michael Dowling
799acd437a Merge branch 'get_with_body' 2014-06-18 10:46:59 -07:00
Michael Dowling
6a55fbfb7e Simplifying how requests are created with cURL 2014-06-18 10:46:26 -07:00
Michael Dowling
521b9d8ae7 Moving the event conversion code to a function 2014-06-17 20:26:15 -07:00
Michael Dowling
ddbb19ea91 Merge pull request #709 from DavidPrevot/ICC-free
Strip away copyrighted ICC profile
2014-06-17 16:59:27 -07:00
David Prévot
4c93e6e771 Strip away copyrighted ICC profile 2014-06-17 17:56:33 -04:00
Michael Dowling
4d3751d8e0 Adding support for GET requests with body 2014-06-11 21:01:44 -07:00