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

21 Commits

Author SHA1 Message Date
Michael Dowling
c2e9f5e269 More improvements to QueryString 2013-06-08 00:22:30 -07:00
Michael Dowling
ebbae74993 Removing overly verbose @covers annotations from unit tests 2013-05-29 22:53:59 -07:00
Nils Luxton
a29ab1eb32 Single PHP-style array values now parse into array. 2013-03-11 14:20:20 +00:00
Michael Dowling
69ad0affa2 The encoding scheme used by Guzzle\Http\QueryString can now be
customized
Guzzle\Http\QueryString no longer accepts a callback function for
aggregation but rather uses QueryAggregatorInterface objects.
Addresses #238.
2013-02-13 23:28:44 -08:00
David Abdemoulaie
db5b96d08d Fixes edge-cases in Url, QueryString, and Request
Falsy values (the string "0") are now handled properly

e.g. http://foo.com?0, http://foo.com#0
2013-01-31 14:35:20 -06:00
David Abdemoulaie
8aabcebef1 QueryString::$prefix is now completely unnecessary - removed 2013-01-30 17:32:43 -06:00
David Abdemoulaie
d0f2aff142 Massive refactoring of Url, QueryString, and Request for RFC3986
TODO: ArrayCookieJar & tests are failing
2013-01-30 17:16:42 -06:00
Jeff Carouth
bc239e71f9 Parse query vars containing equals sign (=)
When a query variable contains an equals sign, the QueryString
parsing will strip the equals sign. One example of would be with
base64 encoded strings containing an equals sign at the end for
padding. While this issue can be prevented by simply urlencoding
the URL, cURL, for example, handles this gracefully.
2012-11-16 19:27:07 -06:00
Dave Marshall
f0ecc3ab65 Fixes #108 - Check array key exists rather than for empty 2012-07-24 16:35:12 +01:00
Michael Dowling
bc6cbc8cd3 [Http] Fixing bug where query string values of 0 were not being set. Closes #108. 2012-07-23 22:50:38 -07:00
Matt Button
aeeb31a4ed Treat '+' as encoded space when parsing query string
According to RFC1738 (implemented by urlencode) spaces are encoded as
plus symbols. However, RFC3986 (imeplemented by rawurlencode) states
that spaces should be encoded as '%20'.

When parsing a query string that was encoded with urlencode we should
treat plus symbols as spaces.

fixes #105
2012-07-19 13:50:55 +01:00
Michael Dowling
7048755299 [Http] Refactoring QueryString
- Adds a trailing equal sign for empty values by default (e.g. ?acl=)
- Set blank values (e.g. ?acl) by setting the value to QueryString::BLANK
- Combined URL encoding into a single option rather than separate
  settings for fields and values
- Changed isEncodingValues() and isEncodingFields() to isUrlEncoding()
- Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool)
- Changed the aggregation functions of QueryString to be static methods
- Can now use fromString() with querystrings that have a leading ?
2012-07-08 17:17:07 -07:00
Ryan Weaver
3201541783 Fix for a situation where a "blank" (e.g. null, false) value for a query string parameter resulted in a missing "=":
Suppose that we set the following data on a QueryString object:

array(
    'foo' => null,
    'bar' => 'test',
)

The query string before and after this change would be:

BEFORE: ?foo&bar=test
AFTER:  ?foo=&bar=test

The importance is that before the lack of "=" resulted made it look like there was only a single parameter called "foo&bar" with a value of "test" (i.e. the bar parameter is joined with foo).
2012-07-08 13:32:45 -05: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
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
2be94b1981 [Http] Adding support for UTF-8 characters in query strings when parsing URLs 2012-04-20 00:31:07 -07:00
Michael Dowling
bc3acaf817 Allowing deeply nested query string values with PHP style aggregation. Closes #27 2012-03-24 17:10:20 -05:00
Michael Dowling
f3a5b01236 [Http] Allowing mutliple query string parameters to be used by the same name when using the aggregateUsingDuplicates aggregation function. Addresses #22. 2012-02-13 20:16:32 -06:00
Michael Dowling
4c46e77015 Guzzle 2.0
Adopting composer for dependency management
Updating LICENSE, travis build file, making better use of git ignores, and remove unused build target
Removing @author tags.  Use the commit history for a changelog.
Moving files from build folder to /
Adding min build target to product a Guzzle only phar with no autoloader
[Common] Accepting ZF1 or ZF2 cache in ZendCacheAdapter
[Common] Optimizing Stream wrapper and EntityBody abstractions.
[Common] [Http] Migrating from Guzzle event system to the Symfony2 event dispatcher
[Common] Moved Inflector and Inspector to Service namespace
[Http] Simplifying Guzzle\Guzzle curl detection
[Http] Removing Guzzle\Http\Pool and now using Guzzle\Http\Curl\CurlMulti
[Http] The helper methods from Guzzle\Http\Message\RequestFactory have been removed to prevent confusion and encourage developers to use Guzzle\Http\Client to create requests.
[Http] Clients can now send one or more requests in an array using the send() method, so the batch() method was removed.
[Http] Updating curl multi to allow blocking calls while sending other transfers
[Http] Making the Request::hasHeader method more intuitive.  Guzzle\Http\Message\AbstractMessage::hasHeader() now returns true if the header is found using exact matching.  If the header is found using a regex or case-insensitive match, then it will return the name of the found header.
[Http] Removing content-type guessing from EntityBody based on file extension and solely using finfo.
[Http] Adding basic auth plugin
[Http] Cleaning up CookieJar and CurlMulti
[Http] Removing custom rawurlencode from QueryString because PHP 5.3 now properly deals with tilde characters.
[Http] Minor optimization to parsing messages in RequestFactory
[Http] Adding Guzzle\Http\Client for developers that don't need commands or service descriptions
[Http] Making it easier to set a global User-Agent header for a Guzzle\Http\Client
[Http] Fixing the discrepancies between the ClientInterface and Guzzle\Http\Client
[Http] Adding the ability to set and retrieve tokenized headers from Requests and Responses
[Service] Ditching NIH filters and using the Symfony2 validator
[Service] Moving most service building logic to the ServiceBuilder::factory method so that it is easier to build custom config readers.
[Service] Allowing deep nested command inheritance.
[Service] Cleaning up Inflector caching.
[Service] Getting rid of concept of can_batch because everything is now sent in parallel.
[Service] Adding a JSON description builder.
[Service] Cleaning up ResourceIteratorApplyBatched.
[Service] Removing caching stuff from ServiceBuilder because the data being cached is extremely fast to generate.
[Service] Added a method to serialize the ServiceDescription in case a ServiceDescription needs to be cached in an application.
[Service] Making description builders use static methods.
[Service] Adding support to include other description files for XML and JSON description builders.
[Service] Adding support for filters to ApiCommands
[Service] Using {{}} instead of $. to reference other services as a dependency for another service
2012-01-14 13:57:05 -06:00
Michael Dowling
a7ae469671 Removing verbose docblock headers from every class 2011-07-07 17:17:28 -05:00
Michael Dowling
d8a1277c69 Guzzle - PHP framework for building REST webservice clients 2011-02-27 22:32:13 -06:00