.gitignore000064400000000522151742734620006546 0ustar00# Ingore common cruft .DS_STORE coverage # Ignore binary files guzzle.phar guzzle-min.phar # Ignore potentially sensitive phpunit file phpunit.xml # Ignore composer generated files composer.phar composer.lock composer-test.lock vendor/ # Ignore build files build/ phing/build.properties # Ignore subsplit working directory .subsplit .travis.yml000064400000002170151742734620006670 0ustar00language: php php: - 5.3 - 5.4 before_script: - curl --version - pear config-set php_ini ~/.phpenv/versions/`php -r 'echo phpversion();'`/etc/php.ini - echo 'Installing pecl_http' - wget --quiet http://pecl.php.net/get/pecl_http-1.7.4.tgz - tar -xzf pecl_http-1.7.4.tgz - sh -c "cd pecl_http-1.7.4 && phpize && ./configure && make && sudo make install" > /dev/null - echo "extension=http.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` - pecl install uri_template-beta - pear config-set auto_discover 1 - pear install pear.phing.info/phing - pear install pear.phpunit.de/phploc - pear install pear/PHP_CodeSniffer - pear install pear.pdepend.org/PHP_Depend - pear install bartlett.laurent-laville.org/PHP_CompatInfo - pear install pear/PEAR_PackageFileManager2 pear/PEAR_PackageFileManager2_Plugins pear/XML_Serializer-beta - pear install VersionControl_Git-alpha - phpenv rehash - composer install --dev - cp phing/build.properties.travis phing/build.properties - echo 'Ensuring the correct version of node is running' - ~/.nvm/nvm.sh install v0.6.14 script: phing travisci CHANGELOG.md000064400000066401151742734620006377 0ustar00CHANGELOG ========= 3.4.0 (2013-04-11) ------------------ * Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 * Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 * Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 * Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. * Bug fix: Added `number` type to service descriptions. * Bug fix: empty parameters are removed from an OAuth signature * Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header * Bug fix: Fixed "array to string" error when validating a union of types in a service description * Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream * Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. * Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. * The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. * Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if the Content-Type can be determined based on the entity body or the path of the request. * Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. * Added support for a PSR-3 LogAdapter. * Added a `command.after_prepare` event * Added `oauth_callback` parameter to the OauthPlugin * Added the ability to create a custom stream class when using a stream factory * Added a CachingEntityBody decorator * Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. * The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. * You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies * POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use POST fields or files (the latter is only used when emulating a form POST in the browser). * Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest 3.3.1 (2013-03-10) ------------------ * Added the ability to create PHP streaming responses from HTTP requests * Bug fix: Running any filters when parsing response headers with service descriptions * Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing * Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across response location visitors. * Bug fix: Removed the possibility of creating configuration files with circular dependencies * RequestFactory::create() now uses the key of a POST file when setting the POST file name * Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set 3.3.0 (2013-03-03) ------------------ * A large number of performance optimizations have been made * Bug fix: Added 'wb' as a valid write mode for streams * Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned * Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` * BC: Removed `Guzzle\Http\Utils` class * BC: Setting a service description on a client will no longer modify the client's command factories. * BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' * BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to lowercase * Operation parameter objects are now lazy loaded internally * Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses * Added support for instantiating responseType=class responseClass classes. Classes must implement `Guzzle\Service\Command\ResponseClassInterface` * Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These additional properties also support locations and can be used to parse JSON responses where the outermost part of the JSON is an array * Added support for nested renaming of JSON models (rename sentAs to name) * CachePlugin * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error * Debug headers can now added to cached response in the CachePlugin 3.2.0 (2013-02-14) ------------------ * CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. * URLs with no path no longer contain a "/" by default * Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. * BadResponseException no longer includes the full request and response message * Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface * Adding getResponseBody() to Guzzle\Http\Message\RequestInterface * Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription * Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list * xmlEncoding can now be customized for the XML declaration of a XML service description operation * Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value aggregation and no longer uses callbacks * The URL encoding implementation of Guzzle\Http\QueryString can now be customized * Bug fix: Filters were not always invoked for array service description parameters * Bug fix: Redirects now use a target response body rather than a temporary response body * Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded * Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives 3.1.2 (2013-01-27) ------------------ * Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. * Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent * CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) * Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() * Setting default headers on a client after setting the user-agent will not erase the user-agent setting 3.1.1 (2013-01-20) ------------------ * Adding wildcard support to Guzzle\Common\Collection::getPath() * Adding alias support to ServiceBuilder configs * Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface 3.1.0 (2013-01-12) ------------------ * BC: CurlException now extends from RequestException rather than BadResponseException * BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() * Added getData to ServiceDescriptionInterface * Added context array to RequestInterface::setState() * Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http * Bug: Adding required content-type when JSON request visitor adds JSON to a command * Bug: Fixing the serialization of a service description with custom data * Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing an array of successful and failed responses * Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection * Added Guzzle\Http\IoEmittingEntityBody * Moved command filtration from validators to location visitors * Added `extends` attributes to service description parameters * Added getModels to ServiceDescriptionInterface 3.0.7 (2012-12-19) ------------------ * Fixing phar detection when forcing a cacert to system if null or true * Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` * Cleaning up `Guzzle\Common\Collection::inject` method * Adding a response_body location to service descriptions 3.0.6 (2012-12-09) ------------------ * CurlMulti performance improvements * Adding setErrorResponses() to Operation * composer.json tweaks 3.0.5 (2012-11-18) ------------------ * Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin * Bug: Response body can now be a string containing "0" * Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert * Bug: QueryString::fromString now properly parses query string parameters that contain equal signs * Added support for XML attributes in service description responses * DefaultRequestSerializer now supports array URI parameter values for URI template expansion * Added better mimetype guessing to requests and post files 3.0.4 (2012-11-11) ------------------ * Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value * Bug: Cookies can now be added that have a name, domain, or value set to "0" * Bug: Using the system cacert bundle when using the Phar * Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures * Enhanced cookie jar de-duplication * Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added * Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies * Added the ability to create any sort of hash for a stream rather than just an MD5 hash 3.0.3 (2012-11-04) ------------------ * Implementing redirects in PHP rather than cURL * Added PECL URI template extension and using as default parser if available * Bug: Fixed Content-Length parsing of Response factory * Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. * Adding ToArrayInterface throughout library * Fixing OauthPlugin to create unique nonce values per request 3.0.2 (2012-10-25) ------------------ * Magic methods are enabled by default on clients * Magic methods return the result of a command * Service clients no longer require a base_url option in the factory * Bug: Fixed an issue with URI templates where null template variables were being expanded 3.0.1 (2012-10-22) ------------------ * Models can now be used like regular collection objects by calling filter, map, etc * Models no longer require a Parameter structure or initial data in the constructor * Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` 3.0.0 (2012-10-15) ------------------ * Rewrote service description format to be based on Swagger * Now based on JSON schema * Added nested input structures and nested response models * Support for JSON and XML input and output models * Renamed `commands` to `operations` * Removed dot class notation * Removed custom types * Broke the project into smaller top-level namespaces to be more component friendly * Removed support for XML configs and descriptions. Use arrays or JSON files. * Removed the Validation component and Inspector * Moved all cookie code to Guzzle\Plugin\Cookie * Magic methods on a Guzzle\Service\Client now return the command un-executed. * Calling getResult() or getResponse() on a command will lazily execute the command if needed. * Now shipping with cURL's CA certs and using it by default * Added previousResponse() method to response objects * No longer sending Accept and Accept-Encoding headers on every request * Only sending an Expect header by default when a payload is greater than 1MB * Added/moved client options: * curl.blacklist to curl.option.blacklist * Added ssl.certificate_authority * Added a Guzzle\Iterator component * Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin * Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) * Added a more robust caching plugin * Added setBody to response objects * Updating LogPlugin to use a more flexible MessageFormatter * Added a completely revamped build process * Cleaning up Collection class and removing default values from the get method * Fixed ZF2 cache adapters 2.8.8 (2012-10-15) ------------------ * Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did 2.8.7 (2012-09-30) ------------------ * Bug: Fixed config file aliases for JSON includes * Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests * Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload * Bug: Hardening request and response parsing to account for missing parts * Bug: Fixed PEAR packaging * Bug: Fixed Request::getInfo * Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail * Adding the ability for the namespace Iterator factory to look in multiple directories * Added more getters/setters/removers from service descriptions * Added the ability to remove POST fields from OAuth signatures * OAuth plugin now supports 2-legged OAuth 2.8.6 (2012-09-05) ------------------ * Added the ability to modify and build service descriptions * Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command * Added a `json` parameter location * Now allowing dot notation for classes in the CacheAdapterFactory * Using the union of two arrays rather than an array_merge when extending service builder services and service params * Ensuring that a service is a string before doing strpos() checks on it when substituting services for references in service builder config files. * Services defined in two different config files that include one another will by default replace the previously defined service, but you can now create services that extend themselves and merge their settings over the previous * The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like '_default' with a default JSON configuration file. 2.8.5 (2012-08-29) ------------------ * Bug: Suppressed empty arrays from URI templates * Bug: Added the missing $options argument from ServiceDescription::factory to enable caching * Added support for HTTP responses that do not contain a reason phrase in the start-line * AbstractCommand commands are now invokable * Added a way to get the data used when signing an Oauth request before a request is sent 2.8.4 (2012-08-15) ------------------ * Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin * Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. * Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream * Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream * Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) * Added additional response status codes * Removed SSL information from the default User-Agent header * DELETE requests can now send an entity body * Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries * Added the ability of the MockPlugin to consume mocked request bodies * LogPlugin now exposes request and response objects in the extras array 2.8.3 (2012-07-30) ------------------ * Bug: Fixed a case where empty POST requests were sent as GET requests * Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body * Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new * Added multiple inheritance to service description commands * Added an ApiCommandInterface and added ``getParamNames()`` and ``hasParam()`` * Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything * Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles 2.8.2 (2012-07-24) ------------------ * Bug: Query string values set to 0 are no longer dropped from the query string * Bug: A Collection object is no longer created each time a call is made to ``Guzzle\Service\Command\AbstractCommand::getRequestHeaders()`` * Bug: ``+`` is now treated as an encoded space when parsing query strings * QueryString and Collection performance improvements * Allowing dot notation for class paths in filters attribute of a service descriptions 2.8.1 (2012-07-16) ------------------ * Loosening Event Dispatcher dependency * POST redirects can now be customized using CURLOPT_POSTREDIR 2.8.0 (2012-07-15) ------------------ * BC: Guzzle\Http\Query * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) * 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 ? * cURL configuration values can be specified in service descriptions using ``curl.`` prefixed parameters * Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body * Cookies are no longer URL decoded by default * Bug: URI template variables set to null are no longer expanded 2.7.2 (2012-07-02) ------------------ * BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. * BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() * CachePlugin now allows for a custom request parameter function to check if a request can be cached * Bug fix: CachePlugin now only caches GET and HEAD requests by default * Bug fix: Using header glue when transferring headers over the wire * Allowing deeply nested arrays for composite variables in URI templates * Batch divisors can now return iterators or arrays 2.7.1 (2012-06-26) ------------------ * Minor patch to update version number in UA string * Updating build process 2.7.0 (2012-06-25) ------------------ * BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. * BC: Removed magic setX methods from commands * BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method * Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. * Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) * Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace * Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin * Added the ability to set POST fields and files in a service description * Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method * Adding a command.before_prepare event to clients * Added BatchClosureTransfer and BatchClosureDivisor * BatchTransferException now includes references to the batch divisor and transfer strategies * Fixed some tests so that they pass more reliably * Added Guzzle\Common\Log\ArrayLogAdapter 2.6.6 (2012-06-10) ------------------ * BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin * BC: Removing Guzzle\Service\Command\CommandSet * Adding generic batching system (replaces the batch queue plugin and command set) * Updating ZF cache and log adapters and now using ZF's composer repository * Bug: Setting the name of each ApiParam when creating through an ApiCommand * Adding result_type, result_doc, deprecated, and doc_url to service descriptions * Bug: Changed the default cookie header casing back to 'Cookie' 2.6.5 (2012-06-03) ------------------ * BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() * BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from * BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data * BC: Renaming methods in the CookieJarInterface * Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations * Making the default glue for HTTP headers ';' instead of ',' * Adding a removeValue to Guzzle\Http\Message\Header * Adding getCookies() to request interface. * Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() 2.6.4 (2012-05-30) ------------------ * BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. * BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand * Bug: Fixing magic method command calls on clients * Bug: Email constraint only validates strings * Bug: Aggregate POST fields when POST files are present in curl handle * Bug: Fixing default User-Agent header * Bug: Only appending or prepending parameters in commands if they are specified * Bug: Not requiring response reason phrases or status codes to match a predefined list of codes * Allowing the use of dot notation for class namespaces when using instance_of constraint * Added any_match validation constraint * Added an AsyncPlugin * Passing request object to the calculateWait method of the ExponentialBackoffPlugin * Allowing the result of a command object to be changed * Parsing location and type sub values when instantiating a service description rather than over and over at runtime 2.6.3 (2012-05-23) ------------------ * [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. * [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. * You can now use an array of data when creating PUT request bodies in the request factory. * Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. * [Http] Adding support for Content-Type in multipart POST uploads per upload * [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) * Adding more POST data operations for easier manipulation of POST data. * You can now set empty POST fields. * The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. * Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. * CS updates 2.6.2 (2012-05-19) ------------------ * [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. 2.6.1 (2012-05-19) ------------------ * [BC] Removing 'path' support in service descriptions. Use 'uri'. * [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. * [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. * [BC] Removing Guzzle\Common\XmlElement. * All commands, both dynamic and concrete, have ApiCommand objects. * Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. * Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. * Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. 2.6.0 (2012-05-15) ------------------ * [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder * [BC] Executing a Command returns the result of the command rather than the command * [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. * [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. * [BC] Moving ResourceIterator* to Guzzle\Service\Resource * [BC] Completely refactored ResourceIterators to iterate over a cloned command object * [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate * [BC] Guzzle\Guzzle is now deprecated * Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject * Adding Guzzle\Version class to give version information about Guzzle * Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() * Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data * ServiceDescription and ServiceBuilder are now cacheable using similar configs * Changing the format of XML and JSON service builder configs. Backwards compatible. * Cleaned up Cookie parsing * Trimming the default Guzzle User-Agent header * Adding a setOnComplete() method to Commands that is called when a command completes * Keeping track of requests that were mocked in the MockPlugin * Fixed a caching bug in the CacheAdapterFactory * Inspector objects can be injected into a Command object * Refactoring a lot of code and tests to be case insensitive when dealing with headers * Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL * Adding the ability to set global option overrides to service builder configs * Adding the ability to include other service builder config files from within XML and JSON files * Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. 2.5.0 (2012-05-08) ------------------ * Major performance improvements * [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. * [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. * [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" * Added the ability to passed parameters to all requests created by a client * Added callback functionality to the ExponentialBackoffPlugin * Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. * Rewinding request stream bodies when retrying requests * Exception is thrown when JSON response body cannot be decoded * Added configurable magic method calls to clients and commands. This is off by default. * Fixed a defect that added a hash to every parsed URL part * Fixed duplicate none generation for OauthPlugin. * Emitting an event each time a client is generated by a ServiceBuilder * Using an ApiParams object instead of a Collection for parameters of an ApiCommand * cache.* request parameters should be renamed to params.cache.* * Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc). See CurlHandle. * Added the ability to disable type validation of service descriptions * ServiceDescriptions and ServiceBuilders are now Serializable LICENSE000064400000002127151742734620005566 0ustar00Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. README.md000064400000016705151742734620006047 0ustar00Guzzle, PHP HTTP client and webservice framework ================================================ Guzzle is a PHP HTTP client and framework for building RESTful web service clients. - Extremely powerful API provides all the power of cURL with a simple interface. - Truly take advantage of HTTP/1.1 with persistent connections, connection pooling, and parallel requests. - Service description DSL allows you build awesome web service clients faster. - Symfony2 event-based plugin system allows you to completely modify the behavior of a request. - Includes a custom node.js webserver to test your clients. - Unit-tested with PHPUnit with 100% code coverage. Getting started --------------- - [Download the phar](http://guzzlephp.org/guzzle.phar) and include it in your project ([minimal phar](http://guzzlephp.org/guzzle-min.phar)) - Docs: [www.guzzlephp.org](http://www.guzzlephp.org/) - Forum: https://groups.google.com/forum/?hl=en#!forum/guzzle - IRC: [#guzzlephp](irc://irc.freenode.net/#guzzlephp) channel on irc.freenode.net ### Installing via Composer The recommended way to install Guzzle is through [Composer](http://getcomposer.org). 1. Add ``guzzle/guzzle`` as a dependency in your project's ``composer.json`` file: { "require": { "guzzle/guzzle": "~3.1" } } 2. Download and install Composer: curl -s http://getcomposer.org/installer | php 3. Install your dependencies: php composer.phar install 4. Require Composer's autoloader Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process: require 'vendor/autoload.php'; You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at [getcomposer.org](http://getcomposer.org). Features -------- - Supports GET, HEAD, POST, DELETE, PUT, PATCH, OPTIONS, and any custom verbs - Allows full access to request and response headers - Persistent connections are implicitly managed by Guzzle, resulting in huge performance benefits - [Send requests in parallel](http://guzzlephp.org/tour/http.html#send-http-requests-in-parallel) - Cookie sessions can be maintained between requests using the [CookiePlugin](http://guzzlephp.org/tour/http.html#cookie-session-plugin) - Allows custom [entity bodies](http://guzzlephp.org/tour/http.html#entity-bodies), including sending data from a PHP stream and downloading data to a PHP stream - Responses can be cached and served from cache using the [caching forward proxy plugin](http://guzzlephp.org/tour/http.html#php-based-caching-forward-proxy) - Failed requests can be retried using [truncated exponential backoff](http://guzzlephp.org/tour/http.html#truncated-exponential-backoff) with custom retry policies - Entity bodies can be validated automatically using Content-MD5 headers and the [MD5 hash validator plugin](http://guzzlephp.org/tour/http.html#md5-hash-validator-plugin) - All data sent over the wire can be logged using the [LogPlugin](http://guzzlephp.org/tour/http.html#over-the-wire-logging) - Subject/Observer signal slot system for unobtrusively [modifying request behavior](http://guzzlephp.org/guide/http/creating_plugins.html) - Supports all of the features of libcurl including authentication, compression, redirects, SSL, proxies, etc - Web service client framework for building future-proof interfaces to web services - Includes a [service description DSL](http://guzzlephp.org/guide/service/service_descriptions.html) for quickly building webservice clients - Full support for [URI templates](http://tools.ietf.org/html/rfc6570) - Advanced batching functionality to efficiently send requests or commands in parallel with customizable batch sizes and transfer strategies HTTP basics ----------- ```php '***' )); // Issue a path using a relative URL to the client's base URL // Sends to http://www.example.com/api/v1/key/***/users $request = $client->get('users'); $response = $request->send(); // Relative URL that overwrites the path of the base URL $request = $client->get('/test/123.php?a=b'); // Issue a head request on the base URL $response = $client->head()->send(); // Delete user 123 $response = $client->delete('users/123')->send(); // Send a PUT request with custom headers $response = $client->put('upload/text', array( 'X-Header' => 'My Header' ), 'body of the request')->send(); // Send a PUT request using the contents of a PHP stream as the body // Send using an absolute URL (overrides the base URL) $response = $client->put('http://www.example.com/upload', array( 'X-Header' => 'My Header' ), fopen('http://www.test.com/', 'r')); // Create a POST request with a file upload (notice the @ symbol): $request = $client->post('http://localhost:8983/solr/update', null, array ( 'custom_field' => 'my value', 'file' => '@/path/to/documents.xml' )); // Create a POST request and add the POST files manually $request = $client->post('http://localhost:8983/solr/update') ->addPostFiles(array( 'file' => '/path/to/documents.xml' )); // Responses are objects echo $response->getStatusCode() . ' ' . $response->getReasonPhrase() . "\n"; // Requests and responses can be cast to a string to show the raw HTTP message echo $request . "\n\n" . $response; // Create a request based on an HTTP message $request = RequestFactory::fromMessage( "PUT / HTTP/1.1\r\n" . "Host: test.com:8081\r\n" . "Content-Type: text/plain" . "Transfer-Encoding: chunked\r\n" . "\r\n" . "this is the body" ); ``` Send requests in parallel ------------------------- ```php send(array( $client->get('users'), $client->head('messages/123'), $client->delete('orders/123') )); } catch (Guzzle\Common\Exception\ExceptionCollection $e) { echo "The following requests encountered an exception: \n"; foreach ($e as $exception) { echo $exception->getRequest() . "\n" . $exception->getMessage() . "\n"; } } ``` URI templates ------------- Guzzle supports the entire [URI templates RFC](http://tools.ietf.org/html/rfc6570). ```php '/path/to', 'a' => 'hi', 'data' => array( 'foo' => 'bar', 'mesa' => 'jarjar' ) )); $request = $client->get('http://www.test.com{+path}{?a,data*}'); ``` The generated request URL would become: ``http://www.test.com/path/to?a=hi&foo=bar&mesa=jarjar`` You can specify URI templates and an array of additional template variables to use when creating requests: ```php 'hi' )); $request = $client->get(array('/{?a,b}', array( 'b' => 'there' )); ``` The resulting URL would become ``http://test.com/?a=hi&b=there`` Unit testing ------------ [![Build Status](https://secure.travis-ci.org/guzzle/guzzle.png?branch=master)](http://travis-ci.org/guzzle/guzzle) Guzzle uses PHPUnit for unit testing. In order to run the unit tests, you'll first need to install the dependencies of the project using Composer: `php composer.phar install --dev`. You can then run the tests using `vendor/bin/phpunit` or `phing test` (if you have phing installed). UPGRADING.md000064400000027515151742734620006433 0ustar00Guzzle Upgrade Guide ==================== 3.3 to 3.4 ---------- Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. 3.2 to 3.3 ---------- ### Response::getEtag() quote stripping removed `Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header ### Removed `Guzzle\Http\Utils` The `Guzzle\Http\Utils` class was removed. This class was only used for testing. ### Stream wrapper and type `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to lowercase. ### curl.emit_io became emit_io Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' 3.1 to 3.2 ---------- ### CurlMulti is no longer reused globally Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added to a single client can pollute requests dispatched from other clients. If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is created. ```php $multi = new Guzzle\Http\Curl\CurlMulti(); $builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); $builder->addListener('service_builder.create_client', function ($event) use ($multi) { $event['client']->setCurlMulti($multi); } }); ``` ### No default path URLs no longer have a default path value of '/' if no path was specified. Before: ```php $request = $client->get('http://www.foo.com'); echo $request->getUrl(); // >> http://www.foo.com/ ``` After: ```php $request = $client->get('http://www.foo.com'); echo $request->getUrl(); // >> http://www.foo.com ``` ### Less verbose BadResponseException The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and response information. You can, however, get access to the request and response object by calling `getRequest()` or `getResponse()` on the exception object. ### Query parameter aggregation Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is responsible for handling the aggregation of multi-valued query string variables into a flattened hash. 2.8 to 3.x ---------- ### Guzzle\Service\Inspector Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` **Before** ```php use Guzzle\Service\Inspector; class YourClient extends \Guzzle\Service\Client { public static function factory($config = array()) { $default = array(); $required = array('base_url', 'username', 'api_key'); $config = Inspector::fromConfig($config, $default, $required); $client = new self( $config->get('base_url'), $config->get('username'), $config->get('api_key') ); $client->setConfig($config); $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); return $client; } ``` **After** ```php use Guzzle\Common\Collection; class YourClient extends \Guzzle\Service\Client { public static function factory($config = array()) { $default = array(); $required = array('base_url', 'username', 'api_key'); $config = Collection::fromConfig($config, $default, $required); $client = new self( $config->get('base_url'), $config->get('username'), $config->get('api_key') ); $client->setConfig($config); $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); return $client; } ``` ### Convert XML Service Descriptions to JSON **Before** ```xml Get a list of groups Uses a search query to get a list of groups Create a group Delete a group by ID Update a group ``` **After** ```json { "name": "Zendesk REST API v2", "apiVersion": "2012-12-31", "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", "operations": { "list_groups": { "httpMethod":"GET", "uri": "groups.json", "summary": "Get a list of groups" }, "search_groups":{ "httpMethod":"GET", "uri": "search.json?query=\"{query} type:group\"", "summary": "Uses a search query to get a list of groups", "parameters":{ "query":{ "location": "uri", "description":"Zendesk Search Query", "type": "string", "required": true } } }, "create_group": { "httpMethod":"POST", "uri": "groups.json", "summary": "Create a group", "parameters":{ "data": { "type": "array", "location": "body", "description":"Group JSON", "filters": "json_encode", "required": true }, "Content-Type":{ "type": "string", "location":"header", "static": "application/json" } } }, "delete_group": { "httpMethod":"DELETE", "uri": "groups/{id}.json", "summary": "Delete a group", "parameters":{ "id":{ "location": "uri", "description":"Group to delete by ID", "type": "integer", "required": true } } }, "get_group": { "httpMethod":"GET", "uri": "groups/{id}.json", "summary": "Get a ticket", "parameters":{ "id":{ "location": "uri", "description":"Group to get by ID", "type": "integer", "required": true } } }, "update_group": { "httpMethod":"PUT", "uri": "groups/{id}.json", "summary": "Update a group", "parameters":{ "id": { "location": "uri", "description":"Group to update by ID", "type": "integer", "required": true }, "data": { "type": "array", "location": "body", "description":"Group JSON", "filters": "json_encode", "required": true }, "Content-Type":{ "type": "string", "location":"header", "static": "application/json" } } } } ``` ### Guzzle\Service\Description\ServiceDescription Commands are now called Operations **Before** ```php use Guzzle\Service\Description\ServiceDescription; $sd = new ServiceDescription(); $sd->getCommands(); // @returns ApiCommandInterface[] $sd->hasCommand($name); $sd->getCommand($name); // @returns ApiCommandInterface|null $sd->addCommand($command); // @param ApiCommandInterface $command ``` **After** ```php use Guzzle\Service\Description\ServiceDescription; $sd = new ServiceDescription(); $sd->getOperations(); // @returns OperationInterface[] $sd->hasOperation($name); $sd->getOperation($name); // @returns OperationInterface|null $sd->addOperation($operation); // @param OperationInterface $operation ``` ### Guzzle\Common\Inflection\Inflector Namespace is now `Guzzle\Inflection\Inflector` ### Guzzle\Http\Plugin Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. ### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. **Before** ```php use Guzzle\Common\Log\ClosureLogAdapter; use Guzzle\Http\Plugin\LogPlugin; /** @var \Guzzle\Http\Client */ $client; // $verbosity is an integer indicating desired message verbosity level $client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); ``` **After** ```php use Guzzle\Log\ClosureLogAdapter; use Guzzle\Log\MessageFormatter; use Guzzle\Plugin\Log\LogPlugin; /** @var \Guzzle\Http\Client */ $client; // $format is a string indicating desired message format -- @see MessageFormatter $client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); ``` ### Guzzle\Http\Plugin\CurlAuthPlugin Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. ### Guzzle\Http\Plugin\ExponentialBackoffPlugin Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. **Before** ```php use Guzzle\Http\Plugin\ExponentialBackoffPlugin; $backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) )); $client->addSubscriber($backoffPlugin); ``` **After** ```php use Guzzle\Plugin\Backoff\BackoffPlugin; use Guzzle\Plugin\Backoff\HttpBackoffStrategy; // Use convenient factory method instead -- see implementation for ideas of what // you can do with chaining backoff strategies $backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( HttpBackoffStrategy::getDefaultFailureCodes(), array(429) )); $client->addSubscriber($backoffPlugin); ``` ### Known Issues #### [BUG] Accept-Encoding header behavior changed unintentionally. (See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. See issue #217 for a workaround, or use a version containing the fix. build.xml000064400000004144151742734620006403 0ustar00 composer.json000064400000006716151742734620007313 0ustar00{ "name": "guzzle/guzzle", "type": "library", "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"], "homepage": "http://guzzlephp.org/", "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, { "name": "Guzzle Community", "homepage": "https://github.com/guzzle/guzzle/contributors" } ], "replace": { "guzzle/batch": "self.version", "guzzle/cache": "self.version", "guzzle/common": "self.version", "guzzle/http": "self.version", "guzzle/inflection": "self.version", "guzzle/iterator": "self.version", "guzzle/log": "self.version", "guzzle/parser": "self.version", "guzzle/plugin": "self.version", "guzzle/plugin-async": "self.version", "guzzle/plugin-backoff": "self.version", "guzzle/plugin-cache": "self.version", "guzzle/plugin-cookie": "self.version", "guzzle/plugin-curlauth": "self.version", "guzzle/plugin-error-response": "self.version", "guzzle/plugin-history": "self.version", "guzzle/plugin-log": "self.version", "guzzle/plugin-md5": "self.version", "guzzle/plugin-mock": "self.version", "guzzle/plugin-oauth": "self.version", "guzzle/service": "self.version", "guzzle/stream": "self.version" }, "require": { "php": ">=5.3.2", "ext-curl": "*", "symfony/event-dispatcher": ">=2.1" }, "autoload": { "psr-0": { "Guzzle\\Tests": "tests/", "Guzzle": "src/" } }, "require-dev": { "doctrine/cache": "*", "symfony/class-loader": "*", "monolog/monolog": "1.*", "psr/log": "1.0.*", "zendframework/zend-cache": "2.0.*", "zendframework/zend-log": "2.0.*", "zend/zend-log1": "1.12", "zend/zend-cache1": "1.12", "phpunit/phpunit": "3.7.*" }, "repositories": [ { "type": "composer", "url": "http://packages.zendframework.com/" }, { "type":"package", "package": { "name": "zend/zend-log1", "version": "1.12", "source": { "url": "http://framework.zend.com/svn", "type": "svn", "reference": "framework/standard/trunk/library/Zend/Log/" }, "target-dir": "Zend/Log", "autoload": { "psr-0": { "Zend_Log": "/" } } } }, { "type":"package", "package": { "name": "zend/zend-cache1", "version": "1.12", "source": { "url": "http://framework.zend.com/svn", "type": "svn", "reference": "framework/standard/trunk/library/Zend/Cache/" }, "target-dir": "Zend/Cache", "autoload": { "psr-0": { "Zend_Cache": "/" } } } } ], "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } phar-stub.php000064400000001121151742734620007170 0ustar00registerNamespaces(array( 'Guzzle' => 'phar://guzzle.phar/src', 'Symfony\\Component\\EventDispatcher' => 'phar://guzzle.phar/vendor/symfony/event-dispatcher', 'Doctrine' => 'phar://guzzle.phar/vendor/doctrine/common/lib', 'Monolog' => 'phar://guzzle.phar/vendor/monolog/monolog/src' )); $classLoader->register(); __HALT_COMPILER(); phing/build.properties.dist000064400000000606151742734620012045 0ustar00# you may need to update this if you're working on a fork. guzzle.remote=git@github.com:guzzle/guzzle.git # github credentials -- only used by GitHub API calls to create subtree repos github.basicauth=username:password # for the subtree split and testing github.org=guzzle # your git path cmd.git=git # your composer command cmd.composer=composer # test server start cmd.testserver=nodephing/build.properties.travis000064400000000626151742734620012414 0ustar00# update this if you're working on a fork. guzzle.remote=git@github.com:guzzle/guzzle.git # github credentials -- only used by GitHub API calls to create subtree repos github.basicauth=username:password # for the subtree split and testing github.org=guzzle # your git path cmd.git=/usr/bin/git # your composer command cmd.composer=composer # test server start cmd.testserver="~/.nvm/nvm.sh run v0.6.14"phing/imports/dependencies.xml000064400000005735151742734620012543 0ustar00 Using composer at ${cmd.composer} Using composer at ${cmd.composer} Composer is installed locally using git at ${cmd.git} found git at ${cmd.git} phing/imports/deploy.xml000064400000014050151742734620011377 0ustar00 On branch ${head} working directory clean ${git.status} ChangeLog Match: ${version.changelog} Guzzle\Common\Version Match: ${version.version} releasing: phing -Dnew.version=3.0.x -Dhead=master release -- BEGINNING RELEASE FOR ${new.version} Tip: to create a new release, do: phing -Dnew.version=[TAG] -Dhead=[BRANCH] release phing/imports/metrics.xml000064400000001744151742734620011557 0ustar00 phing/imports/test.xml000064400000002273151742734620011066 0ustar00 phing/tasks/ComposerLintTask.php000064400000007140151742734620012765 0ustar00 * @license http://claylo.mit-license.org/2012/ MIT License */ require_once 'phing/Task.php'; class ComposerLintTask extends Task { protected $dir = null; protected $file = null; protected $passthru = false; protected $composer = null; /** * The setter for the dir * * @param string $str Directory to crawl recursively for composer files */ public function setDir($str) { $this->dir = $str; } /** * The setter for the file * * @param string $str Individual file to validate */ public function setFile($str) { $this->file = $str; } /** * Whether to use PHP's passthru() function instead of exec() * * @param boolean $passthru If passthru shall be used */ public function setPassthru($passthru) { $this->passthru = (bool) $passthru; } /** * Composer to execute. If unset, will attempt composer.phar in project * basedir, and if that fails, will attempt global composer * installation. * * @param string $str Individual file to validate */ public function setComposer($str) { $this->file = $str; } /** * The init method: do init steps */ public function init() { // nothing needed here } /** * The main entry point */ public function main() { if ($this->composer === null) { $this->findComposer(); } $files = array(); if (!empty($this->file) && file_exists($this->file)) { $files[] = $this->file; } if (!empty($this->dir)) { $found = $this->findFiles(); foreach ($found as $file) { $files[] = $this->dir . DIRECTORY_SEPARATOR . $file; } } foreach ($files as $file) { $cmd = $this->composer . ' validate ' . $file; $cmd = escapeshellcmd($cmd); if ($this->passthru) { $retval = null; passthru($cmd, $retval); if ($retval == 1) { throw new BuildException('invalid composer.json'); } } else { $out = array(); $retval = null; exec($cmd, $out, $retval); if ($retval == 1) { $err = join("\n", $out); throw new BuildException($err); } else { $this->log($out[0]); } } } } /** * Find the composer.json files using Phing's directory scanner * * @return array */ protected function findFiles() { $ds = new DirectoryScanner(); $ds->setBasedir($this->dir); $ds->setIncludes(array('**/composer.json')); $ds->scan(); return $ds->getIncludedFiles(); } /** * Find composer installation * */ protected function findComposer() { $basedir = $this->project->getBasedir(); $php = $this->project->getProperty('php.interpreter'); if (file_exists($basedir . '/composer.phar')) { $this->composer = "$php $basedir/composer.phar"; } else { $out = array(); exec('which composer', $out); if (empty($out)) { throw new BuildException( 'Could not determine composer location.' ); } $this->composer = $out[0]; } } } phing/tasks/GuzzlePearPharPackageTask.php000064400000027530151742734620014533 0ustar00 * @license http://claylo.mit-license.org/2012/ MIT License */ require_once 'phing/Task.php'; require_once 'PEAR/PackageFileManager2.php'; require_once 'PEAR/PackageFileManager/File.php'; require_once 'PEAR/Packager.php'; class GuzzlePearPharPackageTask extends Task { private $dir; private $version; private $deploy = true; private $makephar = true; private $subpackages = array(); public function setVersion($str) { $this->version = $str; } public function getVersion() { return $this->version; } public function setDeploy($deploy) { $this->deploy = (bool) $deploy; } public function getDeploy() { return $this->deploy; } public function setMakephar($makephar) { $this->makephar = (bool) $makephar; } public function getMakephar() { return $this->makephar; } private $basedir; private $guzzleinfo; private $changelog_release_date; private $changelog_notes = '-'; public function main() { $this->basedir = $this->getProject()->getBasedir(); if (!is_dir((string) $this->basedir.'/.subsplit')) { throw new BuildException('PEAR packaging requires .subsplit directory'); } // main composer file $composer_file = file_get_contents((string) $this->basedir.'/.subsplit/composer.json'); $this->guzzleinfo = json_decode($composer_file, true); // make sure we have a target $pearwork = (string) $this->basedir . '/build/pearwork'; if (!is_dir($pearwork)) { mkdir($pearwork, 0777, true); } $pearlogs = (string) $this->basedir . '/build/artifacts/logs'; if (!is_dir($pearlogs)) { mkdir($pearlogs, 0777, true); } $version = $this->getVersion(); $this->grabChangelog(); if ($version[0] == '2') { $this->log('building single PEAR package'); $this->buildSinglePackage(); } else { // $this->log("building PEAR subpackages"); // $this->createSubPackages(); // $this->log("building PEAR bundle package"); $this->buildSinglePackage(); } if ($this->getMakephar()) { $this->log("building PHAR"); $this->getProject()->executeTarget('package-phar'); } if ($this->getDeploy()) { $this->doDeployment(); } } public function doDeployment() { $basedir = (string) $this->basedir; $this->log('beginning PEAR/PHAR deployment'); chdir($basedir . '/build/pearwork'); if (is_dir($basedir . '/build/pearwork/guzzle.github.com')) { exec('rm -rf guzzle.github.com'); } passthru('git clone git@github.com:guzzle/guzzle.github.com'); // add PEAR packages foreach (scandir($basedir . '/build/pearwork') as $file) { if (substr($file, -4) == '.tgz') { passthru('pirum add guzzle.github.com/pear '.$file); } } // if we have a new phar, add it if ($this->getMakephar() && file_exists($basedir.'/build/artifacts/guzzle.phar')) { rename($basedir.'/build/artifacts/guzzle.phar', $basedir.'/build/pearwork/guzzle.github.com/guzzle.phar'); } // add and commit chdir($basedir . '/build/pearwork/guzzle.github.com'); passthru('git add --all .'); passthru('git commit -m "Pushing PEAR/PHAR release for '.$this->getVersion().'" && git push'); } public function buildSinglePackage() { $v = $this->getVersion(); $apiversion = $v[0] . '.0.0'; $opts = array( 'packagedirectory' => (string) $this->basedir . '/.subsplit/src/', 'filelistgenerator' => 'file', 'ignore' => array('*composer.json'), 'baseinstalldir' => '/', 'packagefile' => 'package.xml' //'outputdirectory' => (string) $this->basedir . '/build/pearwork/' ); $pfm = new PEAR_PackageFileManager2(); $e = $pfm->setOptions($opts); $pfm->addRole('md', 'doc'); $pfm->addRole('pem', 'php'); $pfm->setPackage('Guzzle'); $pfm->setSummary("Object-oriented PHP HTTP Client for PHP 5.3+"); $pfm->setDescription($this->guzzleinfo['description']); $pfm->setPackageType('php'); $pfm->setChannel('guzzlephp.org/pear'); $pfm->setAPIVersion($apiversion); $pfm->setReleaseVersion($this->getVersion()); $pfm->setAPIStability('stable'); $pfm->setReleaseStability('stable'); $pfm->setNotes($this->changelog_notes); $pfm->setPackageType('php'); $pfm->setLicense('MIT', 'http://github.com/guzzle/guzzle/blob/master/LICENSE'); $pfm->addMaintainer('lead', 'mtdowling', 'Michael Dowling', 'mtdowling@gmail.com', 'yes'); $pfm->setDate($this->changelog_release_date); $pfm->generateContents(); $phpdep = $this->guzzleinfo['require']['php']; $phpdep = str_replace('>=', '', $phpdep); $pfm->setPhpDep($phpdep); $pfm->addExtensionDep('required', 'curl'); $pfm->setPearinstallerDep('1.4.6'); $pfm->addPackageDepWithChannel('required', 'EventDispatcher', 'pear.symfony.com', '2.1.0'); if (!empty($this->subpackages)) { foreach ($this->subpackages as $package) { $pkg = dirname($package); $pkg = str_replace('/', '_', $pkg); $pfm->addConflictingPackageDepWithChannel($pkg, 'guzzlephp.org/pear', false, $apiversion); } } ob_start(); $startdir = getcwd(); chdir((string) $this->basedir . '/build/pearwork'); echo "DEBUGGING GENERATED PACKAGE FILE\n"; $result = $pfm->debugPackageFile(); if ($result) { $out = $pfm->writePackageFile(); echo "\n\n\nWRITE PACKAGE FILE RESULT:\n"; var_dump($out); // load up package file and build package $packager = new PEAR_Packager(); echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n"; $dest_package = $packager->package($opts['packagedirectory'].'package.xml'); var_dump($dest_package); } else { echo "\n\n\nDEBUGGING RESULT:\n"; var_dump($result); } echo "removing package.xml"; unlink($opts['packagedirectory'].'package.xml'); $log = ob_get_clean(); file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package.log', $log); chdir($startdir); } public function createSubPackages() { $version = $this->getVersion(); $this->findComponents(); foreach ($this->subpackages as $package) { $baseinstalldir = dirname($package); $dir = (string) $this->basedir.'/.subsplit/src/' . $baseinstalldir; $composer_file = file_get_contents((string) $this->basedir.'/.subsplit/src/'. $package); $package_info = json_decode($composer_file, true); $this->log('building ' . $package_info['target-dir'] . ' subpackage'); $this->buildSubPackage($dir, $baseinstalldir, $package_info); } } public function buildSubPackage($dir, $baseinstalldir, $info) { $package = str_replace('/', '_', $baseinstalldir); $opts = array( 'packagedirectory' => $dir, 'filelistgenerator' => 'file', 'ignore' => array('*composer.json', '*package.xml'), 'baseinstalldir' => '/' . $info['target-dir'], 'packagefile' => 'package.xml' ); $pfm = new PEAR_PackageFileManager2(); $e = $pfm->setOptions($opts); $pfm->setPackage($package); $pfm->setSummary($info['description']); $pfm->setDescription($info['description']); $pfm->setPackageType('php'); $pfm->setChannel('guzzlephp.org/pear'); $pfm->setAPIVersion('3.0.0'); $pfm->setReleaseVersion($this->getVersion()); $pfm->setAPIStability('stable'); $pfm->setReleaseStability('stable'); $pfm->setNotes($this->changelog_notes); $pfm->setPackageType('php'); $pfm->setLicense('MIT', 'http://github.com/guzzle/guzzle/blob/master/LICENSE'); $pfm->addMaintainer('lead', 'mtdowling', 'Michael Dowling', 'mtdowling@gmail.com', 'yes'); $pfm->setDate($this->changelog_release_date); $pfm->generateContents(); $phpdep = $this->guzzleinfo['require']['php']; $phpdep = str_replace('>=', '', $phpdep); $pfm->setPhpDep($phpdep); $pfm->setPearinstallerDep('1.4.6'); foreach ($info['require'] as $type => $version) { if ($type == 'php') { continue; } if ($type == 'symfony/event-dispatcher') { $pfm->addPackageDepWithChannel('required', 'EventDispatcher', 'pear.symfony.com', '2.1.0'); } if ($type == 'ext-curl') { $pfm->addExtensionDep('required', 'curl'); } if (substr($type, 0, 6) == 'guzzle') { $gdep = str_replace('/', ' ', $type); $gdep = ucwords($gdep); $gdep = str_replace(' ', '_', $gdep); $pfm->addPackageDepWithChannel('required', $gdep, 'guzzlephp.org/pear', $this->getVersion()); } } // can't have main Guzzle package AND sub-packages $pfm->addConflictingPackageDepWithChannel('Guzzle', 'guzzlephp.org/pear', false, $apiversion); ob_start(); $startdir = getcwd(); chdir((string) $this->basedir . '/build/pearwork'); echo "DEBUGGING GENERATED PACKAGE FILE\n"; $result = $pfm->debugPackageFile(); if ($result) { $out = $pfm->writePackageFile(); echo "\n\n\nWRITE PACKAGE FILE RESULT:\n"; var_dump($out); // load up package file and build package $packager = new PEAR_Packager(); echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n"; $dest_package = $packager->package($opts['packagedirectory'].'/package.xml'); var_dump($dest_package); } else { echo "\n\n\nDEBUGGING RESULT:\n"; var_dump($result); } echo "removing package.xml"; unlink($opts['packagedirectory'].'/package.xml'); $log = ob_get_clean(); file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package_'.$package.'.log', $log); chdir($startdir); } public function findComponents() { $ds = new DirectoryScanner(); $ds->setBasedir((string) $this->basedir.'/.subsplit/src'); $ds->setIncludes(array('**/composer.json')); $ds->scan(); $files = $ds->getIncludedFiles(); $this->subpackages = $files; } public function grabChangelog() { $cl = file((string) $this->basedir.'/.subsplit/CHANGELOG.md'); $notes = ''; $in_version = false; $release_date = null; foreach ($cl as $line) { $line = trim($line); if (preg_match('/^\* '.$this->getVersion().' \(([0-9\-]+)\)$/', $line, $matches)) { $release_date = $matches[1]; $in_version = true; continue; } if ($in_version && empty($line) && empty($notes)) { continue; } if ($in_version && ! empty($line)) { $notes .= $line."\n"; } if ($in_version && empty($line) && !empty($notes)) { $in_version = false; } } $this->changelog_release_date = $release_date; if (! empty($notes)) { $this->changelog_notes = $notes; } } } phing/tasks/GuzzleSubSplitTask.php000064400000025227151742734620013323 0ustar00 * @license http://claylo.mit-license.org/2012/ MIT License */ require_once 'phing/tasks/ext/git/GitBaseTask.php'; // base - base of tree to split out // subIndicatorFile - composer.json, package.xml? class GuzzleSubSplitTask extends GitBaseTask { /** * What git repository to pull from and publish to */ protected $remote = null; /** * Publish for comma-separated heads instead of all heads */ protected $heads = null; /** * Publish for comma-separated tags instead of all tags */ protected $tags = null; /** * Base of the tree RELATIVE TO .subsplit working dir */ protected $base = null; /** * The presence of this file will indicate that the directory it resides * in is at the top level of a split. */ protected $subIndicatorFile = 'composer.json'; /** * Do everything except actually send the update. */ protected $dryRun = null; /** * Do not sync any heads. */ protected $noHeads = false; /** * Do not sync any tags. */ protected $noTags = false; /** * The splits we found in the heads */ protected $splits; public function setRemote($str) { $this->remote = $str; } public function getRemote() { return $this->remote; } public function setHeads($str) { $this->heads = explode(',', $str); } public function getHeads() { return $this->heads; } public function setTags($str) { $this->tags = explode(',', $str); } public function getTags() { return $this->tags; } public function setBase($str) { $this->base = $str; } public function getBase() { return $this->base; } public function setSubIndicatorFile($str) { $this->subIndicatorFile = $str; } public function getSubIndicatorFile() { return $this->subIndicatorFile; } public function setDryRun($bool) { $this->dryRun = (bool) $bool; } public function getDryRun() { return $this->dryRun; } public function setNoHeads($bool) { $this->noHeads = (bool) $bool; } public function getNoHeads() { return $this->noHeads; } public function setNoTags($bool) { $this->noTags = (bool) $bool; } public function getNoTags() { return $this->noTags; } /** * GitClient from VersionControl_Git */ protected $client = null; /** * The main entry point */ public function main() { $repo = $this->getRepository(); if (empty($repo)) { throw new BuildException('"repository" is a required parameter'); } $remote = $this->getRemote(); if (empty($remote)) { throw new BuildException('"remote" is a required parameter'); } chdir($repo); $this->client = $this->getGitClient(false, $repo); // initalized yet? if (!is_dir('.subsplit')) { $this->subsplitInit(); } else { // update $this->subsplitUpdate(); } // find all splits based on heads requested $this->findSplits(); // check that GitHub has the repos $this->verifyRepos(); // execute the subsplits $this->publish(); } public function publish() { $this->log('DRY RUN ONLY FOR NOW'); $base = $this->getBase(); $base = rtrim($base, '/') . '/'; $org = $this->getOwningTarget()->getProject()->getProperty('github.org'); $splits = array(); $heads = $this->getHeads(); foreach ($heads as $head) { foreach ($this->splits[$head] as $component => $meta) { $splits[] = $base . $component . ':git@github.com:'. $org.'/'.$meta['repo']; } $cmd = 'git subsplit publish '; $cmd .= escapeshellarg(implode(' ', $splits)); if ($this->getNoHeads()) { $cmd .= ' --no-heads'; } else { $cmd .= ' --heads='.$head; } if ($this->getNoTags()) { $cmd .= ' --no-tags'; } else { if ($this->getTags()) { $cmd .= ' --tags=' . escapeshellarg(implode(' ', $this->getTags())); } } passthru($cmd); } } /** * Runs `git subsplit update` */ public function subsplitUpdate() { $repo = $this->getRepository(); $this->log('git-subsplit update...'); $cmd = $this->client->getCommand('subsplit'); $cmd->addArgument('update'); try { $output = $cmd->execute(); } catch (Exception $e) { throw new BuildException('git subsplit update failed'. $e); } chdir($repo . '/.subsplit'); passthru('php ../composer.phar update --dev'); chdir($repo); } /** * Runs `git subsplit init` based on the remote repository. */ public function subsplitInit() { $remote = $this->getRemote(); $cmd = $this->client->getCommand('subsplit'); $this->log('running git-subsplit init ' . $remote); $cmd->setArguments(array( 'init', $remote )); try { $output = $cmd->execute(); } catch (Exception $e) { throw new BuildException('git subsplit init failed'. $e); } $this->log(trim($output), Project::MSG_INFO); $repo = $this->getRepository(); chdir($repo . '/.subsplit'); passthru('php ../composer.phar install --dev'); chdir($repo); } /** * Find the composer.json files using Phing's directory scanner * * @return array */ protected function findSplits() { $this->log("checking heads for subsplits"); $repo = $this->getRepository(); $base = $this->getBase(); $splits = array(); $heads = $this->getHeads(); if (!empty($base)) { $base = '/' . ltrim($base, '/'); } else { $base = '/'; } chdir($repo . '/.subsplit'); foreach ($heads as $head) { $splits[$head] = array(); // check each head requested *BEFORE* the actual subtree split command gets it passthru("git checkout '$head'"); $ds = new DirectoryScanner(); $ds->setBasedir($repo . '/.subsplit' . $base); $ds->setIncludes(array('**/'.$this->subIndicatorFile)); $ds->scan(); $files = $ds->getIncludedFiles(); // Process the files we found foreach ($files as $file) { $pkg = file_get_contents($repo . '/.subsplit' . $base .'/'. $file); $pkg_json = json_decode($pkg, true); $name = $pkg_json['name']; $component = str_replace('/composer.json', '', $file); // keep this for split cmd $tmpreponame = explode('/', $name); $reponame = $tmpreponame[1]; $splits[$head][$component]['repo'] = $reponame; $nscomponent = str_replace('/', '\\', $component); $splits[$head][$component]['desc'] = "[READ ONLY] Subtree split of $nscomponent: " . $pkg_json['description']; } } // go back to how we found it passthru("git checkout master"); chdir($repo); $this->splits = $splits; } /** * Based on list of repositories we determined we *should* have, talk * to GitHub and make sure they're all there. * */ protected function verifyRepos() { $this->log('verifying GitHub target repos'); $github_org = $this->getOwningTarget()->getProject()->getProperty('github.org'); $github_creds = $this->getOwningTarget()->getProject()->getProperty('github.basicauth'); if ($github_creds == 'username:password') { $this->log('Skipping GitHub repo checks. Update github.basicauth in build.properties to verify repos.', 1); return; } $ch = curl_init('https://api.github.com/orgs/'.$github_org.'/repos?type=all'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERPWD, $github_creds); // change this when we know we can use our bundled CA bundle! curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); curl_close($ch); $repos = json_decode($result, true); $existing_repos = array(); // parse out the repos we found on GitHub foreach ($repos as $repo) { $tmpreponame = explode('/', $repo['full_name']); $reponame = $tmpreponame[1]; $existing_repos[$reponame] = $repo['description']; } $heads = $this->getHeads(); foreach ($heads as $head) { foreach ($this->splits[$head] as $component => $meta) { $reponame = $meta['repo']; if (!isset($existing_repos[$reponame])) { $this->log("Creating missing repo $reponame"); $payload = array( 'name' => $reponame, 'description' => $meta['desc'], 'homepage' => 'http://www.guzzlephp.org/', 'private' => true, 'has_issues' => false, 'has_wiki' => false, 'has_downloads' => true, 'auto_init' => false ); $ch = curl_init('https://api.github.com/orgs/'.$github_org.'/repos'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERPWD, $github_creds); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); // change this when we know we can use our bundled CA bundle! curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); echo "Response code: ".curl_getinfo($ch, CURLINFO_HTTP_CODE)."\n"; curl_close($ch); } else { $this->log("Repo $reponame exists", 2); } } } } } phing/tasks/NodeServerTask.php000064400000005475151742734620012434 0ustar00 * @license http://claylo.mit-license.org/2012/ MIT License */ require_once 'phing/Task.php'; class NodeServerTask extends Task { protected $cmd = null; protected $action = 'start'; protected $serverfile = 'tests/Guzzle/Tests/Http/server.js'; /** * The setter for the start command * * @param string $str How to start the node server */ public function setCmd($str) { $this->cmd = $str; } public function getCmd() { return $this->cmd; } /** * The setter for the action * * @param string $str Start up or shutdown */ public function setAction($str) { $this->action = $str; } public function getAction() { return $this->action; } public function main() { $cmd = $this->getCmd(); $action = $this->getAction(); if (empty($cmd)) { throw new BuildException('"cmd" is a required parameter'); } if ($action == 'start') { $this->startServer(); } else { $this->stopServer(); } } protected function startServer() { chdir(__DIR__ . '/../..'); $serverfile = $this->serverfile; $cmd = $this->getCmd(); // resolve $HOME directory if ($cmd[0] == '~') { $cmd = $_ENV["HOME"] . substr($cmd, 1); } $fp = @fsockopen('127.0.0.1', 8124, $errno, $errstr, 1); if (! $fp) { // need to start node server $cmd = escapeshellcmd($cmd . ' ' . $serverfile); $this->log('starting node test server with '.$cmd); exec($cmd . ' &> /dev/null &'); sleep(2); $fp = @fsockopen('127.0.0.1', 8124, $errno, $errstr, 1); } // test it again if (! $fp) { $this->log('could not start node server'); } else { fclose($fp); $this->log('node test server running'); } } protected function stopServer() { exec('ps axo "pid,command"', $out); $nodeproc = false; foreach ($out as $proc) { if (strpos($proc, $this->serverfile) !== false) { $nodeproc = $proc; break; } } if ($nodeproc) { $proc = trim($nodeproc); $space = strpos($proc, ' '); $pid = substr($proc, 0, $space); $killed = posix_kill($pid, 9); if ($killed) { $this->log('test server stopped'); } else { $this->log('test server appears immortal'); } } else { $this->log('could not find test server in process list'); } } } phpunit.xml.dist000064400000004530151742734620007734 0ustar00 ./tests/Guzzle/Tests ./src/Guzzle ./src/Guzzle ./src/Guzzle/Common/Exception/GuzzleException.php ./src/Guzzle/Http/Exception/HttpException.php ./src/Guzzle/Http/Exception/ServerErrorResponseException.php ./src/Guzzle/Http/Exception/ClientErrorResponseException.php ./src/Guzzle/Http/Exception/TooManyRedirectsException.php ./src/Guzzle/Http/Exception/CouldNotRewindStreamException.php ./src/Guzzle/Common/Exception/BadMethodCallException.php ./src/Guzzle/Common/Exception/InvalidArgumentException.php ./src/Guzzle/Common/Exception/RuntimeException.php ./src/Guzzle/Common/Exception/UnexpectedValueException.php ./src/Guzzle/Service/Exception/ClientNotFoundException.php ./src/Guzzle/Service/Exception/CommandException.php ./src/Guzzle/Service/Exception/DescriptionBuilderException.php ./src/Guzzle/Service/Exception/ServiceBuilderException.php ./src/Guzzle/Service/Exception/ServiceNotFoundException.php ./src/Guzzle/Service/Exception/ValidationException.php ./src/Guzzle/Service/Exception/JsonException.php src/Guzzle/Batch/AbstractBatchDecorator.php000064400000003204151742734620014727 0ustar00decoratedBatch = $decoratedBatch; } /** * Allow decorators to implement custom methods * * @param string $method Missing method name * @param array $args Method arguments * * @return mixed * @codeCoverageIgnore */ public function __call($method, array $args = null) { return call_user_func_array(array($this->decoratedBatch, $method), $args); } /** * {@inheritdoc} */ public function add($item) { $this->decoratedBatch->add($item); return $this; } /** * {@inheritdoc} */ public function flush() { return $this->decoratedBatch->flush(); } /** * {@inheritdoc} */ public function isEmpty() { return $this->decoratedBatch->isEmpty(); } /** * Trace the decorators associated with the batch * * @return array */ public function getDecorators() { $found = array($this); if (method_exists($this->decoratedBatch, 'getDecorators')) { $found = array_merge($found, $this->decoratedBatch->getDecorators()); } return $found; } } src/Guzzle/Batch/Batch.php000064400000006162151742734620011406 0ustar00transferStrategy = $transferStrategy; $this->divisionStrategy = $divisionStrategy; $this->queue = new \SplQueue(); $this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE); $this->dividedBatches = array(); } /** * {@inheritdoc} */ public function add($item) { $this->queue->enqueue($item); return $this; } /** * {@inheritdoc} */ public function flush() { $this->createBatches(); $items = array(); foreach ($this->dividedBatches as $batchIndex => $dividedBatch) { while ($dividedBatch->valid()) { $batch = $dividedBatch->current(); $dividedBatch->next(); try { $this->transferStrategy->transfer($batch); $items = array_merge($items, $batch); } catch (\Exception $e) { throw new BatchTransferException($batch, $items, $e, $this->transferStrategy, $this->divisionStrategy); } } // Keep the divided batch down to a minimum in case of a later exception unset($this->dividedBatches[$batchIndex]); } return $items; } /** * {@inheritdoc} */ public function isEmpty() { return count($this->queue) == 0 && count($this->dividedBatches) == 0; } /** * Create batches for any queued items */ protected function createBatches() { if (count($this->queue)) { if ($batches = $this->divisionStrategy->createBatches($this->queue)) { // Convert arrays into iterators if (is_array($batches)) { $batches = new \ArrayIterator($batches); } $this->dividedBatches[] = $batches; } } } } src/Guzzle/Batch/BatchBuilder.php000064400000013100151742734620012703 0ustar00 'Guzzle\Batch\BatchRequestTransfer', 'command' => 'Guzzle\Batch\BatchCommandTransfer' ); /** * Create a new instance of the BatchBuilder * * @return BatchBuilder */ public static function factory() { return new self(); } /** * Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {@see FlushingBatch}. * * @param $threshold Number of items to allow in the queue before a flush * * @return BatchBuilder */ public function autoFlushAt($threshold) { $this->autoFlush = $threshold; return $this; } /** * Maintain a history of all items that have been transferred using the batch. Adds {@see HistoryBatch}. * * @return BatchBuilder */ public function keepHistory() { $this->history = true; return $this; } /** * Buffer exceptions thrown during transfer so that you can transfer as much as possible, and after a transfer * completes, inspect each exception that was thrown. Enables the {@see ExceptionBufferingBatch} decorator. * * @return BatchBuilder */ public function bufferExceptions() { $this->exceptionBuffering = true; return $this; } /** * Notify a callable each time a batch flush completes. Enables the {@see NotifyingBatch} decorator. * * @param mixed $callable Callable function to notify * * @return BatchBuilder * @throws InvalidArgumentException if the argument is not callable */ public function notify($callable) { $this->afterFlush = $callable; return $this; } /** * Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer} * object as both the transfer and divisor strategy. * * @param int $batchSize Batch size for each batch of requests * * @return BatchBuilder */ public function transferRequests($batchSize = 50) { $className = self::$mapping['request']; $this->transferStrategy = new $className($batchSize); $this->divisorStrategy = $this->transferStrategy; return $this; } /** * Configures the batch to transfer batches commands. Associates as * {@see \Guzzle\Service\Command\BatchCommandTransfer} as both the transfer and divisor strategy. * * @param int $batchSize Batch size for each batch of commands * * @return BatchBuilder */ public function transferCommands($batchSize = 50) { $className = self::$mapping['command']; $this->transferStrategy = new $className($batchSize); $this->divisorStrategy = $this->transferStrategy; return $this; } /** * Specify the strategy used to divide the queue into an array of batches * * @param BatchDivisorInterface $divisorStrategy Strategy used to divide a batch queue into batches * * @return BatchBuilder */ public function createBatchesWith(BatchDivisorInterface $divisorStrategy) { $this->divisorStrategy = $divisorStrategy; return $this; } /** * Specify the strategy used to transport the items when flush is called * * @param BatchTransferInterface $transferStrategy How items are transferred * * @return BatchBuilder */ public function transferWith(BatchTransferInterface $transferStrategy) { $this->transferStrategy = $transferStrategy; return $this; } /** * Create and return the instantiated batch * * @return BatchInterface * @throws RuntimeException if no transfer strategy has been specified */ public function build() { if (!$this->transferStrategy) { throw new RuntimeException('No transfer strategy has been specified'); } if (!$this->divisorStrategy) { throw new RuntimeException('No divisor strategy has been specified'); } $batch = new Batch($this->transferStrategy, $this->divisorStrategy); if ($this->exceptionBuffering) { $batch = new ExceptionBufferingBatch($batch); } if ($this->afterFlush) { $batch = new NotifyingBatch($batch, $this->afterFlush); } if ($this->autoFlush) { $batch = new FlushingBatch($batch, $this->autoFlush); } if ($this->history) { $batch = new HistoryBatch($batch); } return $batch; } } src/Guzzle/Batch/BatchClosureDivisor.php000064400000002261151742734620014277 0ustar00callable = $callable; $this->context = $context; } /** * {@inheritdoc} */ public function createBatches(\SplQueue $queue) { return call_user_func($this->callable, $queue, $this->context); } } src/Guzzle/Batch/BatchClosureTransfer.php000064400000002515151742734620014446 0ustar00callable = $callable; $this->context = $context; } /** * {@inheritDoc} */ public function transfer(array $batch) { return empty($batch) ? null : call_user_func($this->callable, $batch, $this->context); } } src/Guzzle/Batch/BatchCommandTransfer.php000064400000004457151742734620014417 0ustar00batchSize = $batchSize; } /** * Creates batches by grouping commands by their associated client * * {@inheritdoc} */ public function createBatches(\SplQueue $queue) { $groups = new \SplObjectStorage(); foreach ($queue as $item) { if (!$item instanceof CommandInterface) { throw new InvalidArgumentException('All items must implement Guzzle\Service\Command\CommandInterface'); } $client = $item->getClient(); if (!$groups->contains($client)) { $groups->attach($client, new \ArrayObject(array($item))); } else { $groups[$client]->append($item); } } $batches = array(); foreach ($groups as $batch) { $batches = array_merge($batches, array_chunk($groups[$batch]->getArrayCopy(), $this->batchSize)); } return $batches; } /** * {@inheritdoc} */ public function transfer(array $batch) { if (empty($batch)) { return; } // Get the client of the first found command $client = reset($batch)->getClient(); // Keep a list of all commands with invalid clients $invalid = array_filter($batch, function ($command) use ($client) { return $command->getClient() !== $client; }); if (!empty($invalid)) { throw new InconsistentClientTransferException($invalid); } $client->execute($batch); } } src/Guzzle/Batch/BatchDivisorInterface.php000064400000000776151742734620014574 0ustar00batchSize = $batchSize; } /** * Creates batches of requests by grouping requests by their associated curl multi object. * * {@inheritdoc} */ public function createBatches(\SplQueue $queue) { // Create batches by curl multi object groups $groups = new \SplObjectStorage(); foreach ($queue as $item) { if (!$item instanceof RequestInterface) { throw new InvalidArgumentException('All items must implement Guzzle\Http\Message\RequestInterface'); } $multi = $item->getClient()->getCurlMulti(); if (!$groups->contains($multi)) { $groups->attach($multi, new \ArrayObject(array($item))); } else { $groups[$multi]->append($item); } } $batches = array(); foreach ($groups as $batch) { $batches = array_merge($batches, array_chunk($groups[$batch]->getArrayCopy(), $this->batchSize)); } return $batches; } /** * {@inheritdoc} */ public function transfer(array $batch) { if (empty($batch)) { return; } $multi = reset($batch)->getClient()->getCurlMulti(); // Prepare each request for their respective curl multi objects foreach ($batch as $request) { $multi->add($request); } $multi->send(); } } src/Guzzle/Batch/BatchSizeDivisor.php000064400000001650151742734620013576 0ustar00size = $size; } /** * Set the size of each batch * * @param int $size Size of each batch * * @return BatchSizeDivisor */ public function setSize($size) { $this->size = $size; return $this; } /** * Get the size of each batch * * @return int */ public function getSize() { return $this->size; } /** * {@inheritdoc} */ public function createBatches(\SplQueue $queue) { return array_chunk(iterator_to_array($queue, false), $this->size); } } src/Guzzle/Batch/BatchTransferInterface.php000064400000000434151742734620014730 0ustar00batch = $batch; $this->transferredItems = $transferredItems; $this->transferStrategy = $transferStrategy; $this->divisorStrategy = $divisorStrategy; parent::__construct( 'Exception encountered while transferring batch: ' . $exception->getMessage(), $exception->getCode(), $exception ); } /** * Get the batch that we being sent when the exception occurred * * @return array */ public function getBatch() { return $this->batch; } /** * Get the items transferred at the point in which the exception was encountered * * @return array */ public function getTransferredItems() { return $this->transferredItems; } /** * Get the transfer strategy * * @return TransferStrategy */ public function getTransferStrategy() { return $this->transferStrategy; } /** * Get the divisor strategy * * @return DivisorStrategy */ public function getDivisorStrategy() { return $this->divisorStrategy; } } src/Guzzle/Batch/ExceptionBufferingBatch.php000064400000002410151742734620015105 0ustar00decoratedBatch->isEmpty()) { try { $transferredItems = $this->decoratedBatch->flush(); } catch (BatchTransferException $e) { $this->exceptions[] = $e; $transferredItems = $e->getTransferredItems(); } $items = array_merge($items, $transferredItems); } return $items; } /** * Get the buffered exceptions * * @return array Array of BatchTransferException objects */ public function getExceptions() { return $this->exceptions; } /** * Clear the buffered exceptions */ public function clearExceptions() { $this->exceptions = array(); } } src/Guzzle/Batch/FlushingBatch.php000064400000002774151742734620013113 0ustar00threshold = $threshold; parent::__construct($decoratedBatch); } /** * Set the auto-flush threshold * * @param int $threshold The auto-flush threshold * * @return FlushingBatch */ public function setThreshold($threshold) { $this->threshold = $threshold; return $this; } /** * Get the auto-flush threshold * * @return int */ public function getThreshold() { return $this->threshold; } /** * {@inheritdoc} */ public function add($item) { $this->decoratedBatch->add($item); if (++$this->currentTotal >= $this->threshold) { $this->currentTotal = 0; $this->decoratedBatch->flush(); } return $this; } } src/Guzzle/Batch/HistoryBatch.php000064400000001447151742734620012771 0ustar00history[] = $item; $this->decoratedBatch->add($item); return $this; } /** * Get the batch history * * @return array */ public function getHistory() { return $this->history; } /** * Clear the batch history */ public function clearHistory() { $this->history = array(); } } src/Guzzle/Batch/NotifyingBatch.php000064400000001756151742734620013301 0ustar00callable = $callable; parent::__construct($decoratedBatch); } /** * {@inheritdoc} */ public function flush() { $items = $this->decoratedBatch->flush(); call_user_func($this->callable, $items); return $items; } } src/Guzzle/Batch/composer.json000064400000001457151742734620012400 0ustar00{ "name": "guzzle/batch", "description": "Guzzle batch component for batching requests, commands, or custom transfers", "homepage": "http://guzzlephp.org/", "keywords": ["batch", "HTTP", "REST", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/common": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Batch": "" } }, "suggest": { "guzzle/http": "self.version", "guzzle/service": "self.version" }, "target-dir": "Guzzle/Batch", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Cache/AbstractCacheAdapter.php000064400000000507151742734620014334 0ustar00cache; } } src/Guzzle/Cache/CacheAdapterFactory.php000064400000006256151742734620014207 0ustar00newInstanceArgs($args); } } catch (\Exception $e) { throw new RuntimeException($e->getMessage(), $e->getCode(), $e); } } } src/Guzzle/Cache/CacheAdapterInterface.php000064400000003353151742734620014473 0ustar00callables = $callables; } /** * {@inheritdoc} */ public function contains($id, array $options = null) { return call_user_func($this->callables['contains'], $id, $options); } /** * {@inheritdoc} */ public function delete($id, array $options = null) { return call_user_func($this->callables['delete'], $id, $options); } /** * {@inheritdoc} */ public function fetch($id, array $options = null) { return call_user_func($this->callables['fetch'], $id, $options); } /** * {@inheritdoc} */ public function save($id, $data, $lifeTime = false, array $options = null) { return call_user_func($this->callables['save'], $id, $data, $lifeTime, $options); } } src/Guzzle/Cache/DoctrineCacheAdapter.php000064400000002002151742734620014330 0ustar00cache = $cache; } /** * {@inheritdoc} */ public function contains($id, array $options = null) { return $this->cache->contains($id); } /** * {@inheritdoc} */ public function delete($id, array $options = null) { return $this->cache->delete($id); } /** * {@inheritdoc} */ public function fetch($id, array $options = null) { return $this->cache->fetch($id); } /** * {@inheritdoc} */ public function save($id, $data, $lifeTime = false, array $options = null) { return $this->cache->save($id, $data, $lifeTime); } } src/Guzzle/Cache/NullCacheAdapter.php000064400000001451151742734620013502 0ustar00cache = $cache; } /** * {@inheritdoc} */ public function contains($id, array $options = null) { return $this->cache->test($id); } /** * {@inheritdoc} */ public function delete($id, array $options = null) { return $this->cache->remove($id); } /** * {@inheritdoc} */ public function fetch($id, array $options = null) { return $this->cache->load($id); } /** * {@inheritdoc} */ public function save($id, $data, $lifeTime = false, array $options = null) { return $this->cache->save($data, $id, array(), $lifeTime); } } src/Guzzle/Cache/Zf2CacheAdapter.php000064400000002053151742734620013230 0ustar00cache = $cache; } /** * {@inheritdoc} */ public function contains($id, array $options = null) { return $this->cache->hasItem($id); } /** * {@inheritdoc} */ public function delete($id, array $options = null) { return $this->cache->removeItem($id); } /** * {@inheritdoc} */ public function fetch($id, array $options = null) { return $this->cache->getItem($id); } /** * {@inheritdoc} */ public function save($id, $data, $lifeTime = false, array $options = null) { return $this->cache->setItem($id, $data); } } src/Guzzle/Cache/composer.json000064400000001247151742734620012357 0ustar00{ "name": "guzzle/cache", "description": "Guzzle cache adapter component", "homepage": "http://guzzlephp.org/", "keywords": ["cache", "adapter", "zf", "doctrine", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/common": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Cache": "" } }, "target-dir": "Guzzle/Cache", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Common/AbstractHasDispatcher.php000064400000002551151742734620015000 0ustar00eventDispatcher = $eventDispatcher; return $this; } /** * {@inheritdoc} */ public function getEventDispatcher() { if (!$this->eventDispatcher) { $this->eventDispatcher = new EventDispatcher(); } return $this->eventDispatcher; } /** * {@inheritdoc} */ public function dispatch($eventName, array $context = array()) { $this->getEventDispatcher()->dispatch($eventName, new Event($context)); } /** * {@inheritdoc} */ public function addSubscriber(EventSubscriberInterface $subscriber) { $this->getEventDispatcher()->addSubscriber($subscriber); return $this; } } src/Guzzle/Common/Collection.php000064400000027122151742734620012666 0ustar00data = $data ?: array(); } /** * Create a new collection from an array, validate the keys, and add default values where missing * * @param array $config Configuration values to apply. * @param array $defaults Default parameters * @param array $required Required parameter names * * @return self * @throws InvalidArgumentException if a parameter is missing */ public static function fromConfig(array $config = null, array $defaults = null, array $required = null) { $collection = new self($defaults); foreach ((array) $config as $key => $value) { $collection->set($key, $value); } foreach ((array) $required as $key) { if ($collection->hasKey($key) === false) { throw new InvalidArgumentException("Config must contain a '{$key}' key"); } } return $collection; } /** * Add a value to a key. If a key of the same name has already been added, the key value will be converted into an * array and the new value will be pushed to the end of the array. * * @param string $key Key to add * @param mixed $value Value to add to the key * * @return Collection Returns a reference to the object. */ public function add($key, $value) { if (!array_key_exists($key, $this->data)) { $this->data[$key] = $value; } elseif (is_array($this->data[$key])) { $this->data[$key][] = $value; } else { $this->data[$key] = array($this->data[$key], $value); } return $this; } /** * Removes all key value pairs * * @return Collection */ public function clear() { $this->data = array(); return $this; } /** * Return the number of keys * * @return integer */ public function count() { return count($this->data); } /** * Iterates over each key value pair in the collection passing them to the Closure. If the Closure function returns * true, the current value from input is returned into the result Collection. The Closure must accept three * parameters: (string) $key, (string) $value and return Boolean TRUE or FALSE for each value. * * @param \Closure $closure Closure evaluation function * @param bool $static Set to TRUE to use the same class as the return rather than returning a Collection * * @return Collection */ public function filter(\Closure $closure, $static = true) { $collection = ($static) ? new static() : new self(); foreach ($this->data as $key => $value) { if ($closure($key, $value)) { $collection->add($key, $value); } } return $collection; } /** * Get an iterator object * * @return array */ public function getIterator() { return new \ArrayIterator($this->data); } /** * Get a specific key value. * * @param string $key Key to retrieve. * * @return mixed|null Value of the key or NULL */ public function get($key) { return isset($this->data[$key]) ? $this->data[$key] : null; } /** * Get all or a subset of matching key value pairs * * @param array $keys Pass an array of keys to retrieve only a subset of key value pairs * * @return array Returns an array of all matching key value pairs */ public function getAll(array $keys = null) { return $keys ? array_intersect_key($this->data, array_flip($keys)) : $this->data; } /** * {@inheritdoc} */ public function toArray() { return $this->data; } /** * Get all keys in the collection * * @return array */ public function getKeys() { return array_keys($this->data); } /** * Returns whether or not the specified key is present. * * @param string $key The key for which to check the existence. * * @return bool */ public function hasKey($key) { return array_key_exists($key, $this->data); } /** * Case insensitive search the keys in the collection * * @param string $key Key to search for * * @return bool|string Returns false if not found, otherwise returns the key */ public function keySearch($key) { foreach (array_keys($this->data) as $k) { if (!strcasecmp($k, $key)) { return $k; } } return false; } /** * Checks if any keys contains a certain value * * @param string $value Value to search for * * @return mixed Returns the key if the value was found FALSE if the value was not found. */ public function hasValue($value) { return array_search($value, $this->data); } /** * Returns a Collection containing all the elements of the collection after applying the callback function to each * one. The Closure should accept three parameters: (string) $key, (string) $value, (array) $context and return a * modified value * * @param \Closure $closure Closure to apply * @param array $context Context to pass to the closure * @param bool $static Set to TRUE to use the same class as the return rather than returning a Collection * * @return Collection */ public function map(\Closure $closure, array $context = array(), $static = true) { $collection = $static ? new static() : new self(); foreach ($this as $key => $value) { $collection->add($key, $closure($key, $value, $context)); } return $collection; } /** * Add and merge in a Collection or array of key value pair data. * * @param Collection|array $data Associative array of key value pair data * * @return Collection Returns a reference to the object. */ public function merge($data) { if ($data instanceof self) { $data = $data->getAll(); } elseif (!is_array($data)) { return $this; } if (empty($this->data)) { $this->data = $data; } else { foreach ($data as $key => $value) { $this->add($key, $value); } } return $this; } /** * ArrayAccess implementation of offsetExists() * * @param string $offset Array key * * @return bool */ public function offsetExists($offset) { return $this->hasKey($offset) !== false; } /** * ArrayAccess implementation of offsetGet() * * @param string $offset Array key * * @return null|mixed */ public function offsetGet($offset) { return $this->get($offset); } /** * ArrayAccess implementation of offsetGet() * * @param string $offset Array key * @param mixed $value Value to set */ public function offsetSet($offset, $value) { $this->set($offset, $value); } /** * ArrayAccess implementation of offsetUnset() * * @param string $offset Array key */ public function offsetUnset($offset) { $this->remove($offset); } /** * Remove a specific key value pair * * @param string $key A key to remove * * @return Collection */ public function remove($key) { unset($this->data[$key]); return $this; } /** * Replace the data of the object with the value of an array * * @param array $data Associative array of data * * @return Collection Returns a reference to the object */ public function replace(array $data) { $this->data = $data; return $this; } /** * Set a key value pair * * @param string $key Key to set * @param mixed $value Value to set * * @return Collection Returns a reference to the object */ public function set($key, $value) { $this->data[$key] = $value; return $this; } /** * Inject configuration settings into an input string * * @param string $input Input to inject * * @return string */ public function inject($input) { $replace = array(); foreach ($this->data as $key => $val) { $replace['{' . $key . '}'] = $val; } return strtr($input, $replace); } /** * Gets a value from the collection using an array path (e.g. foo/baz/bar would retrieve bar from two nested arrays) * Allows for wildcard searches which recursively combine matches up to the level at which the wildcard occurs. This * can be useful for accepting any key of a sub-array and combining matching keys from each diverging path. * * @param string $path Path to traverse and retrieve a value from * @param string $separator Character used to add depth to the search * @param mixed $data Optional data to descend into (used when wildcards are encountered) * * @return mixed|null */ public function getPath($path, $separator = '/', $data = null) { // Assume the data of the collection if no data was passed into the method if ($data === null) { $data = &$this->data; } // Break the path into an array if needed if (!is_array($path)) { $path = explode($separator, $path); } // Using an iterative approach rather than recursion for speed while (null !== ($part = array_shift($path))) { if (!is_array($data)) { return null; } // The value does not exist in the array or the path has more but the value is not an array if (!isset($data[$part])) { // Not using a wildcard and the key was not found, so return null if ($part != '*') { return null; } // If using a wildcard search, then diverge and combine paths $result = array(); foreach ($data as $value) { if (!$path) { $result = array_merge_recursive($result, (array) $value); } else { $test = $this->getPath($path, $separator, $value); if ($test !== null) { $result = array_merge_recursive($result, (array) $test); } } } return $result; } // Descend deeper into the data $data = &$data[$part]; } return $data; } /** * Over write key value pairs in this collection with all of the data from an array or collection. * * @param array|\Traversable $data Values to override over this config * * @return self */ public function overwriteWith($data) { foreach ($data as $k => $v) { $this->set($k, $v); } return $this; } } src/Guzzle/Common/Event.php000064400000002502151742734620011647 0ustar00context = $context; } /** * {@inheritdoc} */ public function getIterator() { return new \ArrayIterator($this->context); } /** * {@inheritdoc} */ public function offsetGet($offset) { return array_key_exists($offset, $this->context) ? $this->context[$offset] : null; } /** * {@inheritdoc} */ public function offsetSet($offset, $value) { $this->context[$offset] = $value; } /** * {@inheritdoc} */ public function offsetExists($offset) { return array_key_exists($offset, $this->context); } /** * {@inheritdoc} */ public function offsetUnset($offset) { unset($this->context[$offset]); } /** * {@inheritdoc} */ public function toArray() { return $this->context; } } src/Guzzle/Common/Exception/BadMethodCallException.php000064400000000206151742734620017025 0ustar00exceptions = $exceptions; return $this; } /** * Add exceptions to the collection * * @param ExceptionCollection|\Exception $e Exception to add * * @return ExceptionCollection; */ public function add($e) { if ($this->message) { $this->message .= "\n"; } if ($e instanceof self) { foreach ($e as $exception) { $this->exceptions[] = $exception; $this->message .= $e->getMessage() . "\n"; } } elseif ($e instanceof \Exception) { $this->exceptions[] = $e; $this->message .= $e->getMessage(); } $this->message = rtrim($this->message); return $this; } /** * Get the total number of request exceptions * * @return int */ public function count() { return count($this->exceptions); } /** * Allows array-like iteration over the request exceptions * * @return \ArrayIterator */ public function getIterator() { return new \ArrayIterator($this->exceptions); } /** * Get the first exception in the collection * * @return \Exception */ public function getFirst() { return $this->exceptions ? $this->exceptions[0] : null; } } src/Guzzle/Common/Exception/GuzzleException.php000064400000000144151742734620015663 0ustar00=5.3.2", "symfony/event-dispatcher": ">=2.1" }, "autoload": { "psr-0": { "Guzzle\\Common": "" } }, "target-dir": "Guzzle/Common", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Http/AbstractEntityBodyDecorator.php000064400000012224151742734620015700 0ustar00body = $body; } /** * {@inheritdoc} */ public function __toString() { return (string) $this->body; } /** * Allow decorators to implement custom methods * * @param string $method Missing method name * @param array $args Method arguments * * @return mixed */ public function __call($method, array $args = null) { return call_user_func_array(array($this->body, $method), $args); } /** * {@inheritdoc} */ public function close() { return $this->body->close(); } /** * {@inheritdoc} */ public function setRewindFunction($callable) { $this->body->setRewindFunction($callable); return $this; } /** * {@inheritdoc} */ public function rewind() { return $this->body->rewind(); } /** * {@inheritdoc} */ public function compress($filter = 'zlib.deflate') { return $this->body->compress($filter); } /** * {@inheritdoc} */ public function uncompress($filter = 'zlib.inflate') { return $this->body->uncompress($filter); } /** * {@inheritdoc} */ public function getContentLength() { return $this->getSize(); } /** * {@inheritdoc} */ public function getContentType() { return $this->body->getContentType(); } /** * {@inheritdoc} */ public function getContentMd5($rawOutput = false, $base64Encode = false) { $hash = Stream::getHash($this, 'md5', $rawOutput); return $hash && $base64Encode ? base64_encode($hash) : $hash; } /** * {@inheritdoc} */ public function getContentEncoding() { return $this->body->getContentEncoding(); } /** * {@inheritdoc} */ public function getMetaData($key = null) { return $this->body->getMetaData($key); } /** * {@inheritdoc} */ public function getStream() { return $this->body->getStream(); } /** * {@inheritdoc} */ public function setStream($stream, $size = 0) { $this->body->setStream($stream, $size); return $this; } /** * {@inheritdoc} */ public function getWrapper() { return $this->body->getWrapper(); } /** * {@inheritdoc} */ public function getWrapperData() { return $this->body->getWrapperData(); } /** * {@inheritdoc} */ public function getStreamType() { return $this->body->getStreamType(); } /** * {@inheritdoc} */ public function getUri() { return $this->body->getUri(); } /** * {@inheritdoc} */ public function getSize() { return $this->body->getSize(); } /** * {@inheritdoc} */ public function isReadable() { return $this->body->isReadable(); } /** * {@inheritdoc} */ public function isWritable() { return $this->body->isWritable(); } /** * {@inheritdoc} */ public function isConsumed() { return $this->body->isConsumed(); } /** * Alias of isConsumed() * {@inheritdoc} */ public function feof() { return $this->isConsumed(); } /** * {@inheritdoc} */ public function isLocal() { return $this->body->isLocal(); } /** * {@inheritdoc} */ public function isSeekable() { return $this->body->isSeekable(); } /** * {@inheritdoc} */ public function setSize($size) { $this->body->setSize($size); return $this; } /** * {@inheritdoc} */ public function seek($offset, $whence = SEEK_SET) { return $this->body->seek($offset, $whence); } /** * {@inheritdoc} */ public function read($length) { return $this->body->read($length); } /** * {@inheritdoc} */ public function write($string) { return $this->body->write($string); } /** * {@inheritdoc} */ public function readLine($maxLength = null) { return $this->body->readLine($maxLength); } /** * {@inheritdoc} */ public function ftell() { return $this->body->ftell(); } /** * {@inheritdoc} */ public function getCustomData($key) { return $this->body->getCustomData($key); } /** * {@inheritdoc} */ public function setCustomData($key, $value) { $this->body->setCustomData($key, $value); return $this; } } src/Guzzle/Http/CachingEntityBody.php000064400000015246151742734620013635 0ustar00remoteStream = $body; $this->body = new EntityBody(fopen('php://temp', 'r+')); } /** * Will give the contents of the buffer followed by the exhausted remote stream. * * Warning: Loads the entire stream into memory * * @return string */ public function __toString() { $pos = $this->ftell(); $this->rewind(); $str = ''; while (!$this->isConsumed()) { $str .= $this->read(16384); } $this->seek($pos); return $str; } /** * {@inheritdoc} */ public function getSize() { return max($this->body->getSize(), $this->remoteStream->getSize()); } /** * {@inheritdoc} * @throws RuntimeException When seeking with SEEK_END or when seeking past the total size of the buffer stream */ public function seek($offset, $whence = SEEK_SET) { if ($whence == SEEK_SET) { $byte = $offset; } elseif ($whence == SEEK_CUR) { $byte = $offset + $this->ftell(); } else { throw new RuntimeException(__CLASS__ . ' supports only SEEK_SET and SEEK_CUR seek operations'); } // You cannot skip ahead past where you've read from the remote stream if ($byte > $this->body->getSize()) { throw new RuntimeException( "Cannot seek to byte {$byte} when the buffered stream only contains {$this->body->getSize()} bytes" ); } return $this->body->seek($byte); } /** * {@inheritdoc} */ public function rewind() { return $this->seek(0); } /** * Does not support custom rewind functions * * @throws RuntimeException */ public function setRewindFunction($callable) { throw new RuntimeException(__CLASS__ . ' does not support custom stream rewind functions'); } /** * {@inheritdoc} */ public function read($length) { // Perform a regular read on any previously read data from the buffer $data = $this->body->read($length); $remaining = $length - strlen($data); // More data was requested so read from the remote stream if ($remaining) { // If data was written to the buffer in a position that would have been filled from the remote stream, // then we must skip bytes on the remote stream to emulate overwriting bytes from that position. This // mimics the behavior of other PHP stream wrappers. $remoteData = $this->remoteStream->read($remaining + $this->skipReadBytes); if ($this->skipReadBytes) { $len = strlen($remoteData); $remoteData = substr($remoteData, $this->skipReadBytes); $this->skipReadBytes = max(0, $this->skipReadBytes - $len); } $data .= $remoteData; $this->body->write($remoteData); } return $data; } /** * {@inheritdoc} */ public function write($string) { // When appending to the end of the currently read stream, you'll want to skip bytes from being read from // the remote stream to emulate other stream wrappers. Basically replacing bytes of data of a fixed length. $overflow = (strlen($string) + $this->ftell()) - $this->remoteStream->ftell(); if ($overflow > 0) { $this->skipReadBytes += $overflow; } return $this->body->write($string); } /** * {@inheritdoc} * @link http://php.net/manual/en/function.fgets.php */ public function readLine($maxLength = null) { $buffer = ''; $size = 0; while (!$this->isConsumed()) { $byte = $this->read(1); $buffer .= $byte; // Break when a new line is found or the max length - 1 is reached if ($byte == PHP_EOL || ++$size == $maxLength - 1) { break; } } return $buffer; } /** * {@inheritdoc} */ public function isConsumed() { return $this->body->isConsumed() && $this->remoteStream->isConsumed(); } /** * Close both the remote stream and buffer stream */ public function close() { return $this->remoteStream->close() && $this->body->close(); } /** * {@inheritdoc} */ public function setStream($stream, $size = 0) { $this->remoteStream->setStream($stream, $size); } /** * {@inheritdoc} */ public function getContentType() { return $this->remoteStream->getContentType(); } /** * {@inheritdoc} */ public function getContentEncoding() { return $this->remoteStream->getContentEncoding(); } /** * {@inheritdoc} */ public function getMetaData($key = null) { return $this->remoteStream->getMetaData($key); } /** * {@inheritdoc} */ public function getStream() { return $this->remoteStream->getStream(); } /** * {@inheritdoc} */ public function getWrapper() { return $this->remoteStream->getWrapper(); } /** * {@inheritdoc} */ public function getWrapperData() { return $this->remoteStream->getWrapperData(); } /** * {@inheritdoc} */ public function getStreamType() { return $this->remoteStream->getStreamType(); } /** * {@inheritdoc} */ public function getUri() { return $this->remoteStream->getUri(); } /** * Always retrieve custom data from the remote stream * * {@inheritdoc} */ public function getCustomData($key) { return $this->remoteStream->getCustomData($key); } /** * Always set custom data on the remote stream * * {@inheritdoc} */ public function setCustomData($key, $value) { $this->remoteStream->setCustomData($key, $value); return $this; } } src/Guzzle/Http/Client.php000064400000034054151742734620011502 0ustar00setConfig($config ?: new Collection()); // Allow ssl.certificate_authority config setting to control the certificate authority used by curl $authority = $this->config->get(self::SSL_CERT_AUTHORITY); // Set the SSL certificate if ($authority !== 'system') { if ($authority === null) { $authority = true; } if ($authority === true && substr(__FILE__, 0, 7) == 'phar://') { $authority = $this->preparePharCacert(); } $this->setSslVerification($authority); } $this->setBaseUrl($baseUrl); $this->defaultHeaders = new Collection(); $this->setRequestFactory(RequestFactory::getInstance()); // Redirect by default, but allow for redirects to be globally disabled on a client if (!$this->config->get(self::DISABLE_REDIRECTS)) { $this->addSubscriber(new RedirectPlugin()); } // Set the default User-Agent on the client $this->userAgent = $this->getDefaultUserAgent(); } /** * {@inheritdoc} */ final public function setConfig($config) { // Set the configuration object if ($config instanceof Collection) { $this->config = $config; } elseif (is_array($config)) { $this->config = new Collection($config); } else { throw new InvalidArgumentException( 'Config must be an array or Collection' ); } return $this; } /** * {@inheritdoc} */ final public function getConfig($key = false) { return $key ? $this->config->get($key) : $this->config; } /** * {@inheritdoc} */ final public function setSslVerification($certificateAuthority = true, $verifyPeer = true, $verifyHost = 2) { $opts = $this->config->get(self::CURL_OPTIONS) ?: array(); if ($certificateAuthority === true) { // use bundled CA bundle, set secure defaults $opts[CURLOPT_CAINFO] = __DIR__ . '/Resources/cacert.pem'; $opts[CURLOPT_SSL_VERIFYPEER] = true; $opts[CURLOPT_SSL_VERIFYHOST] = 2; } elseif ($certificateAuthority === false) { unset($opts[CURLOPT_CAINFO]); $opts[CURLOPT_SSL_VERIFYPEER] = false; $opts[CURLOPT_SSL_VERIFYHOST] = 2; } elseif ($verifyPeer !== true && $verifyPeer !== false && $verifyPeer !== 1 && $verifyPeer !== 0) { throw new InvalidArgumentException('verifyPeer must be 1, 0 or boolean'); } elseif ($verifyHost !== 0 && $verifyHost !== 1 && $verifyHost !== 2) { throw new InvalidArgumentException('verifyHost must be 0, 1 or 2'); } else { $opts[CURLOPT_SSL_VERIFYPEER] = $verifyPeer; $opts[CURLOPT_SSL_VERIFYHOST] = $verifyHost; if (is_file($certificateAuthority)) { unset($opts[CURLOPT_CAPATH]); $opts[CURLOPT_CAINFO] = $certificateAuthority; } elseif (is_dir($certificateAuthority)) { unset($opts[CURLOPT_CAINFO]); $opts[CURLOPT_CAPATH] = $certificateAuthority; } else { throw new RuntimeException( 'Invalid option passed to ' . self::SSL_CERT_AUTHORITY . ': ' . $certificateAuthority ); } } $this->config->set(self::CURL_OPTIONS, $opts); return $this; } /** * {@inheritdoc} */ public function getDefaultHeaders() { return $this->defaultHeaders; } /** * {@inheritdoc} */ public function setDefaultHeaders($headers) { if ($headers instanceof Collection) { $this->defaultHeaders = $headers; } elseif (is_array($headers)) { $this->defaultHeaders = new Collection($headers); } else { throw new InvalidArgumentException('Headers must be an array or Collection'); } return $this; } /** * {@inheritdoc} */ public function expandTemplate($template, array $variables = null) { $expansionVars = $this->getConfig()->getAll(); if ($variables) { $expansionVars = array_merge($expansionVars, $variables); } return $this->getUriTemplate()->expand($template, $expansionVars); } /** * {@inheritdoc} */ public function setUriTemplate(UriTemplateInterface $uriTemplate) { $this->uriTemplate = $uriTemplate; return $this; } /** * {@inheritdoc} */ public function getUriTemplate() { if (!$this->uriTemplate) { $this->uriTemplate = ParserRegistry::getInstance()->getParser('uri_template'); } return $this->uriTemplate; } /** * {@inheritdoc} */ public function createRequest($method = RequestInterface::GET, $uri = null, $headers = null, $body = null) { if (!is_array($uri)) { $templateVars = null; } else { if (count($uri) != 2 || !isset($uri[1]) || !is_array($uri[1])) { throw new InvalidArgumentException( 'You must provide a URI template followed by an array of template variables ' . 'when using an array for a URI template' ); } list($uri, $templateVars) = $uri; } if (!$uri) { $url = $this->getBaseUrl(); } elseif (substr($uri, 0, 4) === 'http') { // Use absolute URLs as-is $url = $this->expandTemplate($uri, $templateVars); } else { $url = Url::factory($this->getBaseUrl())->combine($this->expandTemplate($uri, $templateVars)); } // If default headers are provided, then merge them into existing headers // If a collision occurs, the header is completely replaced if (count($this->defaultHeaders)) { if (is_array($headers)) { $headers = array_merge($this->defaultHeaders->getAll(), $headers); } elseif ($headers instanceof Collection) { $headers = array_merge($this->defaultHeaders->getAll(), $headers->getAll()); } else { $headers = $this->defaultHeaders; } } return $this->prepareRequest( $this->requestFactory->create($method, (string) $url, $headers, $body) ); } /** * {@inheritdoc} */ public function getBaseUrl($expand = true) { return $expand ? $this->expandTemplate($this->baseUrl) : $this->baseUrl; } /** * {@inheritdoc} */ public function setBaseUrl($url) { $this->baseUrl = $url; return $this; } /** * {@inheritdoc} */ public function setUserAgent($userAgent, $includeDefault = false) { if ($includeDefault) { $userAgent .= ' ' . $this->getDefaultUserAgent(); } $this->userAgent = $userAgent; return $this; } /** * Get the default User-Agent string to use with Guzzle * * @return string */ public function getDefaultUserAgent() { return 'Guzzle/' . Version::VERSION . ' curl/' . CurlVersion::getInstance()->get('version') . ' PHP/' . PHP_VERSION; } /** * {@inheritdoc} */ public function get($uri = null, $headers = null, $body = null) { return $this->createRequest('GET', $uri, $headers, $body); } /** * {@inheritdoc} */ public function head($uri = null, $headers = null) { return $this->createRequest('HEAD', $uri, $headers); } /** * {@inheritdoc} */ public function delete($uri = null, $headers = null, $body = null) { return $this->createRequest('DELETE', $uri, $headers, $body); } /** * {@inheritdoc} */ public function put($uri = null, $headers = null, $body = null) { return $this->createRequest('PUT', $uri, $headers, $body); } /** * {@inheritdoc} */ public function patch($uri = null, $headers = null, $body = null) { return $this->createRequest('PATCH', $uri, $headers, $body); } /** * {@inheritdoc} */ public function post($uri = null, $headers = null, $postBody = null) { return $this->createRequest('POST', $uri, $headers, $postBody); } /** * {@inheritdoc} */ public function options($uri = null) { return $this->createRequest('OPTIONS', $uri); } /** * {@inheritdoc} */ public function send($requests) { $curlMulti = $this->getCurlMulti(); $multipleRequests = !($requests instanceof RequestInterface); if (!$multipleRequests) { $requests = array($requests); } foreach ($requests as $request) { $curlMulti->add($request); } try { $curlMulti->send(); } catch (ExceptionCollection $e) { throw $multipleRequests ? $e : $e->getFirst(); } if (!$multipleRequests) { return end($requests)->getResponse(); } else { return array_map(function ($request) { return $request->getResponse(); }, $requests); } } /** * {@inheritdoc} */ public function setCurlMulti(CurlMultiInterface $curlMulti) { $this->curlMulti = $curlMulti; return $this; } /** * {@inheritdoc} */ public function getCurlMulti() { if (!$this->curlMulti) { $this->curlMulti = new CurlMulti(); } return $this->curlMulti; } /** * {@inheritdoc} */ public function setRequestFactory(RequestFactoryInterface $factory) { $this->requestFactory = $factory; return $this; } /** * Prepare a request to be sent from the Client by adding client specific behaviors and properties to the request. * * @param RequestInterface $request Request to prepare for the client * * @return RequestInterface */ protected function prepareRequest(RequestInterface $request) { $request->setClient($this); // Add any curl options to the request if ($options = $this->config->get(self::CURL_OPTIONS)) { $request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($options)); } // Add request parameters to the request if ($options = $this->config->get(self::REQUEST_PARAMS)) { $request->getParams()->merge($options); } // Attach client observers to the request $request->setEventDispatcher(clone $this->getEventDispatcher()); // Set the User-Agent if one is specified on the client but not explicitly on the request if ($this->userAgent && !$request->hasHeader('User-Agent')) { $request->setHeader('User-Agent', $this->userAgent); } $this->dispatch( 'client.create_request', array( 'client' => $this, 'request' => $request ) ); return $request; } /** * Copy the cecert.pem file from the phar if it is not in the temp folder and validate the MD5 checksum * * @return string * @throws RuntimeException if the file cannot be copied or there is a MD5 mismatch */ protected function preparePharCacert() { $from = __DIR__ . '/Resources/cacert.pem'; $certFile = sys_get_temp_dir() . '/guzzle-cacert.pem'; if (file_exists($certFile)) { $actualMd5 = md5_file($certFile); $expectedMd5 = trim(file_get_contents("{$from}.md5")); if ($actualMd5 != $expectedMd5) { throw new RuntimeException("{$certFile} MD5 mismatch: expected {$expectedMd5} but got {$actualMd5}"); } } elseif (!copy($from, $certFile)) { throw new RuntimeException("Could not copy {$from} to {$certFile}: " . var_export(error_get_last(), true)); } return $certFile; } } src/Guzzle/Http/ClientInterface.php000064400000023447151742734620013327 0ustar00getCurlOptions(); $mediator = new RequestMediator($request, $requestCurlOptions->get('emit_io')); $tempContentLength = null; $method = $request->getMethod(); $bodyAsString = $requestCurlOptions->get(self::BODY_AS_STRING); // Array of default cURL options. $curlOptions = array( CURLOPT_URL => $request->getUrl(), CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_RETURNTRANSFER => false, CURLOPT_HEADER => false, CURLOPT_PORT => $request->getPort(), CURLOPT_HTTPHEADER => array(), CURLOPT_WRITEFUNCTION => array($mediator, 'writeResponseBody'), CURLOPT_HEADERFUNCTION => array($mediator, 'receiveResponseHeader'), CURLOPT_HTTP_VERSION => $request->getProtocolVersion() === '1.0' ? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1, // Verifies the authenticity of the peer's certificate CURLOPT_SSL_VERIFYPEER => 1, // Certificate must indicate that the server is the server to which you meant to connect CURLOPT_SSL_VERIFYHOST => 2 ); if (defined('CURLOPT_PROTOCOLS')) { // Allow only HTTP and HTTPS protocols $curlOptions[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; } // Add CURLOPT_ENCODING if Accept-Encoding header is provided if ($acceptEncodingHeader = $request->getHeader('Accept-Encoding')) { $curlOptions[CURLOPT_ENCODING] = (string) $acceptEncodingHeader; // Let cURL set the Accept-Encoding header, prevents duplicate values $request->removeHeader('Accept-Encoding'); } // Enable the progress function if the 'progress' param was set if ($requestCurlOptions->get('progress')) { $curlOptions[CURLOPT_PROGRESSFUNCTION] = array($mediator, 'progress'); $curlOptions[CURLOPT_NOPROGRESS] = false; } // Enable curl debug information if the 'debug' param was set if ($requestCurlOptions->get('debug')) { $curlOptions[CURLOPT_STDERR] = fopen('php://temp', 'r+'); // @codeCoverageIgnoreStart if (false === $curlOptions[CURLOPT_STDERR]) { throw new RuntimeException('Unable to create a stream for CURLOPT_STDERR'); } // @codeCoverageIgnoreEnd $curlOptions[CURLOPT_VERBOSE] = true; } // Specify settings according to the HTTP method if ($method == 'GET') { $curlOptions[CURLOPT_HTTPGET] = true; } elseif ($method == 'HEAD') { $curlOptions[CURLOPT_NOBODY] = true; // HEAD requests do not use a write function unset($curlOptions[CURLOPT_WRITEFUNCTION]); } elseif (!($request instanceof EntityEnclosingRequest)) { $curlOptions[CURLOPT_CUSTOMREQUEST] = $method; } else { $curlOptions[CURLOPT_CUSTOMREQUEST] = $method; // Handle sending raw bodies in a request if ($request->getBody()) { // You can send the body as a string using curl's CURLOPT_POSTFIELDS if ($bodyAsString) { $curlOptions[CURLOPT_POSTFIELDS] = (string) $request->getBody(); // Allow curl to add the Content-Length for us to account for the times when // POST redirects are followed by GET requests if ($tempContentLength = $request->getHeader('Content-Length')) { $tempContentLength = (int) (string) $tempContentLength; } // Remove the curl generated Content-Type header if none was set manually if (!$request->hasHeader('Content-Type')) { $curlOptions[CURLOPT_HTTPHEADER][] = 'Content-Type:'; } } else { $curlOptions[CURLOPT_UPLOAD] = true; // Let cURL handle setting the Content-Length header if ($tempContentLength = $request->getHeader('Content-Length')) { $tempContentLength = (int) (string) $tempContentLength; $curlOptions[CURLOPT_INFILESIZE] = $tempContentLength; } // Add a callback for curl to read data to send with the request only if a body was specified $curlOptions[CURLOPT_READFUNCTION] = array($mediator, 'readRequestBody'); // Attempt to seek to the start of the stream $request->getBody()->seek(0); } } else { // Special handling for POST specific fields and files $postFields = false; if (count($request->getPostFiles())) { $postFields = $request->getPostFields()->useUrlEncoding(false)->urlEncode(); foreach ($request->getPostFiles() as $key => $data) { $prefixKeys = count($data) > 1; foreach ($data as $index => $file) { // Allow multiple files in the same key $fieldKey = $prefixKeys ? "{$key}[{$index}]" : $key; $postFields[$fieldKey] = $file->getCurlString(); } } } elseif (count($request->getPostFields())) { $postFields = (string) $request->getPostFields()->useUrlEncoding(true); } if ($postFields !== false) { if ($method == 'POST') { unset($curlOptions[CURLOPT_CUSTOMREQUEST]); $curlOptions[CURLOPT_POST] = true; } $curlOptions[CURLOPT_POSTFIELDS] = $postFields; $request->removeHeader('Content-Length'); } } // If the Expect header is not present, prevent curl from adding it if (!$request->hasHeader('Expect')) { $curlOptions[CURLOPT_HTTPHEADER][] = 'Expect:'; } } // If a Content-Length header was specified but we want to allow curl to set one for us if (null !== $tempContentLength) { $request->removeHeader('Content-Length'); } // Set custom cURL options foreach ($requestCurlOptions->getAll() as $key => $value) { if (is_numeric($key)) { $curlOptions[$key] = $value; } } // Do not set an Accept header by default if (!isset($curlOptions[CURLOPT_ENCODING])) { $curlOptions[CURLOPT_HTTPHEADER][] = 'Accept:'; } // Check if any headers or cURL options are blacklisted if ($blacklist = $requestCurlOptions->get('blacklist')) { foreach ($blacklist as $value) { if (strpos($value, 'header.') !== 0) { unset($curlOptions[$value]); } else { // Remove headers that may have previously been set but are supposed to be blacklisted $key = substr($value, 7); $request->removeHeader($key); $curlOptions[CURLOPT_HTTPHEADER][] = $key . ':'; } } } // Add any custom headers to the request. Empty headers will cause curl to not send the header at all. foreach ($request->getHeaderLines() as $line) { $curlOptions[CURLOPT_HTTPHEADER][] = $line; } // Apply the options to a new cURL handle. $handle = curl_init(); curl_setopt_array($handle, $curlOptions); if ($tempContentLength) { $request->setHeader('Content-Length', $tempContentLength); } $handle = new static($handle, $curlOptions); $mediator->setCurlHandle($handle); return $handle; } /** * Construct a new CurlHandle object that wraps a cURL handle * * @param resource $handle Configured cURL handle resource * @param Collection|array $options Curl options to use with the handle * * @throws InvalidArgumentException */ public function __construct($handle, $options) { if (!is_resource($handle)) { throw new InvalidArgumentException('Invalid handle provided'); } if (is_array($options)) { $this->options = new Collection($options); } elseif ($options instanceof Collection) { $this->options = $options; } else { throw new InvalidArgumentException('Expected array or Collection'); } $this->handle = $handle; } /** * Destructor */ public function __destruct() { $this->close(); } /** * Close the curl handle */ public function close() { if (is_resource($this->handle)) { curl_close($this->handle); } $this->handle = null; } /** * Check if the handle is available and still OK * * @return bool */ public function isAvailable() { return is_resource($this->handle); } /** * Get the last error that occurred on the cURL handle * * @return string */ public function getError() { return $this->isAvailable() ? curl_error($this->handle) : ''; } /** * Get the last error number that occurred on the cURL handle * * @return int */ public function getErrorNo() { if ($this->errorNo) { return $this->errorNo; } return $this->isAvailable() ? curl_errno($this->handle) : CURLE_OK; } /** * Set the curl error number * * @param int $error Error number to set * * @return CurlHandle */ public function setErrorNo($error) { $this->errorNo = $error; return $this; } /** * Get cURL curl_getinfo data * * @param int $option Option to retrieve. Pass null to retrieve all data as an array. * * @return array|mixed */ public function getInfo($option = null) { if (!is_resource($this->handle)) { return null; } if (null !== $option) { return curl_getinfo($this->handle, $option) ?: null; } return curl_getinfo($this->handle) ?: array(); } /** * Get the stderr output * * @param bool $asResource Set to TRUE to get an fopen resource * * @return string|resource|null */ public function getStderr($asResource = false) { $stderr = $this->getOptions()->get(CURLOPT_STDERR); if (!$stderr) { return null; } if ($asResource) { return $stderr; } fseek($stderr, 0); $e = stream_get_contents($stderr); fseek($stderr, 0, SEEK_END); return $e; } /** * Get the URL that this handle is connecting to * * @return Url */ public function getUrl() { return Url::factory($this->options->get(CURLOPT_URL)); } /** * Get the wrapped curl handle * * @return resource|null Returns the cURL handle or null if it was closed */ public function getHandle() { return $this->isAvailable() ? $this->handle : null; } /** * Get the cURL setopt options of the handle. Changing values in the return object will have no effect on the curl * handle after it is created. * * @return Collection */ public function getOptions() { return $this->options; } /** * Update a request based on the log messages of the CurlHandle * * @param RequestInterface $request Request to update */ public function updateRequestFromTransfer(RequestInterface $request) { if (!$request->getResponse()) { return; } // Update the transfer stats of the response $request->getResponse()->setInfo($this->getInfo()); if (!$log = $this->getStderr(true)) { return; } // Parse the cURL stderr output for outgoing requests $headers = ''; fseek($log, 0); while (($line = fgets($log)) !== false) { if ($line && $line[0] == '>') { $headers = substr(trim($line), 2) . "\r\n"; while (($line = fgets($log)) !== false) { if ($line[0] == '*' || $line[0] == '<') { break; } else { $headers .= trim($line) . "\r\n"; } } } } // Add request headers to the request exactly as they were sent if ($headers) { $parsed = ParserRegistry::getInstance()->getParser('message')->parseRequest($headers); if (!empty($parsed['headers'])) { $request->setHeaders(array()); foreach ($parsed['headers'] as $name => $value) { $request->setHeader($name, $value); } } if (!empty($parsed['version'])) { $request->setProtocolVersion($parsed['version']); } } } /** * Parse the config and replace curl.* configurators into the constant based values so it can be used elsewhere * * @param array|Collection $config The configuration we want to parse * * @return array */ public static function parseCurlConfig($config) { $curlOptions = array(); foreach ($config as $key => $value) { if (!is_numeric($key) && defined($key)) { // Convert constants represented as string to constant int values $key = constant($key); } if (is_string($value) && defined($value)) { $value = constant($value); } $curlOptions[$key] = $value; } return $curlOptions; } } src/Guzzle/Http/Curl/CurlMulti.php000064400000050321151742734620013104 0ustar00 array('CURLM_BAD_HANDLE', 'The passed-in handle is not a valid CURLM handle.'), CURLM_BAD_EASY_HANDLE => array('CURLM_BAD_EASY_HANDLE', "An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle."), CURLM_OUT_OF_MEMORY => array('CURLM_OUT_OF_MEMORY', 'You are doomed.'), CURLM_INTERNAL_ERROR => array('CURLM_INTERNAL_ERROR', 'This can only be returned if libcurl bugs. Please report it to us!') ); /** * @var int */ private $scope = -1; /** * {@inheritdoc} */ public static function getAllEvents() { return array( // A request was added self::ADD_REQUEST, // A request was removed self::REMOVE_REQUEST, // Requests are about to be sent self::BEFORE_SEND, // The pool finished sending the requests self::COMPLETE, // A request is still polling (sent to request's event dispatchers) self::POLLING_REQUEST, // A request exception occurred self::MULTI_EXCEPTION ); } /** * {@inheritdoc} */ public function __construct() { // You can get some weird "Too many open files" errors when sending a large amount of requests in parallel.These // two statements autoload classes before a system runs out of file descriptors so that you can get back // valuable error messages if you run out. class_exists('Guzzle\Http\Message\Response'); class_exists('Guzzle\Http\Exception\CurlException'); $this->createMultiHandle(); } /** * {@inheritdoc} */ public function __destruct() { if (is_resource($this->multiHandle)) { curl_multi_close($this->multiHandle); } } /** * {@inheritdoc} * * Adds a request to a batch of requests to be sent in parallel. * * Async requests adds a request to the current scope to be executed in parallel with any currently executing cURL * handles. You may only add an async request while other requests are transferring. Attempting to add an async * request while no requests are transferring will add the request normally in the next available scope (e.g. 0). * * @param RequestInterface $request Request to add * @param bool $async Set to TRUE to add to the current scope * * @return self */ public function add(RequestInterface $request, $async = false) { if ($async && $this->state != self::STATE_SENDING) { $async = false; } $this->requestCache = null; $scope = $async ? $this->scope : $this->scope + 1; if (!isset($this->requests[$scope])) { $this->requests[$scope] = array($request); } else { $this->requests[$scope][] = $request; } $this->dispatch(self::ADD_REQUEST, array('request' => $request)); // If requests are currently transferring and this is async, then the // request must be prepared now as the send() method is not called. if ($async && $this->state == self::STATE_SENDING) { $this->beforeSend($request); } return $this; } /** * {@inheritdoc} */ public function all() { if (!$this->requestCache) { $this->requestCache = empty($this->requests) ? array() : call_user_func_array('array_merge', $this->requests); } return $this->requestCache; } /** * {@inheritdoc} */ public function getState() { return $this->state; } /** * {@inheritdoc} */ public function remove(RequestInterface $request) { $this->removeHandle($request); $this->requestCache = null; foreach ($this->requests as $scope => $scopedRequests) { $pos = array_search($request, $scopedRequests, true); if ($pos !== false) { unset($this->requests[$scope][$pos]); break; } } $this->dispatch(self::REMOVE_REQUEST, array('request' => $request)); return $this; } /** * {@inheritdoc} */ public function reset($hard = false) { // Remove each request foreach ($this->all() as $request) { $this->remove($request); } $this->requests = array(); $this->exceptions = array(); $this->multiException = null; $this->state = self::STATE_IDLE; $this->scope = -1; $this->requestCache = null; // Remove any curl handles that were queued for removal if ($this->scope == -1 || $hard) { foreach ($this->removeHandles as $handle) { curl_multi_remove_handle($this->multiHandle, $handle->getHandle()); $handle->close(); } $this->removeHandles = array(); } if ($hard) { $this->createMultiHandle(); } } /** * {@inheritdoc} */ public function send() { $this->scope++; $this->state = self::STATE_SENDING; $requestsInScope = empty($this->requests[$this->scope]) ? array() : $this->requests[$this->scope]; // Only prepare and send requests that are in the current recursion scope // Only enter the main perform() loop if there are requests in scope if ($requestsInScope) { // Any exceptions thrown from this event should break the entire flow of sending requests $this->dispatch(self::BEFORE_SEND, array( 'requests' => $this->requests[$this->scope] )); foreach ($this->requests[$this->scope] as $request) { if ($request->getState() != RequestInterface::STATE_TRANSFER) { $this->beforeSend($request); } } try { $this->perform(); } catch (\Exception $e) { $this->exceptions[] = array('request' => null, 'exception' => $e); } } $this->scope--; // Aggregate exceptions into a MultiTransferException if needed if ($this->multiException || !empty($this->exceptions)) { $this->buildMultiTransferException($requestsInScope); } // Complete the transfer if this is not a nested scope if ($this->scope == -1) { $this->state = self::STATE_COMPLETE; $this->dispatch(self::COMPLETE); $e = $this->multiException; $this->reset(); // Throw any exceptions that were encountered if ($e) { throw $e; } } } /** * {@inheritdoc} */ public function count() { return count($this->all()); } /** * Build a MultiTransferException if needed * * @param array $requestsInScope All requests in the previous scope */ protected function buildMultiTransferException(array $requestsInScope) { if (!$this->multiException) { $this->multiException = new MultiTransferException('Errors during multi transfer'); } while ($e = array_shift($this->exceptions)) { $this->multiException->add($e['exception']); if ($e['request']) { $this->multiException->addFailedRequest($e['request']); } } // Add successful requests foreach ($requestsInScope as $request) { if (!$this->multiException->containsRequest($request)) { $this->multiException->addSuccessfulRequest($request); } } } /** * Prepare for sending * * @param RequestInterface $request Request to prepare */ protected function beforeSend(RequestInterface $request) { try { $request->setState(RequestInterface::STATE_TRANSFER); $request->dispatch('request.before_send', array( 'request' => $request )); if ($request->getState() != RequestInterface::STATE_TRANSFER) { // Requests might decide they don't need to be sent just before transfer (e.g. CachePlugin) $this->remove($request); } elseif ($request->getParams()->get('queued_response')) { // Queued responses do not need to be sent using curl $this->remove($request); $request->setState(RequestInterface::STATE_COMPLETE); } else { // Add the request's curl handle to the multi handle $this->checkCurlResult(curl_multi_add_handle($this->multiHandle, $this->createCurlHandle($request)->getHandle())); } } catch (\Exception $e) { $this->removeErroredRequest($request, $e); } } /** * Create a curl handle for a request * * @param RequestInterface $request Request * * @return CurlHandle */ protected function createCurlHandle(RequestInterface $request) { $wrapper = CurlHandle::factory($request); $this->handles->attach($request, $wrapper); $this->resourceHash[(int) $wrapper->getHandle()] = $request; return $wrapper; } /** * Get the data from the multi handle */ protected function perform() { // @codeCoverageIgnoreStart // Weird things can happen when making HTTP requests in __destruct methods if (!$this->multiHandle) { return; } // @codeCoverageIgnoreEnd // If there are no requests to send, then exit from the function if ($this->scope <= 0) { if ($this->count() == 0) { return; } } elseif (empty($this->requests[$this->scope])) { return; } // Create the polling event external to the loop $event = array('curl_multi' => $this); // Initialize the handles with a very quick select timeout $active = $mrc = null; $this->executeHandles($active, $mrc, 0.001); while (1) { $this->processMessages(); // Exit the function if there are no more requests to send $scopedPolling = $this->scope <= 0 ? $this->all() : $this->requests[$this->scope]; if (!$scopedPolling) { break; } // Notify each request as polling $blocking = $total = 0; foreach ($scopedPolling as $request) { $event['request'] = $request; $request->dispatch(self::POLLING_REQUEST, $event); ++$total; // The blocking variable just has to be non-falsey to block the loop if ($request->getParams()->hasKey(self::BLOCKING)) { ++$blocking; } } if ($blocking == $total) { // Sleep to prevent eating CPU because no requests are actually pending a select call usleep(500); } else { do { $this->executeHandles($active, $mrc, 1); } while ($active); } } } /** * Process any received curl multi messages */ private function processMessages() { // Get messages from curl handles while ($done = curl_multi_info_read($this->multiHandle)) { try { $request = $this->resourceHash[(int) $done['handle']]; $handle = $this->handles[$request]; $this->processResponse($request, $handle, $done); } catch (\Exception $e) { $this->removeErroredRequest($request, $e); } } } /** * Execute and select curl handles until there is activity * * @param int $active Active value to update * @param int $mrc Multi result value to update * @param int $timeout Select timeout in seconds */ private function executeHandles(&$active, &$mrc, $timeout = 1) { do { $mrc = curl_multi_exec($this->multiHandle, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM && $active); $this->checkCurlResult($mrc); // @codeCoverageIgnoreStart // Select the curl handles until there is any activity on any of the open file descriptors // See https://github.com/php/php-src/blob/master/ext/curl/multi.c#L170 if ($active && $mrc == CURLM_OK && curl_multi_select($this->multiHandle, $timeout) == -1) { // Perform a usleep if a previously executed select returned -1 // @see https://bugs.php.net/bug.php?id=61141 usleep(100); } // @codeCoverageIgnoreEnd } /** * Remove a request that encountered an exception * * @param RequestInterface $request Request to remove * @param \Exception $e Exception encountered */ protected function removeErroredRequest(RequestInterface $request, \Exception $e) { $this->exceptions[] = array('request' => $request, 'exception' => $e); $this->remove($request); $request->setState(RequestInterface::STATE_ERROR); $this->dispatch(self::MULTI_EXCEPTION, array( 'exception' => $e, 'all_exceptions' => $this->exceptions )); } /** * Check for errors and fix headers of a request based on a curl response * * @param RequestInterface $request Request to process * @param CurlHandle $handle Curl handle object * @param array $curl Array returned from curl_multi_info_read * * @throws CurlException on Curl error */ protected function processResponse(RequestInterface $request, CurlHandle $handle, array $curl) { // Set the transfer stats on the response $handle->updateRequestFromTransfer($request); // Check if a cURL exception occurred, and if so, notify things $curlException = $this->isCurlException($request, $handle, $curl); // Always remove completed curl handles. They can be added back again // via events if needed (e.g. ExponentialBackoffPlugin) $this->removeHandle($request); if (!$curlException) { $request->setState(RequestInterface::STATE_COMPLETE, array('handle' => $handle)); // Only remove the request if it wasn't resent as a result of the state change if ($request->getState() != RequestInterface::STATE_TRANSFER) { $this->remove($request); } } else { // Set the state of the request to an error $request->setState(RequestInterface::STATE_ERROR); // Notify things that listen to the request of the failure $request->dispatch('request.exception', array( 'request' => $this, 'exception' => $curlException )); // Allow things to ignore the error if possible $state = $request->getState(); if ($state != RequestInterface::STATE_TRANSFER) { $this->remove($request); } // The error was not handled, so fail if ($state == RequestInterface::STATE_ERROR) { throw $curlException; } } } /** * Remove a curl handle from the curl multi object * * Nasty things (bus errors, segmentation faults) can sometimes occur when removing curl handles when in a callback * or a recursive scope. Here we are queueing all curl handles that need to be removed and closed so that this * happens only in the outermost scope when everything has completed sending. * * @param RequestInterface $request Request that owns the handle */ protected function removeHandle(RequestInterface $request) { if ($this->handles->contains($request)) { $handle = $this->handles[$request]; unset($this->resourceHash[(int) $handle->getHandle()]); unset($this->handles[$request]); $this->removeHandles[] = $handle; } } /** * Check if a cURL transfer resulted in what should be an exception * * @param RequestInterface $request Request to check * @param CurlHandle $handle Curl handle object * @param array $curl Array returned from curl_multi_info_read * * @return \Exception|bool */ private function isCurlException(RequestInterface $request, CurlHandle $handle, array $curl) { if (CURLM_OK == $curl['result'] || CURLM_CALL_MULTI_PERFORM == $curl['result']) { return false; } $handle->setErrorNo($curl['result']); $e = new CurlException(sprintf('[curl] %s: %s [url] %s', $handle->getErrorNo(), $handle->getError(), $handle->getUrl())); $e->setCurlHandle($handle) ->setRequest($request) ->setCurlInfo($handle->getInfo()) ->setError($handle->getError(), $handle->getErrorNo()); return $e; } /** * Throw an exception for a cURL multi response if needed * * @param int $code Curl response code * * @throws CurlException */ private function checkCurlResult($code) { if ($code != CURLM_OK && $code != CURLM_CALL_MULTI_PERFORM) { throw new CurlException(isset($this->multiErrors[$code]) ? "cURL error: {$code} ({$this->multiErrors[$code][0]}): cURL message: {$this->multiErrors[$code][1]}" : 'Unexpected cURL error: ' . $code ); } } /** * Create the new cURL multi handle with error checking */ private function createMultiHandle() { if ($this->multiHandle && is_resource($this->multiHandle)) { curl_multi_close($this->multiHandle); } $this->requests = array(); $this->multiHandle = curl_multi_init(); $this->handles = new \SplObjectStorage(); $this->resourceHash = array(); $this->removeHandles = array(); // @codeCoverageIgnoreStart if ($this->multiHandle === false) { throw new CurlException('Unable to create multi handle'); } // @codeCoverageIgnoreEnd } } src/Guzzle/Http/Curl/CurlMultiInterface.php000064400000003540151742734620014726 0ustar00version) { $this->version = curl_version(); } return $this->version; } /** * Get a specific type of curl information * * @param string $type Version information to retrieve. This value is one of: * - version_number: cURL 24 bit version number * - version: cURL version number, as a string * - ssl_version_number: OpenSSL 24 bit version number * - ssl_version: OpenSSL version number, as a string * - libz_version: zlib version number, as a string * - host: Information about the host where cURL was built * - features: A bitmask of the CURL_VERSION_XXX constants * - protocols: An array of protocols names supported by cURL * * @return string|float|bool if the $type is found, and false if not found */ public function get($type) { $version = $this->getAll(); return isset($version[$type]) ? $version[$type] : false; } } src/Guzzle/Http/Curl/RequestMediator.php000064400000006444151742734620014310 0ustar00request = $request; $this->emitIo = $emitIo; } /** * Set the associated CurlHandle object * * @param CurlHandle $handle Curl handle * * @return RequestMediator */ public function setCurlHandle(CurlHandle $handle) { $this->curlHandle = $handle; $this->request->getParams()->set('curl_handle', $handle); return $this; } /** * Receive a response header from curl * * @param resource $curl Curl handle * @param string $header Received header * * @return int */ public function receiveResponseHeader($curl, $header) { return $this->request->receiveResponseHeader($header); } /** * Received a progress notification * * @param int $downloadSize Total download size * @param int $downloaded Amount of bytes downloaded * @param int $uploadSize Total upload size * @param int $uploaded Amount of bytes uploaded */ public function progress($downloadSize, $downloaded, $uploadSize, $uploaded) { $this->request->dispatch('curl.callback.progress', array( 'request' => $this->request, 'handle' => $this->curlHandle, 'download_size' => $downloadSize, 'downloaded' => $downloaded, 'upload_size' => $uploadSize, 'uploaded' => $uploaded )); } /** * Write data to the response body of a request * * @param resource $curl Curl handle * @param string $write Data that was received * * @return int */ public function writeResponseBody($curl, $write) { if ($this->emitIo) { $this->request->dispatch('curl.callback.write', array( 'request' => $this->request, 'write' => $write )); } return $this->request->getResponse()->getBody()->write($write); } /** * Read data from the request body and send it to curl * * @param resource $ch Curl handle * @param resource $fd File descriptor * @param int $length Amount of data to read * * @return string */ public function readRequestBody($ch, $fd, $length) { $read = ''; if ($this->request->getBody()) { $read = $this->request->getBody()->read($length); if ($this->emitIo) { $this->request->dispatch('curl.callback.read', array( 'request' => $this->request, 'read' => $read )); } } return !$read ? '' : $read; } } src/Guzzle/Http/EntityBody.php000064400000014151151742734620012352 0ustar00rewindFunction = $callable; return $this; } /** * {@inheritdoc} */ public function rewind() { return $this->rewindFunction ? call_user_func($this->rewindFunction, $this) : parent::rewind(); } /** * Create a new EntityBody from a string * * @param string $string String of data * * @return EntityBody */ public static function fromString($string) { $stream = fopen('php://temp', 'r+'); if ($string !== '') { fwrite($stream, $string); rewind($stream); } return new static($stream); } /** * {@inheritdoc} */ public function compress($filter = 'zlib.deflate') { $result = $this->handleCompression($filter); $this->contentEncoding = $result ? $filter : false; return $result; } /** * {@inheritdoc} */ public function uncompress($filter = 'zlib.inflate') { $offsetStart = 0; // When inflating gzipped data, the first 10 bytes must be stripped // if a gzip header is present if ($filter == 'zlib.inflate') { // @codeCoverageIgnoreStart if (!$this->isReadable() || ($this->isConsumed() && !$this->isSeekable())) { return false; } // @codeCoverageIgnoreEnd if (stream_get_contents($this->stream, 3, 0) === "\x1f\x8b\x08") { $offsetStart = 10; } } $this->contentEncoding = false; return $this->handleCompression($filter, $offsetStart); } /** * {@inheritdoc} */ public function getContentLength() { return $this->getSize(); } /** * {@inheritdoc} */ public function getContentType() { return $this->getUri() ? Mimetypes::getInstance()->fromFilename($this->getUri()) : null; } /** * {@inheritdoc} */ public function getContentMd5($rawOutput = false, $base64Encode = false) { $hash = self::getHash($this, 'md5', $rawOutput); return $hash && $base64Encode ? base64_encode($hash) : $hash; } /** * Calculate the MD5 hash of an entity body * * @param EntityBodyInterface $body Entity body to calculate the hash for * @param bool $rawOutput Whether or not to use raw output * @param bool $base64Encode Whether or not to base64 encode raw output (only if raw output is true) * * @return bool|string Returns an MD5 string on success or FALSE on failure * @deprecated This will be deprecated soon * @codeCoverageIgnore */ public static function calculateMd5(EntityBodyInterface $body, $rawOutput = false, $base64Encode = false) { return $body->getContentMd5($rawOutput, $base64Encode); } /** * {@inheritdoc} */ public function setStreamFilterContentEncoding($streamFilterContentEncoding) { $this->contentEncoding = $streamFilterContentEncoding; return $this; } /** * {@inheritdoc} */ public function getContentEncoding() { return strtr($this->contentEncoding, array( 'zlib.deflate' => 'gzip', 'bzip2.compress' => 'compress' )) ?: false; } /** * {@inheritdoc} */ protected function handleCompression($filter, $offsetStart = 0) { // @codeCoverageIgnoreStart if (!$this->isReadable() || ($this->isConsumed() && !$this->isSeekable())) { return false; } // @codeCoverageIgnoreEnd $handle = fopen('php://temp', 'r+'); $filter = @stream_filter_append($handle, $filter, STREAM_FILTER_WRITE); if (!$filter) { return false; } // Seek to the offset start if possible $this->seek($offsetStart); while ($data = fread($this->stream, 8096)) { fwrite($handle, $data); } fclose($this->stream); $this->stream = $handle; stream_filter_remove($filter); $stat = fstat($this->stream); $this->size = $stat['size']; $this->rebuildCache(); $this->seek(0); // Remove any existing rewind function as the underlying stream has been replaced $this->rewindFunction = null; return true; } } src/Guzzle/Http/EntityBodyInterface.php000064400000004563151742734620014201 0ustar00isClientError()) { $label = 'Client error response'; $class = __NAMESPACE__ . '\\ClientErrorResponseException'; } elseif ($response->isServerError()) { $label = 'Server error response'; $class = __NAMESPACE__ . '\\ServerErrorResponseException'; } else { $label = 'Unsuccessful response'; $class = __CLASS__; $e = new self(); } $message = $label . PHP_EOL . implode(PHP_EOL, array( '[status code] ' . $response->getStatusCode(), '[reason phrase] ' . $response->getReasonPhrase(), '[url] ' . $request->getUrl(), )); $e = new $class($message); $e->setResponse($response); $e->setRequest($request); return $e; } /** * Set the response that caused the exception * * @param Response $response Response to set */ public function setResponse(Response $response) { $this->response = $response; } /** * Get the response that caused the exception * * @return Response */ public function getResponse() { return $this->response; } } src/Guzzle/Http/Exception/ClientErrorResponseException.php000064400000000260151742734620020040 0ustar00curlError = $error; $this->curlErrorNo = $number; return $this; } /** * Set the associated curl handle * * @param CurlHandle $handle Curl handle * * @return self */ public function setCurlHandle(CurlHandle $handle) { $this->handle = $handle; return $this; } /** * Get the associated cURL handle * * @return CurlHandle|null */ public function getCurlHandle() { return $this->handle; } /** * Get the associated cURL error message * * @return string|null */ public function getError() { return $this->curlError; } /** * Get the associated cURL error number * * @return int|null */ public function getErrorNo() { return $this->curlErrorNo; } /** * Returns curl information about the transfer * * @return array */ public function getCurlInfo() { return $this->curlInfo; } /** * Set curl transfer information * * @param array $info Array of curl transfer information * * @return self * @link http://php.net/manual/en/function.curl-getinfo.php */ public function setCurlInfo(array $info) { $this->curlInfo = $info; return $this; } } src/Guzzle/Http/Exception/HttpException.php000064400000000256151742734620015015 0ustar00successfulRequests, $this->failedRequests); } /** * Add to the array of successful requests * * @param RequestInterface $request Successful request * * @return self */ public function addSuccessfulRequest(RequestInterface $request) { $this->successfulRequests[] = $request; return $this; } /** * Add to the array of failed requests * * @param RequestInterface $request Failed request * * @return self */ public function addFailedRequest(RequestInterface $request) { $this->failedRequests[] = $request; return $this; } /** * Set all of the successful requests * * @param array Array of requests * * @return self */ public function setSuccessfulRequests(array $requests) { $this->successfulRequests = $requests; return $this; } /** * Set all of the failed requests * * @param array Array of requests * * @return self */ public function setFailedRequests(array $requests) { $this->failedRequests = $requests; return $this; } /** * Get an array of successful requests sent in the multi transfer * * @return array */ public function getSuccessfulRequests() { return $this->successfulRequests; } /** * Get an array of failed requests sent in the multi transfer * * @return array */ public function getFailedRequests() { return $this->failedRequests; } /** * Check if the exception object contains a request * * @param RequestInterface $request Request to check * * @return bool */ public function containsRequest(RequestInterface $request) { return in_array($request, $this->failedRequests, true) || in_array($request, $this->successfulRequests, true); } } src/Guzzle/Http/Exception/RequestException.php000064400000001422151742734620015522 0ustar00request = $request; return $this; } /** * Get the request that caused the exception * * @return RequestInterface */ public function getRequest() { return $this->request; } } src/Guzzle/Http/Exception/ServerErrorResponseException.php000064400000000260151742734620020070 0ustar00eventDispatcher = $eventDispatcher; return $this; } /** * {@inheritdoc} */ public function getEventDispatcher() { if (!$this->eventDispatcher) { $this->eventDispatcher = new EventDispatcher(); } return $this->eventDispatcher; } /** * {@inheritdoc} */ public function dispatch($eventName, array $context = array()) { $this->getEventDispatcher()->dispatch($eventName, new Event($context)); } /** * {@inheritdoc} * @codeCoverageIgnore */ public function addSubscriber(EventSubscriberInterface $subscriber) { $this->getEventDispatcher()->addSubscriber($subscriber); return $this; } /** * {@inheritdoc} */ public function read($length) { $event = array( 'body' => $this, 'length' => $length, 'read' => $this->body->read($length) ); $this->dispatch('body.read', $event); return $event['read']; } /** * {@inheritdoc} */ public function write($string) { $event = array( 'body' => $this, 'write' => $string, 'result' => $this->body->write($string) ); $this->dispatch('body.write', $event); return $event['result']; } } src/Guzzle/Http/Message/AbstractMessage.php000064400000017257151742734620014726 0ustar00params; } /** * {@inheritdoc} */ public function addHeader($header, $value) { $key = strtolower($header); if (!isset($this->headers[$key])) { $this->headers[$key] = new Header($header, $value); } else { $this->headers[$key]->add($value, $header); } $this->changedHeader($key); return $this; } /** * {@inheritdoc} */ public function addHeaders(array $headers) { foreach ($headers as $key => $value) { $this->addHeader($key, $value); } return $this; } /** * {@inheritdoc} */ public function getHeader($header, $string = false) { $key = strtolower($header); if (!isset($this->headers[$key])) { return null; } return $string ? (string) $this->headers[$key] : $this->headers[$key]; } /** * {@inheritdoc} */ public function getHeaders($asObjects = false) { if ($asObjects) { $result = $this->headers; } else { $result = array(); // Convert all of the headers into a collection foreach ($this->headers as $header) { foreach ($header->raw() as $key => $value) { $result[$key] = $value; } } } return new Collection($result); } /** * {@inheritdoc} */ public function getHeaderLines() { $headers = array(); foreach ($this->headers as $value) { $glue = $value->getGlue(); foreach ($value->raw() as $key => $v) { $headers[] = rtrim($key . ': ' . implode($glue, $v)); } } return $headers; } /** * {@inheritdoc} */ public function setHeader($header, $value) { // Remove any existing header $key = strtolower($header); unset($this->headers[$key]); if ($value instanceof Header) { $this->headers[$key] = $value; } else { // Allow for 0, '', and NULL to be set if (!$value) { $value = array($value); } $this->headers[$key] = new Header($header, $value); } $this->changedHeader($key); return $this; } /** * {@inheritdoc} */ public function setHeaders(array $headers) { // Get the keys that are changing $changed = array_keys($this->headers); // Erase the old headers $this->headers = array(); // Add the new headers foreach ($headers as $key => $value) { $changed[] = $key; $this->addHeader($key, $value); } // Notify of the changed headers foreach (array_unique($changed) as $header) { $this->changedHeader(strtolower($header)); } return $this; } /** * {@inheritdoc} */ public function hasHeader($header) { return array_key_exists(strtolower($header), $this->headers); } /** * {@inheritdoc} */ public function removeHeader($header) { $header = strtolower($header); unset($this->headers[$header]); $this->changedHeader($header); return $this; } /** * {@inheritdoc} */ public function getTokenizedHeader($header, $token = ';') { if (!$this->hasHeader($header)) { return null; } $data = new Collection(); foreach ($this->getHeader($header) as $singleValue) { foreach (explode($token, $singleValue) as $kvp) { $parts = explode('=', $kvp, 2); if (!isset($parts[1])) { $data[count($data)] = trim($parts[0]); } else { $data->add(trim($parts[0]), trim($parts[1])); } } } foreach ($data as $key => $value) { if (is_array($value)) { $data->set($key, array_unique($value)); } } return $data; } /** * {@inheritdoc} */ public function setTokenizedHeader($header, $data, $token = ';') { if (!($data instanceof Collection) && !is_array($data)) { throw new InvalidArgumentException('Data must be a Collection or array'); } $values = array(); foreach ($data as $key => $value) { foreach ((array) $value as $v) { $values[] = is_int($key) ? $v : $key . '=' . $v; } } return $this->setHeader($header, implode($token, $values)); } /** * {@inheritdoc} */ public function getCacheControlDirective($directive) { if (!isset($this->cacheControl[$directive])) { return null; } $directive = $this->cacheControl[$directive]; if (is_array($directive) && !empty($directive)) { return $directive[0]; } return $directive; } /** * {@inheritdoc} */ public function hasCacheControlDirective($directive) { return isset($this->cacheControl[$directive]); } /** * {@inheritdoc} */ public function addCacheControlDirective($directive, $value = true) { $this->cacheControl[$directive] = $value; $this->rebuildCacheControlDirective(); return $this; } /** * {@inheritdoc} */ public function removeCacheControlDirective($directive) { if (array_key_exists($directive, $this->cacheControl)) { unset($this->cacheControl[$directive]); $this->rebuildCacheControlDirective(); } return $this; } /** * Check to see if the modified headers need to reset any of the managed * headers like cache-control * * @param string $header Header that changed */ protected function changedHeader($header) { if ($header == 'cache-control') { $this->parseCacheControlDirective(); } } /** * Parse the Cache-Control HTTP header into an array */ private function parseCacheControlDirective() { $this->cacheControl = array(); $tokenized = $this->getTokenizedHeader('Cache-Control', ',') ?: array(); foreach ($tokenized as $key => $value) { if (is_numeric($key)) { $this->cacheControl[$value] = true; } else { $this->cacheControl[$key] = $value; } } } /** * Rebuild the Cache-Control HTTP header using the user-specified values */ private function rebuildCacheControlDirective() { $cacheControl = array(); foreach ($this->cacheControl as $key => $value) { $cacheControl[] = ($value === true) ? $key : ($key . '=' . $value); } $this->headers['cache-control'] = new Header('Cache-Control', $cacheControl, ', '); } } src/Guzzle/Http/Message/EntityEnclosingRequest.php000064400000020132151742734620016327 0ustar00postFields = new QueryString(); parent::__construct($method, $url, $headers); } /** * Get the HTTP request as a string * * @return string */ public function __toString() { // Only attempt to include the POST data if it's only fields if (count($this->postFields) && empty($this->postFiles)) { return parent::__toString() . (string) $this->postFields; } return parent::__toString() . $this->body; } /** * {@inheritdoc} */ public function setState($state, array $context = array()) { parent::setState($state, $context); if ($state == self::STATE_TRANSFER && !$this->body && !count($this->postFields) && !count($this->postFiles)) { $this->setHeader('Content-Length', 0)->removeHeader('Transfer-Encoding'); } return $this; } /** * {@inheritdoc} */ public function setBody($body, $contentType = null, $tryChunkedTransfer = false) { $this->body = EntityBody::factory($body); $this->removeHeader('Content-Length'); // Auto detect the Content-Type from the path of the request if possible if ($contentType === null && !$this->hasHeader('Content-Type')) { $contentType = $this->body->getContentType() ?: Mimetypes::getInstance()->fromFilename($this->getPath()); } if ($contentType) { $this->setHeader('Content-Type', (string) $contentType); } // Always add the Expect 100-Continue header if the body cannot be rewound. This helps with redirects. if (!$this->body->isSeekable() && $this->expectCutoff !== false) { $this->setHeader('Expect', '100-Continue'); } if ($tryChunkedTransfer) { $this->setHeader('Transfer-Encoding', 'chunked'); } else { $this->removeHeader('Transfer-Encoding'); // Set the Content-Length header if it can be determined $size = $this->body->getContentLength(); if ($size !== null && $size !== false) { $this->setHeader('Content-Length', $size); if ($size > $this->expectCutoff) { $this->setHeader('Expect', '100-Continue'); } } elseif ('1.1' == $this->protocolVersion) { $this->setHeader('Transfer-Encoding', 'chunked'); } else { throw new RequestException( 'Cannot determine Content-Length and cannot use chunked Transfer-Encoding when using HTTP/1.0' ); } } return $this; } /** * {@inheritdoc} */ public function getBody() { return $this->body; } /** * Set the size that the entity body of the request must exceed before adding the Expect: 100-Continue header. * * @param int|bool $size Cutoff in bytes. Set to false to never send the expect header (even with non-seekable data) * * @return self */ public function setExpectHeaderCutoff($size) { $this->expectCutoff = $size; if ($size === false || !$this->body) { $this->removeHeader('Expect'); } elseif ($this->body && $this->body->getSize() && $this->body->getSize() > $size) { $this->setHeader('Expect', '100-Continue'); } return $this; } /** * {@inheritdoc} */ public function configureRedirects($strict = false, $maxRedirects = 5) { $this->getParams()->set(RedirectPlugin::STRICT_REDIRECTS, $strict); if ($maxRedirects == 0) { $this->getParams()->set(RedirectPlugin::DISABLE, true); } else { $this->getParams()->set(RedirectPlugin::MAX_REDIRECTS, $maxRedirects); } return $this; } /** * {@inheritdoc} */ public function getPostField($field) { return $this->postFields->get($field); } /** * {@inheritdoc} */ public function getPostFields() { return $this->postFields; } /** * {@inheritdoc} */ public function setPostField($key, $value) { $this->postFields->set($key, $value); $this->processPostFields(); return $this; } /** * {@inheritdoc} */ public function addPostFields($fields) { $this->postFields->merge($fields); $this->processPostFields(); return $this; } /** * {@inheritdoc} */ public function removePostField($field) { $this->postFields->remove($field); $this->processPostFields(); return $this; } /** * {@inheritdoc} */ public function getPostFiles() { return $this->postFiles; } /** * {@inheritdoc} */ public function getPostFile($fieldName) { return isset($this->postFiles[$fieldName]) ? $this->postFiles[$fieldName] : null; } /** * {@inheritdoc} */ public function removePostFile($fieldName) { unset($this->postFiles[$fieldName]); $this->processPostFields(); return $this; } /** * {@inheritdoc} */ public function addPostFile($field, $filename = null, $contentType = null) { $data = null; if ($field instanceof PostFileInterface) { $data = $field; } elseif (!is_string($filename)) { throw new RequestException('The path to a file must be a string'); } elseif (!empty($filename)) { // Adding an empty file will cause cURL to error out $data = new PostFile($field, $filename, $contentType); } if ($data) { if (!isset($this->postFiles[$data->getFieldName()])) { $this->postFiles[$data->getFieldName()] = array($data); } else { $this->postFiles[$data->getFieldName()][] = $data; } $this->processPostFields(); } return $this; } /** * {@inheritdoc} */ public function addPostFiles(array $files) { foreach ($files as $key => $file) { if ($file instanceof PostFileInterface) { $this->addPostFile($file, null, null, false); } elseif (is_string($file)) { // Convert non-associative array keys into 'file' if (is_numeric($key)) { $key = 'file'; } $this->addPostFile($key, $file, null, false); } else { throw new RequestException('File must be a string or instance of PostFileInterface'); } } return $this; } /** * Determine what type of request should be sent based on post fields */ protected function processPostFields() { if (empty($this->postFiles)) { $this->removeHeader('Expect')->setHeader('Content-Type', self::URL_ENCODED); } else { $this->setHeader('Content-Type', self::MULTIPART); if ($this->expectCutoff !== false) { $this->setHeader('Expect', '100-Continue'); } } } } src/Guzzle/Http/Message/EntityEnclosingRequestInterface.php000064400000010726151742734620020160 0ustar00 filenames where filename can be a string or PostFileInterface * * @return EntityEnclosingRequestInterface */ public function addPostFiles(array $files); /** * Configure how redirects are handled for the request * * @param bool $strict Set to true to follow strict RFC compliance when redirecting POST requests. Most * browsers with follow a 301-302 redirect for a POST request with a GET request. This is * the default behavior of Guzzle. Enable strict redirects to redirect these responses * with a POST rather than a GET request. * @param int $maxRedirects Specify the maximum number of allowed redirects. Set to 0 to disable redirects. * * @return self */ public function configureRedirects($strict = false, $maxRedirects = 5); } src/Guzzle/Http/Message/Header.php000064400000014754151742734620013045 0ustar00header = $header; $this->glue = $glue; if (null !== $values) { foreach ((array) $values as $key => $value) { if (is_numeric($key)) { $key = $header; } if ($value === null) { $this->add($value, $key); } else { foreach ((array) $value as $v) { $this->add($v, $key); } } } } } /** * Convert the header to a string * * @return string */ public function __toString() { if (!$this->stringCache) { $this->stringCache = implode($this->glue, $this->toArray()); } return $this->stringCache; } /** * Add a value to the list of header values * * @param string $value Value to add * @param string $header The exact header casing to add with. Defaults to the name of the header. * * @return Header */ public function add($value, $header = null) { if (!$header) { $header = $this->getName(); } if (!isset($this->values[$header])) { $this->values[$header] = array($value); } else { $this->values[$header][] = $value; } // Ensure that the array cache is cleared $this->arrayCache = $this->stringCache = null; return $this; } /** * Get the name of the header * * @return string */ public function getName() { return $this->header; } /** * Change the glue used to implode the values * * @param string $glue Glue used to implode multiple values * * @return Header */ public function setGlue($glue) { $this->glue = $glue; $this->stringCache = null; return $this; } /** * Get the glue used to implode multiple values into a string * * @return string */ public function getGlue() { return $this->glue; } /** * Normalize the header to be a single header with an array of values * * @param bool $explodeOnGlue Set to true to explode each header value on the glue of the header * * @return Header */ public function normalize($explodeOnGlue = false) { $values = $this->toArray(); $this->arrayCache = $this->stringCache = null; // Explode each value on glue if needed if ($this->glue && $explodeOnGlue) { foreach ($values as $i => $value) { // Explode the value if the glue was found in the header if (strpos($value, $this->glue)) { foreach (explode($this->glue, $value) as $v) { $values[] = $v; } unset($values[$i]); } } } $this->values = array($this->getName() => $values); return $this; } /** * Check if a particular case variation is present in the header * Example: A header exists on a message for 'Foo', and 'foo'. The Header object will contain all of the values of * 'Foo' and all of the values of 'foo'. You can use this method to check to see if a header was set using * 'foo' (true), 'Foo' (true), 'FOO' (false), etc. * * @param string $header Exact header to check for * * @return bool */ public function hasExactHeader($header) { return isset($this->values[$header]); } /** * Check if the collection of headers has a particular value * * @param string $searchValue Value to search for * @param bool $caseInsensitive Set to TRUE to use a case insensitive search * * @return bool */ public function hasValue($searchValue, $caseInsensitive = false) { foreach ($this->toArray() as $value) { if ($value == $searchValue) { return true; } elseif ($caseInsensitive && !strcasecmp($value, $searchValue)) { return true; } } return false; } /** * Remove a specific value from the header * * @param string $searchValue Value to remove * * @return self */ public function removeValue($searchValue) { foreach ($this->values as $key => $values) { foreach ($values as $index => $value) { if ($value == $searchValue) { unset($this->values[$key][$index]); $this->arrayCache = $this->stringCache = null; break 2; } } } return $this; } /** * Get all of the header values as a flat array * {@inheritdoc} */ public function toArray() { if ($this->arrayCache === null) { $this->arrayCache = array(); foreach ($this->values as $values) { $this->arrayCache = array_merge($this->arrayCache, $values); } } return $this->arrayCache; } /** * Get the raw data array of the headers. This array is represented as an associative array of the various cases * that might be stored in the header and an array of values associated with each case variation. * * @return array */ public function raw() { return $this->values; } /** * Returns the total number of header values * * @return int */ public function count() { return count($this->toArray()); } /** * Get an iterator that can be used to easily iterate over each header value * * @return \ArrayIterator */ public function getIterator() { return new \ArrayIterator($this->toArray()); } } src/Guzzle/Http/Message/HeaderComparison.php000064400000010332151742734620015064 0ustar00getAll(); } foreach ($filteredHeaders as $k => $v) { if ($k[0] == '_') { // This header should be ignored $ignore[] = str_replace('_', '', $k); } elseif ($k[0] == '!') { // This header must not be present $absent[] = str_replace('!', '', $k); } else { $expected[$k] = $v; } } return $this->compareArray($expected, $actualHeaders, $ignore, $absent); } /** * Check if an array of HTTP headers matches another array of HTTP headers while taking * into account as a wildcard * * @param array $expected Expected HTTP headers (allows wildcard values) * @param array|Collection $actual Actual HTTP header array * @param array $ignore Headers to ignore from the comparison * @param array $absent Array of headers that must not be present * * @return array|bool Returns an array of the differences or FALSE if none */ public function compareArray(array $expected, $actual, array $ignore = array(), array $absent = array()) { $differences = array(); // Add information about headers that were present but weren't supposed to be foreach ($absent as $header) { if ($this->hasKey($header, $actual)) { $differences["++ {$header}"] = $actual[$header]; unset($actual[$header]); } } // Check if expected headers are missing foreach ($expected as $header => $value) { if (!$this->hasKey($header, $actual)) { $differences["- {$header}"] = $value; } } // Flip the ignore array so it works with the case insensitive helper $ignore = array_flip($ignore); // Allow case-insensitive comparisons in wildcards $expected = array_change_key_case($expected); // Compare the expected and actual HTTP headers in no particular order foreach ($actual as $key => $value) { // If this is to be ignored, the skip it if ($this->hasKey($key, $ignore)) { continue; } // If the header was not expected if (!$this->hasKey($key, $expected)) { $differences["+ {$key}"] = $value; continue; } // Check values and take wildcards into account $lkey = strtolower($key); $pos = is_string($expected[$lkey]) ? strpos($expected[$lkey], '*') : false; foreach ((array) $actual[$key] as $v) { if (($pos === false && $v != $expected[$lkey]) || $pos > 0 && substr($v, 0, $pos) != substr($expected[$lkey], 0, $pos)) { $differences[$key] = "{$value} != {$expected[$lkey]}"; } } } return empty($differences) ? false : $differences; } /** * Case insensitive check if an array have a key * * @param string $key Key to check * @param array $array Array to check * * @return bool */ protected function hasKey($key, $array) { foreach (array_keys($array) as $k) { if (!strcasecmp($k, $key)) { return true; } } return false; } } src/Guzzle/Http/Message/MessageInterface.php000064400000010654151742734620015055 0ustar00fieldName = $fieldName; $this->setFilename($filename); $this->contentType = $contentType ?: $this->guessContentType(); } /** * {@inheritdoc} */ public function setFieldName($name) { $this->fieldName = $name; return $this; } /** * {@inheritdoc} */ public function getFieldName() { return $this->fieldName; } /** * {@inheritdoc} */ public function setFilename($filename) { // Remove leading @ symbol if (strpos($filename, '@') === 0) { $filename = substr($filename, 1); } if (!is_readable($filename)) { throw new InvalidArgumentException("Unable to open {$filename} for reading"); } $this->filename = $filename; return $this; } /** * {@inheritdoc} */ public function getFilename() { return $this->filename; } /** * {@inheritdoc} */ public function setContentType($type) { $this->contentType = $type; return $this; } /** * {@inheritdoc} */ public function getContentType() { return $this->contentType; } /** * {@inheritdoc} */ public function getCurlString() { $disposition = ';filename=' . basename($this->filename); return $this->contentType ? '@' . $this->filename . ';type=' . $this->contentType . $disposition : '@' . $this->filename . $disposition; } /** * Determine the Content-Type of the file */ protected function guessContentType() { return Mimetypes::getInstance()->fromFilename($this->filename) ?: 'application/octet-stream'; } } src/Guzzle/Http/Message/PostFileInterface.php000064400000002277151742734620015220 0ustar00method = strtoupper($method); $this->curlOptions = new Collection(); $this->params = new Collection(); $this->setUrl($url); if ($headers) { // Special handling for multi-value headers foreach ($headers as $key => $value) { $lkey = strtolower($key); // Deal with collisions with Host and Authorization if ($lkey == 'host') { $this->setHeader($key, $value); } elseif ($lkey == 'authorization') { $parts = explode(' ', $value); if ($parts[0] == 'Basic' && isset($parts[1])) { list($user, $pass) = explode(':', base64_decode($parts[1])); $this->setAuth($user, $pass); } else { $this->setHeader($key, $value); } } else { foreach ((array) $value as $v) { $this->addHeader($key, $v); } } } } $this->setState(self::STATE_NEW); } /** * Clone the request object, leaving off any response that was received * @see Guzzle\Plugin\Redirect\RedirectPlugin::cloneRequestWithGetMethod */ public function __clone() { if ($this->eventDispatcher) { $this->eventDispatcher = clone $this->eventDispatcher; } $this->curlOptions = clone $this->curlOptions; $this->params = clone $this->params; // Remove state based parameters from the cloned request $this->params->remove('curl_handle')->remove('queued_response')->remove('curl_multi'); $this->url = clone $this->url; $this->response = $this->responseBody = null; // Clone each header foreach ($this->headers as $key => &$value) { $value = clone $value; } $this->setState(RequestInterface::STATE_NEW); $this->dispatch('request.clone', array('request' => $this)); } /** * Get the HTTP request as a string * * @return string */ public function __toString() { return $this->getRawHeaders() . "\r\n\r\n"; } /** * Default method that will throw exceptions if an unsuccessful response * is received. * * @param Event $event Received * @throws BadResponseException if the response is not successful */ public static function onRequestError(Event $event) { $e = BadResponseException::factory($event['request'], $event['response']); $event['request']->dispatch('request.exception', array( 'request' => $event['request'], 'response' => $event['response'], 'exception' => $e )); throw $e; } /** * {@inheritdoc} */ public function setClient(ClientInterface $client) { $this->client = $client; return $this; } /** * {@inheritdoc} */ public function getClient() { return $this->client; } /** * {@inheritdoc} */ public function getRawHeaders() { $protocolVersion = $this->protocolVersion ?: '1.1'; return trim($this->method . ' ' . $this->getResource()) . ' ' . strtoupper(str_replace('https', 'http', $this->url->getScheme())) . '/' . $protocolVersion . "\r\n" . implode("\r\n", $this->getHeaderLines()); } /** * {@inheritdoc} */ public function setUrl($url) { if ($url instanceof Url) { $this->url = $url; } else { $this->url = Url::factory($url); } // Update the port and host header $this->setPort($this->url->getPort()); if ($this->url->getUsername() || $this->url->getPassword()) { $this->setAuth($this->url->getUsername(), $this->url->getPassword()); // Remove the auth info from the URL $this->url->setUsername(null); $this->url->setPassword(null); } return $this; } /** * {@inheritdoc} */ public function send() { if (!$this->client) { throw new RuntimeException('A client must be set on the request'); } return $this->client->send($this); } /** * {@inheritdoc} */ public function getResponse() { return $this->response; } /** * {@inheritdoc} */ public function getQuery($asString = false) { return $asString ? (string) $this->url->getQuery() : $this->url->getQuery(); } /** * {@inheritdoc} */ public function getMethod() { return $this->method; } /** * {@inheritdoc} */ public function getScheme() { return $this->url->getScheme(); } /** * {@inheritdoc} */ public function setScheme($scheme) { $this->url->setScheme($scheme); return $this; } /** * {@inheritdoc} */ public function getHost() { return $this->url->getHost(); } /** * {@inheritdoc} */ public function setHost($host) { $this->url->setHost($host); $this->setPort($this->url->getPort()); return $this; } /** * {@inheritdoc} */ public function getProtocolVersion() { return $this->protocolVersion; } /** * {@inheritdoc} */ public function setProtocolVersion($protocol) { $this->protocolVersion = $protocol; return $this; } /** * {@inheritdoc} */ public function getPath() { return '/' . ltrim($this->url->getPath(), '/'); } /** * {@inheritdoc} */ public function setPath($path) { $this->url->setPath($path); return $this; } /** * {@inheritdoc} */ public function getPort() { return $this->url->getPort(); } /** * {@inheritdoc} */ public function setPort($port) { $this->url->setPort($port); // Include the port in the Host header if it is not the default port for the scheme of the URL $scheme = $this->url->getScheme(); if (($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) { $this->headers['host'] = new Header('Host', $this->url->getHost() . ':' . $port); } else { $this->headers['host'] = new Header('Host', $this->url->getHost()); } return $this; } /** * {@inheritdoc} */ public function getUsername() { return $this->username; } /** * {@inheritdoc} */ public function getPassword() { return $this->password; } /** * {@inheritdoc} */ public function setAuth($user, $password = '', $scheme = CURLAUTH_BASIC) { // If we got false or null, disable authentication if (!$user) { $this->password = $this->username = null; $this->removeHeader('Authorization'); $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH); } else { $this->username = $user; $this->password = $password; // Bypass CURL when using basic auth to promote connection reuse if ($scheme == CURLAUTH_BASIC) { $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH); $this->setHeader('Authorization', 'Basic ' . base64_encode($this->username . ':' . $this->password)); } else { $this->getCurlOptions() ->set(CURLOPT_HTTPAUTH, $scheme) ->set(CURLOPT_USERPWD, $this->username . ':' . $this->password); } } return $this; } /** * {@inheritdoc} */ public function getResource() { $resource = $this->getPath(); if ($query = (string) $this->url->getQuery()) { $resource .= '?' . $query; } return $resource; } /** * {@inheritdoc} */ public function getUrl($asObject = false) { return $asObject ? clone $this->url : (string) $this->url; } /** * {@inheritdoc} */ public function getState() { return $this->state; } /** * {@inheritdoc} */ public function setState($state, array $context = array()) { $this->state = $state; if ($this->state == self::STATE_NEW) { $this->response = null; } elseif ($this->state == self::STATE_COMPLETE) { $this->processResponse($context); $this->responseBody = null; } return $this; } /** * {@inheritdoc} */ public function getCurlOptions() { return $this->curlOptions; } /** * {@inheritdoc} */ public function receiveResponseHeader($data) { static $normalize = array("\r", "\n"); $this->state = self::STATE_TRANSFER; $length = strlen($data); $data = str_replace($normalize, '', $data); if (strpos($data, 'HTTP/') === 0) { $startLine = explode(' ', $data, 3); $code = $startLine[1]; $status = isset($startLine[2]) ? $startLine[2] : ''; // Only download the body of the response to the specified response // body when a successful response is received. $body = $code >= 200 && $code < 300 ? $this->getResponseBody() : EntityBody::factory(); $this->response = new Response($code, null, $body); $this->response->setStatus($code, $status)->setRequest($this); $this->dispatch('request.receive.status_line', array( 'request' => $this, 'line' => $data, 'status_code' => $code, 'reason_phrase' => $status )); } elseif (strpos($data, ':') !== false) { list($header, $value) = explode(':', $data, 2); $this->response->addHeader(trim($header), trim($value)); } return $length; } /** * {@inheritdoc} */ public function setResponse(Response $response, $queued = false) { // Never overwrite the request associated with the response (useful for redirect history) if (!$response->getRequest()) { $response->setRequest($this); } if ($queued) { $this->getParams()->set('queued_response', $response); } else { $this->getParams()->remove('queued_response'); $this->response = $response; $this->responseBody = $response->getBody(); $this->processResponse(); } $this->dispatch('request.set_response', $this->getEventArray()); return $this; } /** * {@inheritdoc} */ public function setResponseBody($body) { // Attempt to open a file for writing if a string was passed if (is_string($body)) { // @codeCoverageIgnoreStart if (!($body = fopen($body, 'w+'))) { throw new InvalidArgumentException('Could not open ' . $body . ' for writing'); } // @codeCoverageIgnoreEnd } $this->responseBody = EntityBody::factory($body); return $this; } /** * {@inheritdoc} */ public function getResponseBody() { if ($this->responseBody === null) { $this->responseBody = EntityBody::factory(); } return $this->responseBody; } /** * {@inheritdoc} */ public function isResponseBodyRepeatable() { return !$this->responseBody ? true : $this->responseBody->isSeekable() && $this->responseBody->isReadable(); } /** * {@inheritdoc} */ public function getCookies() { if ($cookie = $this->getHeader('Cookie')) { $data = ParserRegistry::getInstance()->getParser('cookie')->parseCookie($cookie); return $data['cookies']; } return array(); } /** * {@inheritdoc} */ public function getCookie($name) { $cookies = $this->getCookies(); return isset($cookies[$name]) ? $cookies[$name] : null; } /** * {@inheritdoc} */ public function addCookie($name, $value) { if (!$this->hasHeader('Cookie')) { $this->setHeader('Cookie', "{$name}={$value}"); } else { $this->getHeader('Cookie')->add("{$name}={$value}"); } // Always use semicolons to separate multiple cookie headers $this->getHeader('Cookie')->setGlue('; '); return $this; } /** * {@inheritdoc} */ public function removeCookie($name) { if ($cookie = $this->getHeader('Cookie')) { foreach ($cookie as $cookieValue) { if (strpos($cookieValue, $name . '=') === 0) { $cookie->removeValue($cookieValue); } } } return $this; } /** * {@inheritdoc} */ public function canCache() { // Only GET and HEAD requests can be cached if ($this->method != RequestInterface::GET && $this->method != RequestInterface::HEAD) { return false; } // Never cache requests when using no-store if ($this->hasCacheControlDirective('no-store')) { return false; } return true; } /** * {@inheritdoc} */ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher) { $this->eventDispatcher = $eventDispatcher; $this->eventDispatcher->addListener('request.error', array(__CLASS__, 'onRequestError'), -255); return $this; } /** * {@inheritdoc} */ public function getEventDispatcher() { if (!$this->eventDispatcher) { $this->setEventDispatcher(new EventDispatcher()); } return $this->eventDispatcher; } /** * {@inheritdoc} */ public function dispatch($eventName, array $context = array()) { $context['request'] = $this; $this->getEventDispatcher()->dispatch($eventName, new Event($context)); } /** * {@inheritdoc} * @codeCoverageIgnore */ public function addSubscriber(EventSubscriberInterface $subscriber) { $this->getEventDispatcher()->addSubscriber($subscriber); return $this; } /** * {@inheritdoc} */ public function setIsRedirect($isRedirect) { $this->isRedirect = $isRedirect; return $this; } /** * {@inheritdoc} */ public function isRedirect() { return $this->isRedirect; } /** * {@inheritdoc} */ protected function changedHeader($header) { parent::changedHeader($header); if ($header == 'host') { // If the Host header was changed, be sure to update the internal URL $this->setHost((string) $this->getHeader('Host')); } } /** * Get an array containing the request and response for event notifications * * @return array */ protected function getEventArray() { return array( 'request' => $this, 'response' => $this->response ); } /** * Process a received response * * @param array $context Contextual information * * @throws BadResponseException on unsuccessful responses */ protected function processResponse(array $context = array()) { // Use the queued response if one is set if ($this->getParams()->get('queued_response')) { $this->response = $this->getParams()->get('queued_response'); $this->responseBody = $this->response->getBody(); $this->getParams()->remove('queued_response'); } elseif (!$this->response) { // If no response, then processResponse shouldn't have been called $e = new RequestException('Error completing request'); $e->setRequest($this); throw $e; } $this->state = self::STATE_COMPLETE; // A request was sent, but we don't know if we'll send more or if the final response will be successful $this->dispatch('request.sent', $this->getEventArray() + $context); // Some response processors will remove the response or reset the state (example: ExponentialBackoffPlugin) if ($this->state == RequestInterface::STATE_COMPLETE) { // The request completed, so the HTTP transaction is complete $this->dispatch('request.complete', $this->getEventArray()); // If the response is bad, allow listeners to modify it or throw exceptions. You can change the response by // modifying the Event object in your listeners or calling setResponse() on the request if ($this->response->isError()) { $event = new Event($this->getEventArray()); $this->getEventDispatcher()->dispatch('request.error', $event); // Allow events of request.error to quietly change the response if ($event['response'] !== $this->response) { $this->response = $event['response']; } } // If a successful response was received, dispatch an event if ($this->response->isSuccessful()) { $this->dispatch('request.success', $this->getEventArray()); } } return $this; } } src/Guzzle/Http/Message/RequestFactory.php000064400000013271151742734620014626 0ustar00getParser('message')->parseRequest($message); if (!$parsed) { return false; } $request = $this->fromParts($parsed['method'], $parsed['request_url'], $parsed['headers'], $parsed['body'], $parsed['protocol'], $parsed['version']); // EntityEnclosingRequest adds an "Expect: 100-Continue" header when using a raw request body for PUT or POST // requests. This factory method should accurately reflect the message, so here we are removing the Expect // header if one was not supplied in the message. if (!isset($parsed['headers']['Expect']) && !isset($parsed['headers']['expect'])) { $request->removeHeader('Expect'); } return $request; } /** * {@inheritdoc} */ public function fromParts( $method, array $urlParts, $headers = null, $body = null, $protocol = 'HTTP', $protocolVersion = '1.1' ) { return $this->create($method, Url::buildUrl($urlParts, true), $headers, $body) ->setProtocolVersion($protocolVersion); } /** * {@inheritdoc} */ public function create($method, $url, $headers = null, $body = null) { $method = strtoupper($method); if ($method == 'GET' || $method == 'HEAD' || $method == 'TRACE' || $method == 'OPTIONS') { // Handle non-entity-enclosing request methods $request = new $this->requestClass($method, $url, $headers); if ($body) { // The body is where the response body will be stored $type = gettype($body); if ($type == 'string' || $type == 'resource' || $type == 'object') { $request->setResponseBody($body); } } return $request; } // Create an entity enclosing request by default $request = new $this->entityEnclosingRequestClass($method, $url, $headers); if ($body) { // Add POST fields and files to an entity enclosing request if an array is used if (is_array($body) || $body instanceof Collection) { // Normalize PHP style cURL uploads with a leading '@' symbol foreach ($body as $key => $value) { if (is_string($value) && substr($value, 0, 1) == '@') { $request->addPostFile($key, $value); unset($body[$key]); } } // Add the fields if they are still present and not all files $request->addPostFields($body); } else { // Add a raw entity body body to the request $request->setBody( $body, (string) $request->getHeader('Content-Type'), (string) $request->getHeader('Transfer-Encoding') == 'chunked' ); } } return $request; } /** * Clone a request while changing the method. Emulates the behavior of * {@see Guzzle\Http\Message\Request::clone}, but can change the HTTP method. * * @param RequestInterface $request Request to clone * @param string $method Method to set * * @return RequestInterface */ public function cloneRequestWithMethod(RequestInterface $request, $method) { // Create the request with the same client if possible if ($client = $request->getClient()) { $cloned = $request->getClient()->createRequest($method, $request->getUrl(), $request->getHeaders()); } else { $cloned = $this->create($method, $request->getUrl(), $request->getHeaders()); } $cloned->getCurlOptions()->replace($request->getCurlOptions()->getAll()); $cloned->setEventDispatcher(clone $request->getEventDispatcher()); // Ensure that that the Content-Length header is not copied if changing to GET or HEAD if (!($cloned instanceof EntityEnclosingRequestInterface)) { $cloned->removeHeader('Content-Length'); } elseif ($request instanceof EntityEnclosingRequestInterface) { $cloned->setBody($request->getBody()); } $cloned->getParams() ->replace($request->getParams()->getAll()) ->remove('curl_handle') ->remove('queued_response') ->remove('curl_multi'); return $cloned; } } src/Guzzle/Http/Message/RequestFactoryInterface.php000064400000004117151742734620016446 0ustar00 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported', 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Reserved for WebDAV advanced collections expired proposal', 426 => 'Upgrade required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates (Experimental)', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 510 => 'Not Extended', 511 => 'Network Authentication Required', ); /** * @var EntityBodyInterface The response body */ protected $body; /** * @var string The reason phrase of the response (human readable code) */ protected $reasonPhrase; /** * @var string The status code of the response */ protected $statusCode; /** * @var string Response protocol */ protected $protocol = 'HTTP'; /** * @var array Information about the request */ protected $info = array(); /** * @var RequestInterface Request object that may or may not be set */ protected $request = null; /** * @var array Cacheable response codes (see RFC 2616:13.4) */ protected $cacheResponseCodes = array(200, 203, 206, 300, 301, 410); /** * @var Response If a redirect was issued or an intermediate response was issued */ protected $previous; /** * Create a new Response based on a raw response message * * @param string $message Response message * * @return Response|bool Returns false on error */ public static function fromMessage($message) { $data = ParserRegistry::getInstance()->getParser('message')->parseResponse($message); if (!$data) { return false; } $response = new static($data['code'], $data['headers'], $data['body']); $response->setProtocol($data['protocol'], $data['version']) ->setStatus($data['code'], $data['reason_phrase']); // Set the appropriate Content-Length if the one set is inaccurate (e.g. setting to X) $contentLength = (string) $response->getHeader('Content-Length'); $actualLength = strlen($data['body']); if (strlen($data['body']) > 0 && $contentLength != $actualLength) { $response->setHeader('Content-Length', $actualLength); } return $response; } /** * Construct the response * * @param string $statusCode The response status code (e.g. 200, 404, etc) * @param Collection|array $headers The response headers * @param string|resource|EntityBodyInterface $body The body of the response * * @throws BadResponseException if an invalid response code is given */ public function __construct($statusCode, $headers = null, $body = null) { $this->setStatus($statusCode); $this->params = new Collection(); $this->body = EntityBody::factory($body !== null ? $body : ''); if ($headers) { if (!is_array($headers) && !($headers instanceof Collection)) { throw new BadResponseException('Invalid headers argument received'); } foreach ($headers as $key => $value) { $this->addHeaders(array($key => $value)); } } } /** * Convert the response object to a string * * @return string */ public function __toString() { return $this->getMessage(); } /** * Get the response entity body * * @param bool $asString Set to TRUE to return a string of the body rather than a full body object * * @return EntityBodyInterface|string */ public function getBody($asString = false) { return $asString ? (string) $this->body : $this->body; } /** * Set the response entity body * * @param EntityBodyInterface|string $body Body to set * * @return self */ public function setBody($body) { $this->body = EntityBody::factory($body); return $this; } /** * Set the protocol and protocol version of the response * * @param string $protocol Response protocol * @param string $version Protocol version * * @return Response */ public function setProtocol($protocol, $version) { $this->protocol = $protocol; $this->protocolVersion = $version; return $this; } /** * Get the protocol used for the response (e.g. HTTP) * * @return string */ public function getProtocol() { return $this->protocol ?: 'HTTP'; } /** * Get the HTTP protocol version * * @return string */ public function getProtocolVersion() { return $this->protocolVersion ?: '1.1'; } /** * Get a cURL transfer information * * @param string $key A single statistic to check * * @return array|string|null Returns all stats if no key is set, a single stat if a key is set, or null if a key * is set and not found * @link http://www.php.net/manual/en/function.curl-getinfo.php */ public function getInfo($key = null) { if ($key === null) { return $this->info; } elseif (array_key_exists($key, $this->info)) { return $this->info[$key]; } else { return null; } } /** * Set the transfer information * * @param array $info Array of cURL transfer stats * * @return Response */ public function setInfo(array $info) { $this->info = $info; return $this; } /** * Set the response status * * @param int $statusCode Response status code to set * @param string $reasonPhrase Response reason phrase * * @return Response * @throws BadResponseException when an invalid response code is received */ public function setStatus($statusCode, $reasonPhrase = '') { $this->statusCode = (int) $statusCode; if (!$reasonPhrase && array_key_exists($this->statusCode, self::$statusTexts)) { $this->reasonPhrase = self::$statusTexts[$this->statusCode]; } else { $this->reasonPhrase = $reasonPhrase; } return $this; } /** * Get the response status code * * @return integer */ public function getStatusCode() { return $this->statusCode; } /** * Get the entire response as a string * * @return string */ public function getMessage() { $message = $this->getRawHeaders(); // Only include the body in the message if the size is < 2MB $size = $this->body->getSize(); if ($size < 2097152) { $message .= (string) $this->body; } return $message; } /** * Get the the raw message headers as a string * * @return string */ public function getRawHeaders() { $headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . "\r\n"; $lines = $this->getHeaderLines(); if (!empty($lines)) { $headers .= implode("\r\n", $lines) . "\r\n"; } return $headers . "\r\n"; } /** * Get the request object (or null) that is associated with this response * * @return RequestInterface */ public function getRequest() { return $this->request; } /** * Get the response reason phrase- a human readable version of the numeric * status code * * @return string */ public function getReasonPhrase() { return $this->reasonPhrase; } /** * Get the Accept-Ranges HTTP header * * @return string Returns what partial content range types this server supports. */ public function getAcceptRanges() { return $this->getHeader('Accept-Ranges', true); } /** * Get the Age HTTP header * * @param bool $headerOnly Set to TRUE to only retrieve the Age header rather than calculating the age * * @return integer|null Returns the age the object has been in a proxy cache in seconds. */ public function getAge($headerOnly = false) { $age = $this->getHeader('Age', true); if (!$headerOnly && $age === null && $this->getDate()) { $age = time() - strtotime($this->getDate()); } return $age; } /** * Get the Allow HTTP header * * @return string|null Returns valid actions for a specified resource. To be used for a 405 Method not allowed. */ public function getAllow() { return $this->getHeader('Allow', true); } /** * Check if an HTTP method is allowed by checking the Allow response header * * @param string $method Method to check * * @return bool */ public function isMethodAllowed($method) { $allow = $this->getHeader('Allow'); if ($allow) { foreach (explode(',', $allow) as $allowable) { if (!strcasecmp(trim($allowable), $method)) { return true; } } } return false; } /** * Get the Cache-Control HTTP header * * @return Header|null Returns a Header object that tells all caching mechanisms from server to client whether they * may cache this object. */ public function getCacheControl() { return $this->getHeader('Cache-Control'); } /** * Get the Connection HTTP header * * @return string */ public function getConnection() { return $this->getHeader('Connection', true); } /** * Get the Content-Encoding HTTP header * * @return string|null Returns the type of encoding used on the data. One of compress, deflate, gzip, identity. */ public function getContentEncoding() { return $this->getHeader('Content-Encoding', true); } /** * Get the Content-Language HTTP header * * @return string|null Returns the language the content is in. */ public function getContentLanguage() { return $this->getHeader('Content-Language', true); } /** * Get the Content-Length HTTP header * * @return integer Returns the length of the response body in bytes */ public function getContentLength() { return (int) $this->getHeader('Content-Length', true); } /** * Get the Content-Location HTTP header * * @return string|null Returns an alternate location for the returned data (e.g /index.htm) */ public function getContentLocation() { return $this->getHeader('Content-Location', true); } /** * Get the Content-Disposition HTTP header * * @return string|null Returns the Content-Disposition header */ public function getContentDisposition() { return (string) $this->getHeader('Content-Disposition')->setGlue(';'); } /** * Get the Content-MD5 HTTP header * * @return string|null Returns a Base64-encoded binary MD5 sum of the content of the response. */ public function getContentMd5() { return $this->getHeader('Content-MD5', true); } /** * Get the Content-Range HTTP header * * @return string Returns where in a full body message this partial message belongs (e.g. bytes 21010-47021/47022). */ public function getContentRange() { return $this->getHeader('Content-Range', true); } /** * Get the Content-Type HTTP header * * @return string Returns the mime type of this content. */ public function getContentType() { return $this->getHeader('Content-Type', true); } /** * Checks if the Content-Type is of a certain type. This is useful if the * Content-Type header contains charset information and you need to know if * the Content-Type matches a particular type. * * @param string $type Content type to check against * * @return bool */ public function isContentType($type) { return stripos($this->getContentType(), $type) !== false; } /** * Get the Date HTTP header * * @return string|null Returns the date and time that the message was sent. */ public function getDate() { return $this->getHeader('Date', true); } /** * Get the ETag HTTP header * * @return string|null Returns an identifier for a specific version of a resource, often a Message digest. */ public function getEtag() { return $this->getHeader('ETag', true); } /** * Get the Expires HTTP header * * @return string|null Returns the date/time after which the response is considered stale. */ public function getExpires() { return $this->getHeader('Expires', true); } /** * Get the Last-Modified HTTP header * * @return string|null Returns the last modified date for the requested object, in RFC 2822 format * (e.g. Tue, 15 Nov 1994 12:45:26 GMT) */ public function getLastModified() { return $this->getHeader('Last-Modified', true); } /** * Get the Location HTTP header * * @return string|null Used in redirection, or when a new resource has been created. */ public function getLocation() { return $this->getHeader('Location', true); } /** * Get the Pragma HTTP header * * @return Header|null Returns the implementation-specific headers that may have various effects anywhere along * the request-response chain. */ public function getPragma() { return $this->getHeader('Pragma'); } /** * Get the Proxy-Authenticate HTTP header * * @return string|null Authentication to access the proxy (e.g. Basic) */ public function getProxyAuthenticate() { return $this->getHeader('Proxy-Authenticate', true); } /** * Get the Retry-After HTTP header * * @return int|null If an entity is temporarily unavailable, this instructs the client to try again after a * specified period of time. */ public function getRetryAfter() { $time = $this->getHeader('Retry-After', true); if ($time === null) { return null; } if (!is_numeric($time)) { $time = strtotime($time) - time(); } return (int) $time; } /** * Get the Server HTTP header * * @return string|null A name for the server */ public function getServer() { return $this->getHeader('Server', true); } /** * Get the Set-Cookie HTTP header * * @return Header|null An HTTP cookie. */ public function getSetCookie() { return $this->getHeader('Set-Cookie'); } /** * Get the Trailer HTTP header * * @return string|null The Trailer general field value indicates that the given set of header fields is present in * the trailer of a message encoded with chunked transfer-coding. */ public function getTrailer() { return $this->getHeader('Trailer', true); } /** * Get the Transfer-Encoding HTTP header * * @return string|null The form of encoding used to safely transfer the entity to the user. Currently defined * methods are: chunked */ public function getTransferEncoding() { return $this->getHeader('Transfer-Encoding', true); } /** * Get the Vary HTTP header * * @return string|null Tells downstream proxies how to match future request headers to decide whether the cached * response can be used rather than requesting a fresh one from the origin server. */ public function getVary() { return $this->getHeader('Vary', true); } /** * Get the Via HTTP header * * @return string|null Informs the client of proxies through which the response was sent. * (e.g. 1.0 fred, 1.1 nowhere.com (Apache/1.1)) */ public function getVia() { return $this->getHeader('Via', true); } /** * Get the Warning HTTP header * * @return string|null A general warning about possible problems with the entity body. * (e.g. 199 Miscellaneous warning) */ public function getWarning() { return $this->getHeader('Warning', true); } /** * Get the WWW-Authenticate HTTP header * * @return string|null Indicates the authentication scheme that should be used to access the requested entity * (e.g. Basic) */ public function getWwwAuthenticate() { return $this->getHeader('WWW-Authenticate', true); } /** * Checks if HTTP Status code is a Client Error (4xx) * * @return bool */ public function isClientError() { return $this->statusCode >= 400 && $this->statusCode < 500; } /** * Checks if HTTP Status code is Server OR Client Error (4xx or 5xx) * * @return boolean */ public function isError() { return $this->isClientError() || $this->isServerError(); } /** * Checks if HTTP Status code is Information (1xx) * * @return bool */ public function isInformational() { return $this->statusCode < 200; } /** * Checks if HTTP Status code is a Redirect (3xx) * * @return bool */ public function isRedirect() { return $this->statusCode >= 300 && $this->statusCode < 400; } /** * Checks if HTTP Status code is Server Error (5xx) * * @return bool */ public function isServerError() { return $this->statusCode >= 500 && $this->statusCode < 600; } /** * Checks if HTTP Status code is Successful (2xx | 304) * * @return bool */ public function isSuccessful() { return ($this->statusCode >= 200 && $this->statusCode < 300) || $this->statusCode == 304; } /** * Set the request object associated with the response * * @param RequestInterface $request The request object used to generate the response * * @return Response */ public function setRequest(RequestInterface $request) { $this->request = $request; return $this; } /** * Check if the response can be cached * * @return bool Returns TRUE if the response can be cached or false if not */ public function canCache() { // Check if the response is cacheable based on the code if (!in_array((int) $this->getStatusCode(), $this->cacheResponseCodes)) { return false; } // Make sure a valid body was returned and can be cached if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable()) && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) { return false; } // Never cache no-store resources (this is a private cache, so private // can be cached) if ($this->hasCacheControlDirective('no-store')) { return false; } return $this->isFresh() || $this->getFreshness() === null || $this->canValidate(); } /** * Gets the number of seconds from the current time in which this response is still considered fresh * * @return int|null Returns the number of seconds */ public function getMaxAge() { // s-max-age, then max-age, then Expires if ($age = $this->getCacheControlDirective('s-maxage')) { return $age; } if ($age = $this->getCacheControlDirective('max-age')) { return $age; } if ($this->getHeader('Expires')) { return strtotime($this->getExpires()) - time(); } return null; } /** * Check if the response is considered fresh. * * A response is considered fresh when its age is less than or equal to the freshness lifetime (maximum age) of the * response. * * @return bool|null */ public function isFresh() { $fresh = $this->getFreshness(); return $fresh === null ? null : $fresh >= 0; } /** * Check if the response can be validated against the origin server using a conditional GET request. * * @return bool */ public function canValidate() { return $this->getEtag() || $this->getLastModified(); } /** * Get the freshness of the response by returning the difference of the maximum lifetime of the response and the * age of the response (max-age - age). * * Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired. * Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL * result means that no freshness information is available. * * @return int */ public function getFreshness() { $maxAge = $this->getMaxAge(); $age = $this->getAge(); return $maxAge && $age ? ($maxAge - $age) : null; } /** * Get the previous response (e.g. Redirect response) * * @return null|Response */ public function getPreviousResponse() { return $this->previous; } /** * Set the previous response * * @param Response $response Response to set * * @return self */ public function setPreviousResponse(Response $response) { $this->previous = $response; return $this; } /** * Parse the JSON response body and return an array * * @return array|string|int|bool|float * @throws RuntimeException if the response body is not in JSON format */ public function json() { $data = json_decode((string) $this->body, true); if (JSON_ERROR_NONE !== json_last_error()) { throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error()); } return $data === null ? array() : $data; } /** * Parse the XML response body and return a SimpleXMLElement * * @return \SimpleXMLElement * @throws RuntimeException if the response body is not in XML format */ public function xml() { try { // Allow XML to be retrieved even if there is no response body $xml = new \SimpleXMLElement((string) $this->body ?: ''); } catch (\Exception $e) { throw new RuntimeException('Unable to parse response body into XML: ' . $e->getMessage()); } return $xml; } } src/Guzzle/Http/Mimetypes.php000064400000122163151742734620012237 0ustar00 'text/vnd.in3d.3dml', '3g2' => 'video/3gpp2', '3gp' => 'video/3gpp', '7z' => 'application/x-7z-compressed', 'aab' => 'application/x-authorware-bin', 'aac' => 'audio/x-aac', 'aam' => 'application/x-authorware-map', 'aas' => 'application/x-authorware-seg', 'abw' => 'application/x-abiword', 'ac' => 'application/pkix-attr-cert', 'acc' => 'application/vnd.americandynamics.acc', 'ace' => 'application/x-ace-compressed', 'acu' => 'application/vnd.acucobol', 'acutc' => 'application/vnd.acucorp', 'adp' => 'audio/adpcm', 'aep' => 'application/vnd.audiograph', 'afm' => 'application/x-font-type1', 'afp' => 'application/vnd.ibm.modcap', 'ahead' => 'application/vnd.ahead.space', 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'air' => 'application/vnd.adobe.air-application-installer-package+zip', 'ait' => 'application/vnd.dvb.ait', 'ami' => 'application/vnd.amiga.ami', 'apk' => 'application/vnd.android.package-archive', 'application' => 'application/x-ms-application', 'apr' => 'application/vnd.lotus-approach', 'asa' => 'text/plain', 'asax' => 'application/octet-stream', 'asc' => 'application/pgp-signature', 'ascx' => 'text/plain', 'asf' => 'video/x-ms-asf', 'ashx' => 'text/plain', 'asm' => 'text/x-asm', 'asmx' => 'text/plain', 'aso' => 'application/vnd.accpac.simply.aso', 'asp' => 'text/plain', 'aspx' => 'text/plain', 'asx' => 'video/x-ms-asf', 'atc' => 'application/vnd.acucorp', 'atom' => 'application/atom+xml', 'atomcat' => 'application/atomcat+xml', 'atomsvc' => 'application/atomsvc+xml', 'atx' => 'application/vnd.antix.game-component', 'au' => 'audio/basic', 'avi' => 'video/x-msvideo', 'aw' => 'application/applixware', 'axd' => 'text/plain', 'azf' => 'application/vnd.airzip.filesecure.azf', 'azs' => 'application/vnd.airzip.filesecure.azs', 'azw' => 'application/vnd.amazon.ebook', 'bat' => 'application/x-msdownload', 'bcpio' => 'application/x-bcpio', 'bdf' => 'application/x-font-bdf', 'bdm' => 'application/vnd.syncml.dm+wbxml', 'bed' => 'application/vnd.realvnc.bed', 'bh2' => 'application/vnd.fujitsu.oasysprs', 'bin' => 'application/octet-stream', 'bmi' => 'application/vnd.bmi', 'bmp' => 'image/bmp', 'book' => 'application/vnd.framemaker', 'box' => 'application/vnd.previewsystems.box', 'boz' => 'application/x-bzip2', 'bpk' => 'application/octet-stream', 'btif' => 'image/prs.btif', 'bz' => 'application/x-bzip', 'bz2' => 'application/x-bzip2', 'c' => 'text/x-c', 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', 'c4d' => 'application/vnd.clonk.c4group', 'c4f' => 'application/vnd.clonk.c4group', 'c4g' => 'application/vnd.clonk.c4group', 'c4p' => 'application/vnd.clonk.c4group', 'c4u' => 'application/vnd.clonk.c4group', 'cab' => 'application/vnd.ms-cab-compressed', 'car' => 'application/vnd.curl.car', 'cat' => 'application/vnd.ms-pki.seccat', 'cc' => 'text/x-c', 'cct' => 'application/x-director', 'ccxml' => 'application/ccxml+xml', 'cdbcmsg' => 'application/vnd.contact.cmsg', 'cdf' => 'application/x-netcdf', 'cdkey' => 'application/vnd.mediastation.cdkey', 'cdmia' => 'application/cdmi-capability', 'cdmic' => 'application/cdmi-container', 'cdmid' => 'application/cdmi-domain', 'cdmio' => 'application/cdmi-object', 'cdmiq' => 'application/cdmi-queue', 'cdx' => 'chemical/x-cdx', 'cdxml' => 'application/vnd.chemdraw+xml', 'cdy' => 'application/vnd.cinderella', 'cer' => 'application/pkix-cert', 'cfc' => 'application/x-coldfusion', 'cfm' => 'application/x-coldfusion', 'cgm' => 'image/cgm', 'chat' => 'application/x-chat', 'chm' => 'application/vnd.ms-htmlhelp', 'chrt' => 'application/vnd.kde.kchart', 'cif' => 'chemical/x-cif', 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', 'cil' => 'application/vnd.ms-artgalry', 'cla' => 'application/vnd.claymore', 'class' => 'application/java-vm', 'clkk' => 'application/vnd.crick.clicker.keyboard', 'clkp' => 'application/vnd.crick.clicker.palette', 'clkt' => 'application/vnd.crick.clicker.template', 'clkw' => 'application/vnd.crick.clicker.wordbank', 'clkx' => 'application/vnd.crick.clicker', 'clp' => 'application/x-msclip', 'cmc' => 'application/vnd.cosmocaller', 'cmdf' => 'chemical/x-cmdf', 'cml' => 'chemical/x-cml', 'cmp' => 'application/vnd.yellowriver-custom-menu', 'cmx' => 'image/x-cmx', 'cod' => 'application/vnd.rim.cod', 'com' => 'application/x-msdownload', 'conf' => 'text/plain', 'cpio' => 'application/x-cpio', 'cpp' => 'text/x-c', 'cpt' => 'application/mac-compactpro', 'crd' => 'application/x-mscardfile', 'crl' => 'application/pkix-crl', 'crt' => 'application/x-x509-ca-cert', 'cryptonote' => 'application/vnd.rig.cryptonote', 'cs' => 'text/plain', 'csh' => 'application/x-csh', 'csml' => 'chemical/x-csml', 'csp' => 'application/vnd.commonspace', 'css' => 'text/css', 'cst' => 'application/x-director', 'csv' => 'text/csv', 'cu' => 'application/cu-seeme', 'curl' => 'text/vnd.curl', 'cww' => 'application/prs.cww', 'cxt' => 'application/x-director', 'cxx' => 'text/x-c', 'dae' => 'model/vnd.collada+xml', 'daf' => 'application/vnd.mobius.daf', 'dataless' => 'application/vnd.fdsn.seed', 'davmount' => 'application/davmount+xml', 'dcr' => 'application/x-director', 'dcurl' => 'text/vnd.curl.dcurl', 'dd2' => 'application/vnd.oma.dd2+xml', 'ddd' => 'application/vnd.fujixerox.ddd', 'deb' => 'application/x-debian-package', 'def' => 'text/plain', 'deploy' => 'application/octet-stream', 'der' => 'application/x-x509-ca-cert', 'dfac' => 'application/vnd.dreamfactory', 'dic' => 'text/x-c', 'dir' => 'application/x-director', 'dis' => 'application/vnd.mobius.dis', 'dist' => 'application/octet-stream', 'distz' => 'application/octet-stream', 'djv' => 'image/vnd.djvu', 'djvu' => 'image/vnd.djvu', 'dll' => 'application/x-msdownload', 'dmg' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'dna' => 'application/vnd.dna', 'doc' => 'application/msword', 'docm' => 'application/vnd.ms-word.document.macroenabled.12', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dot' => 'application/msword', 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dp' => 'application/vnd.osgi.dp', 'dpg' => 'application/vnd.dpgraph', 'dra' => 'audio/vnd.dra', 'dsc' => 'text/prs.lines.tag', 'dssc' => 'application/dssc+der', 'dtb' => 'application/x-dtbook+xml', 'dtd' => 'application/xml-dtd', 'dts' => 'audio/vnd.dts', 'dtshd' => 'audio/vnd.dts.hd', 'dump' => 'application/octet-stream', 'dvi' => 'application/x-dvi', 'dwf' => 'model/vnd.dwf', 'dwg' => 'image/vnd.dwg', 'dxf' => 'image/vnd.dxf', 'dxp' => 'application/vnd.spotfire.dxp', 'dxr' => 'application/x-director', 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', 'ecma' => 'application/ecmascript', 'edm' => 'application/vnd.novadigm.edm', 'edx' => 'application/vnd.novadigm.edx', 'efif' => 'application/vnd.picsel', 'ei6' => 'application/vnd.pg.osasli', 'elc' => 'application/octet-stream', 'eml' => 'message/rfc822', 'emma' => 'application/emma+xml', 'eol' => 'audio/vnd.digital-winds', 'eot' => 'application/vnd.ms-fontobject', 'eps' => 'application/postscript', 'epub' => 'application/epub+zip', 'es3' => 'application/vnd.eszigno3+xml', 'esf' => 'application/vnd.epson.esf', 'et3' => 'application/vnd.eszigno3+xml', 'etx' => 'text/x-setext', 'exe' => 'application/x-msdownload', 'exi' => 'application/exi', 'ext' => 'application/vnd.novadigm.ext', 'ez' => 'application/andrew-inset', 'ez2' => 'application/vnd.ezpix-album', 'ez3' => 'application/vnd.ezpix-package', 'f' => 'text/x-fortran', 'f4v' => 'video/x-f4v', 'f77' => 'text/x-fortran', 'f90' => 'text/x-fortran', 'fbs' => 'image/vnd.fastbidsheet', 'fcs' => 'application/vnd.isac.fcs', 'fdf' => 'application/vnd.fdf', 'fe_launch' => 'application/vnd.denovo.fcselayout-link', 'fg5' => 'application/vnd.fujitsu.oasysgp', 'fgd' => 'application/x-director', 'fh' => 'image/x-freehand', 'fh4' => 'image/x-freehand', 'fh5' => 'image/x-freehand', 'fh7' => 'image/x-freehand', 'fhc' => 'image/x-freehand', 'fig' => 'application/x-xfig', 'fli' => 'video/x-fli', 'flo' => 'application/vnd.micrografx.flo', 'flv' => 'video/x-flv', 'flw' => 'application/vnd.kde.kivio', 'flx' => 'text/vnd.fmi.flexstor', 'fly' => 'text/vnd.fly', 'fm' => 'application/vnd.framemaker', 'fnc' => 'application/vnd.frogans.fnc', 'for' => 'text/x-fortran', 'fpx' => 'image/vnd.fpx', 'frame' => 'application/vnd.framemaker', 'fsc' => 'application/vnd.fsc.weblaunch', 'fst' => 'image/vnd.fst', 'ftc' => 'application/vnd.fluxtime.clip', 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', 'fvt' => 'video/vnd.fvt', 'fxp' => 'application/vnd.adobe.fxp', 'fxpl' => 'application/vnd.adobe.fxp', 'fzs' => 'application/vnd.fuzzysheet', 'g2w' => 'application/vnd.geoplan', 'g3' => 'image/g3fax', 'g3w' => 'application/vnd.geospace', 'gac' => 'application/vnd.groove-account', 'gdl' => 'model/vnd.gdl', 'geo' => 'application/vnd.dynageo', 'gex' => 'application/vnd.geometry-explorer', 'ggb' => 'application/vnd.geogebra.file', 'ggt' => 'application/vnd.geogebra.tool', 'ghf' => 'application/vnd.groove-help', 'gif' => 'image/gif', 'gim' => 'application/vnd.groove-identity-message', 'gmx' => 'application/vnd.gmx', 'gnumeric' => 'application/x-gnumeric', 'gph' => 'application/vnd.flographit', 'gqf' => 'application/vnd.grafeq', 'gqs' => 'application/vnd.grafeq', 'gram' => 'application/srgs', 'gre' => 'application/vnd.geometry-explorer', 'grv' => 'application/vnd.groove-injector', 'grxml' => 'application/srgs+xml', 'gsf' => 'application/x-font-ghostscript', 'gtar' => 'application/x-gtar', 'gtm' => 'application/vnd.groove-tool-message', 'gtw' => 'model/vnd.gtw', 'gv' => 'text/vnd.graphviz', 'gxt' => 'application/vnd.geonext', 'h' => 'text/x-c', 'h261' => 'video/h261', 'h263' => 'video/h263', 'h264' => 'video/h264', 'hal' => 'application/vnd.hal+xml', 'hbci' => 'application/vnd.hbci', 'hdf' => 'application/x-hdf', 'hh' => 'text/x-c', 'hlp' => 'application/winhlp', 'hpgl' => 'application/vnd.hp-hpgl', 'hpid' => 'application/vnd.hp-hpid', 'hps' => 'application/vnd.hp-hps', 'hqx' => 'application/mac-binhex40', 'hta' => 'application/octet-stream', 'htc' => 'text/html', 'htke' => 'application/vnd.kenameaapp', 'htm' => 'text/html', 'html' => 'text/html', 'hvd' => 'application/vnd.yamaha.hv-dic', 'hvp' => 'application/vnd.yamaha.hv-voice', 'hvs' => 'application/vnd.yamaha.hv-script', 'i2g' => 'application/vnd.intergeo', 'icc' => 'application/vnd.iccprofile', 'ice' => 'x-conference/x-cooltalk', 'icm' => 'application/vnd.iccprofile', 'ico' => 'image/x-icon', 'ics' => 'text/calendar', 'ief' => 'image/ief', 'ifb' => 'text/calendar', 'ifm' => 'application/vnd.shana.informed.formdata', 'iges' => 'model/iges', 'igl' => 'application/vnd.igloader', 'igm' => 'application/vnd.insors.igm', 'igs' => 'model/iges', 'igx' => 'application/vnd.micrografx.igx', 'iif' => 'application/vnd.shana.informed.interchange', 'imp' => 'application/vnd.accpac.simply.imp', 'ims' => 'application/vnd.ms-ims', 'in' => 'text/plain', 'ini' => 'text/plain', 'ipfix' => 'application/ipfix', 'ipk' => 'application/vnd.shana.informed.package', 'irm' => 'application/vnd.ibm.rights-management', 'irp' => 'application/vnd.irepository.package+xml', 'iso' => 'application/octet-stream', 'itp' => 'application/vnd.shana.informed.formtemplate', 'ivp' => 'application/vnd.immervision-ivp', 'ivu' => 'application/vnd.immervision-ivu', 'jad' => 'text/vnd.sun.j2me.app-descriptor', 'jam' => 'application/vnd.jam', 'jar' => 'application/java-archive', 'java' => 'text/x-java-source', 'jisp' => 'application/vnd.jisp', 'jlt' => 'application/vnd.hp-jlyt', 'jnlp' => 'application/x-java-jnlp-file', 'joda' => 'application/vnd.joost.joda-archive', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpgm' => 'video/jpm', 'jpgv' => 'video/jpeg', 'jpm' => 'video/jpm', 'js' => 'text/javascript', 'json' => 'application/json', 'kar' => 'audio/midi', 'karbon' => 'application/vnd.kde.karbon', 'kfo' => 'application/vnd.kde.kformula', 'kia' => 'application/vnd.kidspiration', 'kml' => 'application/vnd.google-earth.kml+xml', 'kmz' => 'application/vnd.google-earth.kmz', 'kne' => 'application/vnd.kinar', 'knp' => 'application/vnd.kinar', 'kon' => 'application/vnd.kde.kontour', 'kpr' => 'application/vnd.kde.kpresenter', 'kpt' => 'application/vnd.kde.kpresenter', 'ksp' => 'application/vnd.kde.kspread', 'ktr' => 'application/vnd.kahootz', 'ktx' => 'image/ktx', 'ktz' => 'application/vnd.kahootz', 'kwd' => 'application/vnd.kde.kword', 'kwt' => 'application/vnd.kde.kword', 'lasxml' => 'application/vnd.las.las+xml', 'latex' => 'application/x-latex', 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', 'les' => 'application/vnd.hhe.lesson-player', 'lha' => 'application/octet-stream', 'link66' => 'application/vnd.route66.link66+xml', 'list' => 'text/plain', 'list3820' => 'application/vnd.ibm.modcap', 'listafp' => 'application/vnd.ibm.modcap', 'log' => 'text/plain', 'lostxml' => 'application/lost+xml', 'lrf' => 'application/octet-stream', 'lrm' => 'application/vnd.ms-lrm', 'ltf' => 'application/vnd.frogans.ltf', 'lvp' => 'audio/vnd.lucent.voice', 'lwp' => 'application/vnd.lotus-wordpro', 'lzh' => 'application/octet-stream', 'm13' => 'application/x-msmediaview', 'm14' => 'application/x-msmediaview', 'm1v' => 'video/mpeg', 'm21' => 'application/mp21', 'm2a' => 'audio/mpeg', 'm2v' => 'video/mpeg', 'm3a' => 'audio/mpeg', 'm3u' => 'audio/x-mpegurl', 'm3u8' => 'application/vnd.apple.mpegurl', 'm4a' => 'audio/mp4', 'm4u' => 'video/vnd.mpegurl', 'm4v' => 'video/mp4', 'ma' => 'application/mathematica', 'mads' => 'application/mads+xml', 'mag' => 'application/vnd.ecowin.chart', 'maker' => 'application/vnd.framemaker', 'man' => 'text/troff', 'mathml' => 'application/mathml+xml', 'mb' => 'application/mathematica', 'mbk' => 'application/vnd.mobius.mbk', 'mbox' => 'application/mbox', 'mc1' => 'application/vnd.medcalcdata', 'mcd' => 'application/vnd.mcd', 'mcurl' => 'text/vnd.curl.mcurl', 'mdb' => 'application/x-msaccess', 'mdi' => 'image/vnd.ms-modi', 'me' => 'text/troff', 'mesh' => 'model/mesh', 'meta4' => 'application/metalink4+xml', 'mets' => 'application/mets+xml', 'mfm' => 'application/vnd.mfmp', 'mgp' => 'application/vnd.osgeo.mapguide.package', 'mgz' => 'application/vnd.proteus.magazine', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mif' => 'application/vnd.mif', 'mime' => 'message/rfc822', 'mj2' => 'video/mj2', 'mjp2' => 'video/mj2', 'mlp' => 'application/vnd.dolby.mlp', 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', 'mmf' => 'application/vnd.smaf', 'mmr' => 'image/vnd.fujixerox.edmics-mmr', 'mny' => 'application/x-msmoney', 'mobi' => 'application/x-mobipocket-ebook', 'mods' => 'application/mods+xml', 'mov' => 'video/quicktime', 'movie' => 'video/x-sgi-movie', 'mp2' => 'audio/mpeg', 'mp21' => 'application/mp21', 'mp2a' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mp4' => 'video/mp4', 'mp4a' => 'audio/mp4', 'mp4s' => 'application/mp4', 'mp4v' => 'video/mp4', 'mpc' => 'application/vnd.mophun.certificate', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpg4' => 'video/mp4', 'mpga' => 'audio/mpeg', 'mpkg' => 'application/vnd.apple.installer+xml', 'mpm' => 'application/vnd.blueice.multipass', 'mpn' => 'application/vnd.mophun.application', 'mpp' => 'application/vnd.ms-project', 'mpt' => 'application/vnd.ms-project', 'mpy' => 'application/vnd.ibm.minipay', 'mqy' => 'application/vnd.mobius.mqy', 'mrc' => 'application/marc', 'mrcx' => 'application/marcxml+xml', 'ms' => 'text/troff', 'mscml' => 'application/mediaservercontrol+xml', 'mseed' => 'application/vnd.fdsn.mseed', 'mseq' => 'application/vnd.mseq', 'msf' => 'application/vnd.epson.msf', 'msh' => 'model/mesh', 'msi' => 'application/x-msdownload', 'msl' => 'application/vnd.mobius.msl', 'msty' => 'application/vnd.muvee.style', 'mts' => 'model/vnd.mts', 'mus' => 'application/vnd.musician', 'musicxml' => 'application/vnd.recordare.musicxml+xml', 'mvb' => 'application/x-msmediaview', 'mwf' => 'application/vnd.mfer', 'mxf' => 'application/mxf', 'mxl' => 'application/vnd.recordare.musicxml', 'mxml' => 'application/xv+xml', 'mxs' => 'application/vnd.triscape.mxs', 'mxu' => 'video/vnd.mpegurl', 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', 'n3' => 'text/n3', 'nb' => 'application/mathematica', 'nbp' => 'application/vnd.wolfram.player', 'nc' => 'application/x-netcdf', 'ncx' => 'application/x-dtbncx+xml', 'ngdat' => 'application/vnd.nokia.n-gage.data', 'nlu' => 'application/vnd.neurolanguage.nlu', 'nml' => 'application/vnd.enliven', 'nnd' => 'application/vnd.noblenet-directory', 'nns' => 'application/vnd.noblenet-sealer', 'nnw' => 'application/vnd.noblenet-web', 'npx' => 'image/vnd.net-fpx', 'nsf' => 'application/vnd.lotus-notes', 'oa2' => 'application/vnd.fujitsu.oasys2', 'oa3' => 'application/vnd.fujitsu.oasys3', 'oas' => 'application/vnd.fujitsu.oasys', 'obd' => 'application/x-msbinder', 'oda' => 'application/oda', 'odb' => 'application/vnd.oasis.opendocument.database', 'odc' => 'application/vnd.oasis.opendocument.chart', 'odf' => 'application/vnd.oasis.opendocument.formula', 'odft' => 'application/vnd.oasis.opendocument.formula-template', 'odg' => 'application/vnd.oasis.opendocument.graphics', 'odi' => 'application/vnd.oasis.opendocument.image', 'odm' => 'application/vnd.oasis.opendocument.text-master', 'odp' => 'application/vnd.oasis.opendocument.presentation', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'odt' => 'application/vnd.oasis.opendocument.text', 'oga' => 'audio/ogg', 'ogg' => 'audio/ogg', 'ogv' => 'video/ogg', 'ogx' => 'application/ogg', 'onepkg' => 'application/onenote', 'onetmp' => 'application/onenote', 'onetoc' => 'application/onenote', 'onetoc2' => 'application/onenote', 'opf' => 'application/oebps-package+xml', 'oprc' => 'application/vnd.palm', 'org' => 'application/vnd.lotus-organizer', 'osf' => 'application/vnd.yamaha.openscoreformat', 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', 'otc' => 'application/vnd.oasis.opendocument.chart-template', 'otf' => 'application/x-font-otf', 'otg' => 'application/vnd.oasis.opendocument.graphics-template', 'oth' => 'application/vnd.oasis.opendocument.text-web', 'oti' => 'application/vnd.oasis.opendocument.image-template', 'otp' => 'application/vnd.oasis.opendocument.presentation-template', 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', 'ott' => 'application/vnd.oasis.opendocument.text-template', 'oxt' => 'application/vnd.openofficeorg.extension', 'p' => 'text/x-pascal', 'p10' => 'application/pkcs10', 'p12' => 'application/x-pkcs12', 'p7b' => 'application/x-pkcs7-certificates', 'p7c' => 'application/pkcs7-mime', 'p7m' => 'application/pkcs7-mime', 'p7r' => 'application/x-pkcs7-certreqresp', 'p7s' => 'application/pkcs7-signature', 'p8' => 'application/pkcs8', 'pas' => 'text/x-pascal', 'paw' => 'application/vnd.pawaafile', 'pbd' => 'application/vnd.powerbuilder6', 'pbm' => 'image/x-portable-bitmap', 'pcf' => 'application/x-font-pcf', 'pcl' => 'application/vnd.hp-pcl', 'pclxl' => 'application/vnd.hp-pclxl', 'pct' => 'image/x-pict', 'pcurl' => 'application/vnd.curl.pcurl', 'pcx' => 'image/x-pcx', 'pdb' => 'application/vnd.palm', 'pdf' => 'application/pdf', 'pfa' => 'application/x-font-type1', 'pfb' => 'application/x-font-type1', 'pfm' => 'application/x-font-type1', 'pfr' => 'application/font-tdpfr', 'pfx' => 'application/x-pkcs12', 'pgm' => 'image/x-portable-graymap', 'pgn' => 'application/x-chess-pgn', 'pgp' => 'application/pgp-encrypted', 'php' => 'text/x-php', 'phps' => 'application/x-httpd-phps', 'pic' => 'image/x-pict', 'pkg' => 'application/octet-stream', 'pki' => 'application/pkixcmp', 'pkipath' => 'application/pkix-pkipath', 'plb' => 'application/vnd.3gpp.pic-bw-large', 'plc' => 'application/vnd.mobius.plc', 'plf' => 'application/vnd.pocketlearn', 'pls' => 'application/pls+xml', 'pml' => 'application/vnd.ctc-posml', 'png' => 'image/png', 'pnm' => 'image/x-portable-anymap', 'portpkg' => 'application/vnd.macports.portpkg', 'pot' => 'application/vnd.ms-powerpoint', 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', 'ppd' => 'application/vnd.cups-ppd', 'ppm' => 'image/x-portable-pixmap', 'pps' => 'application/vnd.ms-powerpoint', 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppt' => 'application/vnd.ms-powerpoint', 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pqa' => 'application/vnd.palm', 'prc' => 'application/x-mobipocket-ebook', 'pre' => 'application/vnd.lotus-freelance', 'prf' => 'application/pics-rules', 'ps' => 'application/postscript', 'psb' => 'application/vnd.3gpp.pic-bw-small', 'psd' => 'image/vnd.adobe.photoshop', 'psf' => 'application/x-font-linux-psf', 'pskcxml' => 'application/pskc+xml', 'ptid' => 'application/vnd.pvi.ptid1', 'pub' => 'application/x-mspublisher', 'pvb' => 'application/vnd.3gpp.pic-bw-var', 'pwn' => 'application/vnd.3m.post-it-notes', 'pya' => 'audio/vnd.ms-playready.media.pya', 'pyv' => 'video/vnd.ms-playready.media.pyv', 'qam' => 'application/vnd.epson.quickanime', 'qbo' => 'application/vnd.intu.qbo', 'qfx' => 'application/vnd.intu.qfx', 'qps' => 'application/vnd.publishare-delta-tree', 'qt' => 'video/quicktime', 'qwd' => 'application/vnd.quark.quarkxpress', 'qwt' => 'application/vnd.quark.quarkxpress', 'qxb' => 'application/vnd.quark.quarkxpress', 'qxd' => 'application/vnd.quark.quarkxpress', 'qxl' => 'application/vnd.quark.quarkxpress', 'qxt' => 'application/vnd.quark.quarkxpress', 'ra' => 'audio/x-pn-realaudio', 'ram' => 'audio/x-pn-realaudio', 'rar' => 'application/x-rar-compressed', 'ras' => 'image/x-cmu-raster', 'rb' => 'text/plain', 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', 'rdf' => 'application/rdf+xml', 'rdz' => 'application/vnd.data-vision.rdz', 'rep' => 'application/vnd.businessobjects', 'res' => 'application/x-dtbresource+xml', 'resx' => 'text/xml', 'rgb' => 'image/x-rgb', 'rif' => 'application/reginfo+xml', 'rip' => 'audio/vnd.rip', 'rl' => 'application/resource-lists+xml', 'rlc' => 'image/vnd.fujixerox.edmics-rlc', 'rld' => 'application/resource-lists-diff+xml', 'rm' => 'application/vnd.rn-realmedia', 'rmi' => 'audio/midi', 'rmp' => 'audio/x-pn-realaudio-plugin', 'rms' => 'application/vnd.jcp.javame.midlet-rms', 'rnc' => 'application/relax-ng-compact-syntax', 'roff' => 'text/troff', 'rp9' => 'application/vnd.cloanto.rp9', 'rpss' => 'application/vnd.nokia.radio-presets', 'rpst' => 'application/vnd.nokia.radio-preset', 'rq' => 'application/sparql-query', 'rs' => 'application/rls-services+xml', 'rsd' => 'application/rsd+xml', 'rss' => 'application/rss+xml', 'rtf' => 'application/rtf', 'rtx' => 'text/richtext', 's' => 'text/x-asm', 'saf' => 'application/vnd.yamaha.smaf-audio', 'sbml' => 'application/sbml+xml', 'sc' => 'application/vnd.ibm.secure-container', 'scd' => 'application/x-msschedule', 'scm' => 'application/vnd.lotus-screencam', 'scq' => 'application/scvp-cv-request', 'scs' => 'application/scvp-cv-response', 'scurl' => 'text/vnd.curl.scurl', 'sda' => 'application/vnd.stardivision.draw', 'sdc' => 'application/vnd.stardivision.calc', 'sdd' => 'application/vnd.stardivision.impress', 'sdkd' => 'application/vnd.solent.sdkm+xml', 'sdkm' => 'application/vnd.solent.sdkm+xml', 'sdp' => 'application/sdp', 'sdw' => 'application/vnd.stardivision.writer', 'see' => 'application/vnd.seemail', 'seed' => 'application/vnd.fdsn.seed', 'sema' => 'application/vnd.sema', 'semd' => 'application/vnd.semd', 'semf' => 'application/vnd.semf', 'ser' => 'application/java-serialized-object', 'setpay' => 'application/set-payment-initiation', 'setreg' => 'application/set-registration-initiation', 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', 'sfs' => 'application/vnd.spotfire.sfs', 'sgl' => 'application/vnd.stardivision.writer-global', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'shf' => 'application/shf+xml', 'sig' => 'application/pgp-signature', 'silo' => 'model/mesh', 'sis' => 'application/vnd.symbian.install', 'sisx' => 'application/vnd.symbian.install', 'sit' => 'application/x-stuffit', 'sitx' => 'application/x-stuffitx', 'skd' => 'application/vnd.koan', 'skm' => 'application/vnd.koan', 'skp' => 'application/vnd.koan', 'skt' => 'application/vnd.koan', 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', 'slt' => 'application/vnd.epson.salt', 'sm' => 'application/vnd.stepmania.stepchart', 'smf' => 'application/vnd.stardivision.math', 'smi' => 'application/smil+xml', 'smil' => 'application/smil+xml', 'snd' => 'audio/basic', 'snf' => 'application/x-font-snf', 'so' => 'application/octet-stream', 'spc' => 'application/x-pkcs7-certificates', 'spf' => 'application/vnd.yamaha.smaf-phrase', 'spl' => 'application/x-futuresplash', 'spot' => 'text/vnd.in3d.spot', 'spp' => 'application/scvp-vp-response', 'spq' => 'application/scvp-vp-request', 'spx' => 'audio/ogg', 'src' => 'application/x-wais-source', 'sru' => 'application/sru+xml', 'srx' => 'application/sparql-results+xml', 'sse' => 'application/vnd.kodak-descriptor', 'ssf' => 'application/vnd.epson.ssf', 'ssml' => 'application/ssml+xml', 'st' => 'application/vnd.sailingtracker.track', 'stc' => 'application/vnd.sun.xml.calc.template', 'std' => 'application/vnd.sun.xml.draw.template', 'stf' => 'application/vnd.wt.stf', 'sti' => 'application/vnd.sun.xml.impress.template', 'stk' => 'application/hyperstudio', 'stl' => 'application/vnd.ms-pki.stl', 'str' => 'application/vnd.pg.format', 'stw' => 'application/vnd.sun.xml.writer.template', 'sub' => 'image/vnd.dvb.subtitle', 'sus' => 'application/vnd.sus-calendar', 'susp' => 'application/vnd.sus-calendar', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'svc' => 'application/vnd.dvb.service', 'svd' => 'application/vnd.svd', 'svg' => 'image/svg+xml', 'svgz' => 'image/svg+xml', 'swa' => 'application/x-director', 'swf' => 'application/x-shockwave-flash', 'swi' => 'application/vnd.aristanetworks.swi', 'sxc' => 'application/vnd.sun.xml.calc', 'sxd' => 'application/vnd.sun.xml.draw', 'sxg' => 'application/vnd.sun.xml.writer.global', 'sxi' => 'application/vnd.sun.xml.impress', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 't' => 'text/troff', 'tao' => 'application/vnd.tao.intent-module-archive', 'tar' => 'application/x-tar', 'tcap' => 'application/vnd.3gpp2.tcap', 'tcl' => 'application/x-tcl', 'teacher' => 'application/vnd.smart.teacher', 'tei' => 'application/tei+xml', 'teicorpus' => 'application/tei+xml', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'text' => 'text/plain', 'tfi' => 'application/thraud+xml', 'tfm' => 'application/x-tex-tfm', 'thmx' => 'application/vnd.ms-officetheme', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'tmo' => 'application/vnd.tmobile-livetv', 'torrent' => 'application/x-bittorrent', 'tpl' => 'application/vnd.groove-tool-template', 'tpt' => 'application/vnd.trid.tpt', 'tr' => 'text/troff', 'tra' => 'application/vnd.trueapp', 'trm' => 'application/x-msterminal', 'tsd' => 'application/timestamped-data', 'tsv' => 'text/tab-separated-values', 'ttc' => 'application/x-font-ttf', 'ttf' => 'application/x-font-ttf', 'ttl' => 'text/turtle', 'twd' => 'application/vnd.simtech-mindmapper', 'twds' => 'application/vnd.simtech-mindmapper', 'txd' => 'application/vnd.genomatix.tuxedo', 'txf' => 'application/vnd.mobius.txf', 'txt' => 'text/plain', 'u32' => 'application/x-authorware-bin', 'udeb' => 'application/x-debian-package', 'ufd' => 'application/vnd.ufdl', 'ufdl' => 'application/vnd.ufdl', 'umj' => 'application/vnd.umajin', 'unityweb' => 'application/vnd.unity', 'uoml' => 'application/vnd.uoml+xml', 'uri' => 'text/uri-list', 'uris' => 'text/uri-list', 'urls' => 'text/uri-list', 'ustar' => 'application/x-ustar', 'utz' => 'application/vnd.uiq.theme', 'uu' => 'text/x-uuencode', 'uva' => 'audio/vnd.dece.audio', 'uvd' => 'application/vnd.dece.data', 'uvf' => 'application/vnd.dece.data', 'uvg' => 'image/vnd.dece.graphic', 'uvh' => 'video/vnd.dece.hd', 'uvi' => 'image/vnd.dece.graphic', 'uvm' => 'video/vnd.dece.mobile', 'uvp' => 'video/vnd.dece.pd', 'uvs' => 'video/vnd.dece.sd', 'uvt' => 'application/vnd.dece.ttml+xml', 'uvu' => 'video/vnd.uvvu.mp4', 'uvv' => 'video/vnd.dece.video', 'uvva' => 'audio/vnd.dece.audio', 'uvvd' => 'application/vnd.dece.data', 'uvvf' => 'application/vnd.dece.data', 'uvvg' => 'image/vnd.dece.graphic', 'uvvh' => 'video/vnd.dece.hd', 'uvvi' => 'image/vnd.dece.graphic', 'uvvm' => 'video/vnd.dece.mobile', 'uvvp' => 'video/vnd.dece.pd', 'uvvs' => 'video/vnd.dece.sd', 'uvvt' => 'application/vnd.dece.ttml+xml', 'uvvu' => 'video/vnd.uvvu.mp4', 'uvvv' => 'video/vnd.dece.video', 'uvvx' => 'application/vnd.dece.unspecified', 'uvx' => 'application/vnd.dece.unspecified', 'vcd' => 'application/x-cdlink', 'vcf' => 'text/x-vcard', 'vcg' => 'application/vnd.groove-vcard', 'vcs' => 'text/x-vcalendar', 'vcx' => 'application/vnd.vcx', 'vis' => 'application/vnd.visionary', 'viv' => 'video/vnd.vivo', 'vor' => 'application/vnd.stardivision.writer', 'vox' => 'application/x-authorware-bin', 'vrml' => 'model/vrml', 'vsd' => 'application/vnd.visio', 'vsf' => 'application/vnd.vsf', 'vss' => 'application/vnd.visio', 'vst' => 'application/vnd.visio', 'vsw' => 'application/vnd.visio', 'vtu' => 'model/vnd.vtu', 'vxml' => 'application/voicexml+xml', 'w3d' => 'application/x-director', 'wad' => 'application/x-doom', 'wav' => 'audio/x-wav', 'wax' => 'audio/x-ms-wax', 'wbmp' => 'image/vnd.wap.wbmp', 'wbs' => 'application/vnd.criticaltools.wbs+xml', 'wbxml' => 'application/vnd.wap.wbxml', 'wcm' => 'application/vnd.ms-works', 'wdb' => 'application/vnd.ms-works', 'weba' => 'audio/webm', 'webm' => 'video/webm', 'webp' => 'image/webp', 'wg' => 'application/vnd.pmi.widget', 'wgt' => 'application/widget', 'wks' => 'application/vnd.ms-works', 'wm' => 'video/x-ms-wm', 'wma' => 'audio/x-ms-wma', 'wmd' => 'application/x-ms-wmd', 'wmf' => 'application/x-msmetafile', 'wml' => 'text/vnd.wap.wml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmls' => 'text/vnd.wap.wmlscript', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wmz' => 'application/x-ms-wmz', 'woff' => 'application/x-font-woff', 'wpd' => 'application/vnd.wordperfect', 'wpl' => 'application/vnd.ms-wpl', 'wps' => 'application/vnd.ms-works', 'wqd' => 'application/vnd.wqd', 'wri' => 'application/x-mswrite', 'wrl' => 'model/vrml', 'wsdl' => 'application/wsdl+xml', 'wspolicy' => 'application/wspolicy+xml', 'wtb' => 'application/vnd.webturbo', 'wvx' => 'video/x-ms-wvx', 'x32' => 'application/x-authorware-bin', 'x3d' => 'application/vnd.hzn-3d-crossword', 'xap' => 'application/x-silverlight-app', 'xar' => 'application/vnd.xara', 'xbap' => 'application/x-ms-xbap', 'xbd' => 'application/vnd.fujixerox.docuworks.binder', 'xbm' => 'image/x-xbitmap', 'xdf' => 'application/xcap-diff+xml', 'xdm' => 'application/vnd.syncml.dm+xml', 'xdp' => 'application/vnd.adobe.xdp+xml', 'xdssc' => 'application/dssc+xml', 'xdw' => 'application/vnd.fujixerox.docuworks', 'xenc' => 'application/xenc+xml', 'xer' => 'application/patch-ops-error+xml', 'xfdf' => 'application/vnd.adobe.xfdf', 'xfdl' => 'application/vnd.xfdl', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xhvml' => 'application/xv+xml', 'xif' => 'image/vnd.xiff', 'xla' => 'application/vnd.ms-excel', 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', 'xlc' => 'application/vnd.ms-excel', 'xlm' => 'application/vnd.ms-excel', 'xls' => 'application/vnd.ms-excel', 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlt' => 'application/vnd.ms-excel', 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xlw' => 'application/vnd.ms-excel', 'xml' => 'application/xml', 'xo' => 'application/vnd.olpc-sugar', 'xop' => 'application/xop+xml', 'xpi' => 'application/x-xpinstall', 'xpm' => 'image/x-xpixmap', 'xpr' => 'application/vnd.is-xpr', 'xps' => 'application/vnd.ms-xpsdocument', 'xpw' => 'application/vnd.intercon.formnet', 'xpx' => 'application/vnd.intercon.formnet', 'xsl' => 'application/xml', 'xslt' => 'application/xslt+xml', 'xsm' => 'application/vnd.syncml+xml', 'xspf' => 'application/xspf+xml', 'xul' => 'application/vnd.mozilla.xul+xml', 'xvm' => 'application/xv+xml', 'xvml' => 'application/xv+xml', 'xwd' => 'image/x-xwindowdump', 'xyz' => 'chemical/x-xyz', 'yaml' => 'text/yaml', 'yang' => 'application/yang', 'yin' => 'application/yin+xml', 'yml' => 'text/yaml', 'zaz' => 'application/vnd.zzazz.deck+xml', 'zip' => 'application/zip', 'zir' => 'application/vnd.zul', 'zirz' => 'application/vnd.zul', 'zmm' => 'application/vnd.handheld-entertainment+xml' ); /** * Get a singleton instance of the class * * @return self * @codeCoverageIgnore */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; } /** * Get a mimetype value from a file extension * * @param string $extension File extension * * @return string|null * */ public function fromExtension($extension) { return isset($this->mimetypes[$extension]) ? $this->mimetypes[$extension] : null; } /** * Get a mimetype from a filename * * @param string $filename Filename to generate a mimetype from * * @return string|null */ public function fromFilename($filename) { return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); } } src/Guzzle/Http/QueryAggregator/CommaAggregator.php000064400000001055151742734620016426 0ustar00isUrlEncoding()) { return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value))); } else { return array($key => implode(',', $value)); } } } src/Guzzle/Http/QueryAggregator/DuplicateAggregator.php000064400000001141151742734620017300 0ustar00isUrlEncoding()) { return array($query->encodeValue($key) => array_map(array($query, 'encodeValue'), $value)); } else { return array($key => $value); } } } src/Guzzle/Http/QueryAggregator/PhpAggregator.php000064400000001231151742734620016115 0ustar00 $v) { $k = "{$key}[{$k}]"; if (is_array($v)) { $ret = array_merge($ret, self::aggregate($k, $v, $query)); } else { $ret[$query->encodeValue($k)] = $query->encodeValue($v); } } return $ret; } } src/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php000064400000001236151742734620020321 0ustar00hasKey($key)) { $value = array($value); } $q->add($key, $value); } else { $q->add($key, ''); } } } return $q; } /** * Convert the query string parameters to a query string string * * @return string */ public function __toString() { if (empty($this->data)) { return ''; } $queryString = ''; $firstValue = true; foreach ($this->prepareData($this->data) as $name => $value) { $value = $value === null ? array('') : (array) $value; foreach ($value as $v) { if ($firstValue) { $firstValue = false; } else { $queryString .= $this->fieldSeparator; } $queryString .= $name; if ($v !== self::BLANK) { $queryString .= $this->valueSeparator . $v; } } } return $queryString; } /** * Get the query string field separator * * @return string */ public function getFieldSeparator() { return $this->fieldSeparator; } /** * Get the query string value separator * * @return string */ public function getValueSeparator() { return $this->valueSeparator; } /** * Returns the type of URL encoding used by the query string * * One of: false, "RFC 3986", or "application/x-www-form-urlencoded" * * @return bool|string */ public function getUrlEncoding() { return $this->urlEncode; } /** * Returns true or false if using URL encoding * * @return bool */ public function isUrlEncoding() { return $this->urlEncode !== false; } /** * Provide a function for combining multi-valued query string parameters into a single or multiple fields * * @param null|QueryAggregatorInterface $aggregator Pass in a QueryAggregatorInterface object to handle converting * deeply nested query string variables into a flattened array. * Pass null to use the default PHP style aggregator. For legacy * reasons, this function accepts a callable that must accepts a * $key, $value, and query object. * @return self * @see \Guzzle\Http\QueryString::aggregateUsingComma() */ public function setAggregator(QueryAggregatorInterface $aggregator = null) { // Use the default aggregator if none was set if (!$aggregator) { if (!self::$defaultAggregator) { self::$defaultAggregator = new PhpAggregator(); } $aggregator = self::$defaultAggregator; } $this->aggregator = $aggregator; return $this; } /** * Set whether or not field names and values should be rawurlencoded * * @param bool|string $encode Set to TRUE to use RFC 3986 encoding (rawurlencode), false to disable encoding, or * form_urlencoding to use application/x-www-form-urlencoded encoding (urlencode) * @return self */ public function useUrlEncoding($encode) { $this->urlEncode = ($encode === true) ? self::RFC_3986 : $encode; return $this; } /** * Set the query string separator * * @param string $separator The query string separator that will separate fields * * @return self */ public function setFieldSeparator($separator) { $this->fieldSeparator = $separator; return $this; } /** * Set the query string value separator * * @param string $separator The query string separator that will separate values from fields * * @return self */ public function setValueSeparator($separator) { $this->valueSeparator = $separator; return $this; } /** * Returns an array of url encoded field names and values * * @return array */ public function urlEncode() { return $this->prepareData($this->data); } /** * URL encodes a value based on the url encoding type of the query string object * * @param string $value Value to encode * * @return string */ public function encodeValue($value) { if ($this->urlEncode == self::RFC_3986) { return rawurlencode($value); } elseif ($this->urlEncode == self::FORM_URLENCODED) { return urlencode($value); } else { return (string) $value; } } /** * Url encode parameter data and convert nested query strings into a flattened hash. * * @param array $data The data to encode * * @return array Returns an array of encoded values and keys */ protected function prepareData(array $data) { // If no aggregator is present then set the default if (!$this->aggregator) { $this->setAggregator(null); } $temp = array(); foreach ($data as $key => $value) { if (is_array($value)) { $temp = array_merge($temp, $this->aggregator->aggregate($key, $value, $this)); } else { $temp[$this->encodeValue($key)] = $this->encodeValue($value); } } return $temp; } } src/Guzzle/Http/ReadLimitEntityBody.php000064400000006004151742734620014143 0ustar00setLimit($limit)->setOffset($offset); $this->body->seek($offset); } /** * Returns only a subset of the decorated entity body when cast as a string * {@inheritdoc} */ public function __toString() { return substr((string) $this->body, $this->offset, $this->limit) ?: ''; } /** * {@inheritdoc} */ public function isConsumed() { return (($this->offset + $this->limit) - $this->body->ftell()) <= 0; } /** * Returns the Content-Length of the limited subset of data * {@inheritdoc} */ public function getContentLength() { $length = $this->body->getContentLength(); return $length === false ? $this->limit : min($this->limit, min($length, $this->offset + $this->limit) - $this->offset); } /** * Allow for a bounded seek on the read limited entity body * {@inheritdoc} */ public function seek($offset, $whence = SEEK_SET) { return $whence === SEEK_SET ? $this->body->seek(max($this->offset, min($this->offset + $this->limit, $offset))) : false; } /** * Set the offset to start limiting from * * @param int $offset Offset to seek to and begin byte limiting from * * @return self */ public function setOffset($offset) { $this->body->seek($offset); $this->offset = $offset; return $this; } /** * Set the limit of bytes that the decorator allows to be read from the stream * * @param int $limit Total number of bytes to allow to be read from the stream * * @return self */ public function setLimit($limit) { $this->limit = $limit; return $this; } /** * {@inheritdoc} */ public function read($length) { // Check if the current position is less than the total allowed bytes + original offset $remaining = ($this->offset + $this->limit) - $this->body->ftell(); if ($remaining > 0) { // Only return the amount of requested data, ensuring that the byte limit is not exceeded return $this->body->read(min($remaining, $length)); } else { return false; } } } src/Guzzle/Http/RedirectPlugin.php000064400000020654151742734620013205 0ustar00 array('onRequestSent', 100), 'request.clone' => 'onRequestClone' ); } /** * Clean up the parameters of a request when it is cloned * * @param Event $event Event emitted */ public function onRequestClone(Event $event) { $event['request']->getParams()->remove(self::REDIRECT_COUNT)->remove(self::PARENT_REQUEST); } /** * Called when a request receives a redirect response * * @param Event $event Event emitted */ public function onRequestSent(Event $event) { $response = $event['response']; $request = $event['request']; // Only act on redirect requests with Location headers if (!$response || !$response->isRedirect() || !$response->hasHeader('Location') || $request->getParams()->get(self::DISABLE) ) { return; } // Prepare the request for a redirect and grab the original request that started the transaction $originalRequest = $this->prepareRedirection($request); // Create a redirect request based on the redirect rules set on the request $redirectRequest = $this->createRedirectRequest( $request, $event['response']->getStatusCode(), trim($response->getHeader('Location')), $originalRequest ); // Send the redirect request and hijack the response of the original request $redirectResponse = $redirectRequest->send(); $request->setResponse($redirectResponse); if (!$redirectResponse->getPreviousResponse()) { $redirectResponse->setPreviousResponse($response); } } /** * Create a redirect request for a specific request object * * Takes into account strict RFC compliant redirection (e.g. redirect POST with POST) vs doing what most clients do * (e.g. redirect POST with GET). * * @param RequestInterface $request Request being redirected * @param RequestInterface $original Original request * @param int $statusCode Status code of the redirect * @param string $location Location header of the redirect * * @return RequestInterface Returns a new redirect request * @throws CouldNotRewindStreamException If the body needs to be rewound but cannot */ protected function createRedirectRequest( RequestInterface $request, $statusCode, $location, RequestInterface $original ) { $redirectRequest = null; $strict = $original->getParams()->get(self::STRICT_REDIRECTS); // Use a GET request if this is an entity enclosing request and we are not forcing RFC compliance, but rather // emulating what all browsers would do if ($request instanceof EntityEnclosingRequestInterface && !$strict && $statusCode <= 302) { $redirectRequest = $this->cloneRequestWithGetMethod($request); } else { $redirectRequest = clone $request; } $redirectRequest->setIsRedirect(true); // Always use the same response body when redirecting $redirectRequest->setResponseBody($request->getResponseBody()); $location = Url::factory($location); // If the location is not absolute, then combine it with the original URL if (!$location->isAbsolute()) { $originalUrl = $redirectRequest->getUrl(true); // Remove query string parameters and just take what is present on the redirect Location header $originalUrl->getQuery()->clear(); $location = $originalUrl->combine((string) $location); } $redirectRequest->setUrl($location); $redirectRequest->getParams()->set(self::PARENT_REQUEST, $request); // Rewind the entity body of the request if needed if ($redirectRequest instanceof EntityEnclosingRequestInterface && $redirectRequest->getBody()) { $body = $redirectRequest->getBody(); // Only rewind the body if some of it has been read already, and throw an exception if the rewind fails if ($body->ftell() && !$body->rewind()) { throw new CouldNotRewindStreamException( 'Unable to rewind the non-seekable entity body of the request after redirecting. cURL probably ' . 'sent part of body before the redirect occurred. Try adding acustom rewind function using on the ' . 'entity body of the request using setRewindFunction().' ); } } return $redirectRequest; } /** * Clone a request while changing the method to GET. Emulates the behavior of * {@see Guzzle\Http\Message\Request::clone}, but can change the HTTP method. * * @param EntityEnclosingRequestInterface $request Request to clone * * @return RequestInterface Returns a GET request */ protected function cloneRequestWithGetMethod(EntityEnclosingRequestInterface $request) { return RequestFactory::getInstance()->cloneRequestWithMethod($request, 'GET'); } /** * Prepare the request for redirection and enforce the maximum number of allowed redirects per client * * @param RequestInterface $request Request to prepare and validate * * @return RequestInterface Returns the original request */ protected function prepareRedirection(RequestInterface $request) { $original = $request; // The number of redirects is held on the original request, so determine which request that is while ($parent = $original->getParams()->get(self::PARENT_REQUEST)) { $original = $parent; } // Always associate the parent response with the current response so that a chain can be established if ($parent = $request->getParams()->get(self::PARENT_REQUEST)) { $request->getResponse()->setPreviousResponse($parent->getResponse()); } $params = $original->getParams(); // This is a new redirect, so increment the redirect counter $current = $params->get(self::REDIRECT_COUNT) + 1; $params->set(self::REDIRECT_COUNT, $current); // Use a provided maximum value or default to a max redirect count of 5 $max = $params->hasKey(self::MAX_REDIRECTS) ? $params->get(self::MAX_REDIRECTS) : $this->defaultMaxRedirects; // Throw an exception if the redirect count is exceeded if ($current > $max) { return $this->throwTooManyRedirectsException($request); } return $original; } /** * Throw a too many redirects exception for a request * * @param RequestInterface $request Request * @throws TooManyRedirectsException when too many redirects have been issued */ protected function throwTooManyRedirectsException(RequestInterface $request) { $lines = array(); $response = $request->getResponse(); do { $lines[] = '> ' . $response->getRequest()->getRawHeaders() . "\n\n< " . $response->getRawHeaders(); $response = $response->getPreviousResponse(); } while ($response); throw new TooManyRedirectsException( "Too many redirects were issued for this transaction:\n" . implode("* Sending redirect request\n", array_reverse($lines)) ); } } src/Guzzle/Http/Resources/cacert.pem000064400000752712151742734620013501 0ustar00## ## ca-bundle.crt -- Bundle of CA Root Certificates ## ## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012 ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: ## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## # @(#) $RCSfile: certdata.txt,v $ $Revision: 1.87 $ $Date: 2012/12/29 16:32:45 $ GTE CyberTrust Global Root ========================== -----BEGIN CERTIFICATE----- MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ -----END CERTIFICATE----- Thawte Server CA ================ -----BEGIN CERTIFICATE----- MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl /Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= -----END CERTIFICATE----- Thawte Premium Server CA ======================== -----BEGIN CERTIFICATE----- MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf 8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t UCemDaYj+bvLpgcUQg== -----END CERTIFICATE----- Equifax Secure CA ================= -----BEGIN CERTIFICATE----- MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW 8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 70+sB3c4 -----END CERTIFICATE----- Digital Signature Trust Co. Global CA 1 ======================================= -----BEGIN CERTIFICATE----- MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4 RbyhkwS7hp86W0N6w4pl -----END CERTIFICATE----- Digital Signature Trust Co. Global CA 3 ======================================= -----BEGIN CERTIFICATE----- MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1 mPnHfxsb1gYgAlihw6ID -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority ======================================================= -----BEGIN CERTIFICATE----- MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf Tqj/ZA1k -----END CERTIFICATE----- Verisign Class 1 Public Primary Certification Authority - G2 ============================================================ -----BEGIN CERTIFICATE----- MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgd k4xWArzZbxpvUjZudVYKVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIq WpDBucSmFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQIDAQAB MA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0Jh9ZrbWB85a7FkCMM XErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2uluIncrKTdcu1OofdPvAbT6shkdHvC lUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68DzFc6PLZ -----END CERTIFICATE----- Verisign Class 2 Public Primary Certification Authority - G2 ============================================================ -----BEGIN CERTIFICATE----- MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 c3QgTmV0d29yazAeFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 c3QgTmV0d29yazCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjx nNuX6Zr8wgQGE75fUsjMHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRC wiNPStjwDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cCAwEA ATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9jinb3/7aHmZuovCfTK 1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAXrXfMSTWqz9iP0b63GJZHc2pUIjRk LbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnInjBJ7xUS0rg== -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority - G2 ============================================================ -----BEGIN CERTIFICATE----- MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx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X9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- GlobalSign Root CA - R2 ======================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== -----END CERTIFICATE----- ValiCert Class 1 VA =================== -----BEGIN CERTIFICATE----- MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBA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gUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td 3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs 3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r on+jjBXu -----END CERTIFICATE----- Verisign Class 1 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgN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QL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrspSCAaWihT37h a88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4E1Z5T21Q6huwtVexN2ZYI/Pc D98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g== -----END CERTIFICATE----- Verisign Class 2 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y azE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ug b25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0 aW9uIEF1dGhvcml0eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJ BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y aXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC AQEArwoNwtUs22e5LeWUJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6 tW8UvxDOJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUYwZF7 C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9okoqQHgiBVrKtaaNS 0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjNqWm6o+sdDZykIKbBoMXRRkwXbdKs Zj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/ESrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0 JhU8wI1NQ0kdvekhktdmnLfexbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf 0xwLRtxyID+u7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RIsH/7NiXaldDx JBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTPcjnhsUPgKM+351psE2tJs//j GHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj 055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== -----END CERTIFICATE----- Verisign Class 4 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQDsoKeLbnVqAc/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oV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== -----END CERTIFICATE----- Entrust.net Secure Server CA ============================ -----BEGIN CERTIFICATE----- MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= -----END CERTIFICATE----- Entrust.net Premium 2048 Secure Server CA ========================================= -----BEGIN CERTIFICATE----- MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQ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CFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z 2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ== -----END CERTIFICATE----- Baltimore CyberTrust Root ========================= -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- Equifax Secure Global eBusiness CA ================================== -----BEGIN CERTIFICATE----- MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV -----END CERTIFICATE----- Equifax Secure eBusiness CA 1 ============================= -----BEGIN CERTIFICATE----- MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ 1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlI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CAQYwHwYDVR0jBBgwFoAUUJ4L6q9e uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1 jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia 78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm V+GRMOrN -----END CERTIFICATE----- AddTrust Low-Value Services Root ================================ -----BEGIN CERTIFICATE----- MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= -----END CERTIFICATE----- AddTrust External Root ====================== -----BEGIN CERTIFICATE----- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEF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OBi0cQ+azcgOno4u G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -----END CERTIFICATE----- AddTrust Public Services Root ============================= -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB /zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL +YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= -----END CERTIFICATE----- AddTrust Qualified Certificates Root ==================================== -----BEGIN CERTIFICATE----- MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx 64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= -----END CERTIFICATE----- Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRyd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fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm Mw== -----END CERTIFICATE----- GeoTrust Global CA 2 ==================== -----BEGIN CERTIFICATE----- MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF H4z1Ir+rzoPz4iIprn2DQKi6bA== -----END CERTIFICATE----- GeoTrust Universal CA ===================== -----BEGIN CERTIFICATE----- MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1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laXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI P/rmMuGNG2+k5o7Y+SlIis5z/iw= -----END CERTIFICATE----- GeoTrust Universal CA 2 ======================= -----BEGIN CERTIFICATE----- MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5c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6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS -----END CERTIFICATE----- UTN-USER First-Network Applications =================================== -----BEGIN CERTIFICATE----- MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCBozELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzAp BgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5 WhcNMTkwNzA5MTg1NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5T YWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBB cHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCz+5Gh5DZVhawGNFug mliy+LUPBXeDrjKxdpJo7CNKyXY/45y2N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4Cj DUeJT1FxL+78P/m4FoCHiZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXu Ozr0hAReYFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1axwi P8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6gyN7igEL66S/ozjIE j3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8w HQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPhahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9j cmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0G CSqGSIb3DQEBBQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6LzsQCv4AdRWOOTK RIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4ZSfP1FMa8Kxun08FDAOBp4Qp xFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qMYEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAq DbUMo2s/rn9X9R+WfN9v3YIwLGUbQErNaLly7HF27FSOH4UMAWr6pjisH8SE -----END CERTIFICATE----- America Online Root Certification Authority 1 ============================================= -----BEGIN CERTIFICATE----- MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBD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ds sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 -----END CERTIFICATE----- America Online Root Certification Authority 2 ============================================= -----BEGIN CERTIFICATE----- MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn 6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIM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LwU8GUYEmSA20GBu YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt 398znM/jra6O1I7mT1GvFpLgXPYHDw== -----END CERTIFICATE----- Certum Root CA ============== -----BEGIN CERTIFICATE----- MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ 89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ 0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== -----END CERTIFICATE----- Comodo AAA Services root ======================== -----BEGIN CERTIFICATE----- MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- Comodo Secure Services root =========================== -----BEGIN CERTIFICATE----- MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP 9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm 4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H RR3B7Hzs/Sk= -----END CERTIFICATE----- Comodo Trusted Services root ============================ -----BEGIN CERTIFICATE-----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kg3Goi3XZZenMfvJ2II 4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u -----END CERTIFICATE----- QuoVadis Root CA 3 ================== -----BEGIN CERTIFICATE----- MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFU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H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- Security Communication Root CA ============================== -----BEGIN CERTIFICATE----- MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi FL39vmwLAw== -----END CERTIFICATE----- Sonera Class 1 Root CA ====================== -----BEGIN CERTIFICATE----- MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAxMDQwNjEwNDkxM1oXDTIxMDQw NjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh IENsYXNzMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H88 7dF+2rDNbS82rDTG29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9 EJUkoVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk3w0LBUXl 0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBLqdReLjVQCfOAl/QMF645 2F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIINnvmLVz5MxxftLItyM19yejhW1ebZrgUa HXVFsculJRwSVzb9IjcCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZT iFIwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE9 28Jj2VuXZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0HDjxV yhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VOTzF2nBBhjrZTOqMR vq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2UvkVrCqIexVmiUefkl98HVrhq4uz2P qYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4wzMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9Z IRlXvVWa -----END CERTIFICATE----- Sonera Class 2 Root CA ====================== -----BEGIN CERTIFICATE----- MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 /Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt 0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH llpwrN9M -----END CERTIFICATE----- Staat der Nederlanden Root CA ============================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P jLwYdjeFnejKScfST5g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yr+rFywJNn9Q+kHcrpY6CiM+iVnJowft Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI -----END CERTIFICATE----- UTN USERFirst Email Root CA =========================== -----BEGIN CERTIFICATE----- MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0 BgNVBAMTLVVUTi1VU0VSRmlyc3QtQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05 OTA3MDkxNzI4NTBaFw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQx FzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsx ITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UEAxMtVVROLVVTRVJGaXJz dC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3BYHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIx B8dOtINknS4p1aJkxIW9hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8 om+rWV6lL8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLmSGHG TPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM1tZUOt4KpLoDd7Nl yP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws6wIDAQABo4G5MIG2MAsGA1UdDwQE AwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNV HR8EUTBPME2gS6BJhkdodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGll bnRBdXRoZW50aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u7mFVbwQ+zzne xRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0xtcgBEXkzYABurorbs6q15L+ 5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQrfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarV NZ1yQAOJujEdxRBoUp7fooXFXAimeOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZ w7JHpsIyYdfHb0gkUSeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ= -----END CERTIFICATE----- UTN USERFirst Hardware Root CA ============================== -----BEGIN CERTIFICATE----- MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha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UFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM //bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 nfhmqA== -----END CERTIFICATE----- UTN USERFirst Object Root CA ============================ -----BEGIN CERTIFICATE----- MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAb BgNVBAMTFFVUTi1VU0VSRmlyc3QtT2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAz NlowgZUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkx HjAcBgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3dy51c2Vy dHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCCASIwDQYJKoZIhvcNAQEB BQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicPHxzfOpuCaDDASmEd8S8O+r5596Uj71VR loTN2+O5bj4x2AogZ8f02b+U60cEPgLOKqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQ w5ujm9M89RKZd7G3CeBo5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vu lBe3/IW+pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehbkkj7 RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUCAwEAAaOBrzCBrDAL BgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU2u1kdBScFDyr3ZmpvVsoTYs8 ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmly c3QtT2JqZWN0LmNybDApBgNVHSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQw DQYJKoZIhvcNAQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXBmMiKVl0+7kNO PmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU4U3GDZlDAQ0Slox4nb9QorFE qmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK581OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCG hU3IfdeLA/5u1fedFqySLKAj5ZyRUh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g= -----END CERTIFICATE----- Camerfirma Chambers of Commerce Root ==================================== -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2h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h0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 erfutGWaIZDgqtCYvDi1czyL+Nw= -----END CERTIFICATE----- Camerfirma Global Chambersign Root ================================== -----BEGIN CERTIFICATE----- MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J 1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl 6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c 8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== -----END CERTIFICATE----- NetLock Qualified (Class QA) Root ================================= -----BEGIN CERTIFICATE----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Ep+NFAwLvt/MpqNPfMg W/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCRVCHnpgu0mfVRQdzNo0ci2ccBgcTc R08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR 5qq5aKrN9p2QdRLqOBrKROi3macqaJVmlaut74nLYKkGEsaUR+ko -----END CERTIFICATE----- NetLock Notary (Class A) Root ============================= -----BEGIN CERTIFICATE----- MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC /tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+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MA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM 8CgHrTwXZoi1/baI -----END CERTIFICATE----- NetLock Business (Class B) Root =============================== -----BEGIN CERTIFICATE----- MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kf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lOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI -----END CERTIFICATE----- NetLock Express (Class C) Root ============================== -----BEGIN CERTIFICATE----- MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn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68CAQOjgcAwgb0wHQYDVR0O BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b vZ8= -----END CERTIFICATE----- Starfield Class 2 CA ==================== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 QBFGmh95DmK/D5fs4C8fF5Q= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTD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MRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk 7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy +fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS -----END CERTIFICATE----- Firmaprofesional Root CA ======================== -----BEGIN CERTIFICATE----- MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2 ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf 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lmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW NY6E0F/6MBr1mmz0DlP5OlvRHA== -----END CERTIFICATE----- DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv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2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== -----END CERTIFICATE----- DigiCert Global Root CA ======================= -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----- DigiCert High Assurance EV Root CA ================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K -----END CERTIFICATE----- Certplus Class 2 Primary CA =========================== -----BEGIN CERTIFICATE----- MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCC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zdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ -----END CERTIFICATE----- DST ACES CA X6 ============== -----BEGIN CERTIFICATE----- MIIECTCC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gwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 oKfN5XozNmr6mis= -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 1 ============================================== -----BEGIN CERTIFICATE----- MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ 8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 2 ============================================== -----BEGIN CERTIFICATE----- MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN MDUxMTA3MTAwNzU3WhcNMTUwOTE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7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 UrbnBEI= -----END CERTIFICATE----- SwissSign Platinum CA - G2 ========================== -----BEGIN CERTIFICATE----- MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCQ0gxFTAT BgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWduIFBsYXRpbnVtIENBIC0gRzIw HhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAwWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMM U3dpc3NTaWduIEFHMSMwIQYDVQQDExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJ KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu 669yIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2HtnIuJpX+UF eNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+6ixuEFGSzH7VozPY1kne WCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5objM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIo j5+saCB9bzuohTEJfwvH6GXp43gOCWcwizSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/6 8++QHkwFix7qepF6w9fl+zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34T aNhxKFrYzt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaPpZjy domyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtFKwH3HBqi7Ri6Cr2D +m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XU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Uw AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm 5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr 44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ -----END CERTIFICATE----- SwissSign Silver CA - G2 ======================== -----BEGIN CERTIFICATE----- MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaW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sBggrBgEFBQcCARYgaHR0 cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P 4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L 3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx /uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u -----END CERTIFICATE----- GeoTrust Primary Certification Authority ======================================== -----BEGIN CERTIFICATE----- MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG 1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= -----END CERTIFICATE----- thawte Primary Root CA ====================== -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELM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oEzsUHboZHIMpKnxuIvW1oeE uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G5 ============================================================ -----BEGIN CERTIFICATE----- MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQCvJAgIKXo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2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW -----END CERTIFICATE----- COMODO Certification Authority ============================== -----BEGIN CERTIFICATE----- MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH +7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV 4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA 1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== -----END CERTIFICATE----- Network Solutions Certificate Authority ======================================= -----BEGIN CERTIFICATE----- MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw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rFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey -----END CERTIFICATE----- WellsSecure Public Root Certificate Authority ============================================= -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ tylv2G0xffX8oRAHh84vWdw+WNs= -----END CERTIFICATE----- COMODO ECC Certification Authority ================================== -----BEGIN CERTIFICATE----- MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix GzAZBg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5wbS5nb3V2LmZyMIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF 0mBWWg== -----END CERTIFICATE----- Security Communication EV RootCA1 ================================= -----BEGIN CERTIFICATE----- MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0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MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 -----END CERTIFICATE----- OISTE WISeKey Global Root GA CA =============================== -----BEGIN CERTIFICATE----- MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ /yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 +vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= -----END CERTIFICATE----- S-TRUST Authentication and Encryption Root CA 2005 PN ===================================================== -----BEGIN CERTIFICATE----- MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE BhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcpMRIwEAYDVQQHEwlTdHV0dGdh cnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fzc2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVT LVRSVVNUIEF1dGhlbnRpY2F0aW9uIGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0w NTA2MjIwMDAwMDBaFw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFk ZW4tV3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMgRGV1dHNj aGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJVU1QgQXV0aGVudGljYXRp b24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob 4QSwI7+Vio5bG0F/WsPoTUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXL g3KSwlOyggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1Xgqf eN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteFhy+S8dF2g08LOlk3 KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm7QIDAQABo4GSMIGPMBIGA1UdEwEB /wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJv bmxpbmUxLTIwNDgtNTAdBgNVHQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAU D8oeXHngovMpttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFoLtU96G7m1R08 P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersFiXOMy6ZNwPv2AtawB6MDwidA nwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0yh9WUUpY6RsZxlj33mA6ykaqP2vROJAA5Veit F7nTNCtKqUDMFypVZUF0Qn71wK/Ik63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8b Hz2eBIPdltkdOpQ= -----END CERTIFICATE----- Microsec e-Szigno Root CA ========================= -----BEGIN CERTIFICATE----- MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE BhMCSFUxETAPBgNVBAc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dGUgY2VydGlmaWNhZG8gc2Ug cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v /zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f /RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== -----END CERTIFICATE----- TC TrustCenter Class 2 CA II ============================ -----BEGIN CERTIFICATE----- MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw MTEyMTQzODQzWh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0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk vQ== -----END CERTIFICATE----- TC TrustCenter Class 3 CA II ============================ -----BEGIN CERTIFICATE----- MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo 6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk 2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB /wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB 7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal 092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc 5A== -----END CERTIFICATE----- TC TrustCenter Universal CA I ============================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydX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z3KL0Dzq/YSMQiZxIQG5wALPT ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a 7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY -----END CERTIFICATE----- Deutsche Telekom Root CA 2 ========================== -----BEGIN CERTIFICATE----- MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w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JYlcWrYvjB9teSSnUmjDhDXi Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 ============================================================================================================================= -----BEGIN CERTIF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v9Lrhc+hDVXDWzhXcLh1 xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR 6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= -----END CERTIFICATE----- Buypass Class 2 CA 1 ==================== -----BEGIN CERTIFICATE----- MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI hvcNAQEBBQADggEPADCC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AkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c 1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 -----END CERTIFICATE----- EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 ========================================================================== -----BEGIN CERTIFICATE----- MIIF5zCCA8+gAwIBAgIIT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YDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m mxE= -----END CERTIFICATE----- ApplicationCA - Japanese Government =================================== -----BEGIN CERTIFICATE----- MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g /DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL rosot4LKGAfmt1t06SAZf7IbiVQ= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G3 ============================================= -----BEGIN CERTIFICATE----- MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt -----END CERTIFICATE----- thawte Primary Root CA - G2 =========================== -----BEGIN CERTIFICATE----- MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== -----END CERTIFICATE----- thawte Primary Root CA - G3 =========================== -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC +BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY 7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC 8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G2 ============================================= -----BEGIN CERTIFICATE----- MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 npaqBA+K -----END CERTIFICATE----- VeriSign Universal Root Certification Authority =============================================== -----BEGIN CERTIFICATE----- MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwO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H0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 mJO37M2CYfE45k+XmCpajQ== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G4 ============================================================ -----BEGIN CERTIFICATE----- MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB /zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== -----END CERTIFICATE----- NetLock Arany (Class Gold) Főtanúsítvány ============================================ -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu 0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw /HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= -----END CERTIFICATE----- Staat der Nederlanden Root CA - G2 ================================== -----BEGIN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gfYwgdAGCCsGAQUFBwICMIHD HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 yyqcjg== -----END CERTIFICATE----- Hongkong Post Root CA 1 ======================= -----BEGIN CERTIFICATE----- MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== -----END CERTIFICATE----- SecureSign RootCA11 =================== -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi SmFwYW4gQ2VydGlmaWN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wEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz 4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU 9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== -----END CERTIFICATE----- Verisign Class 1 Public Primary Certification Authority ======================================================= -----BEGIN CERTIFICATE----- MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAx IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA A4GNADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0fzGVuDLDQ VoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHiTkVWaR94AoDa3EeRKbs2 yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFgVKTk8d6Pa XCUDfGD67gmZPCcQcMgMCeazh88K4hiWNWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n 0a3hUKw8fGJLj7qE1xIVGx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZ RjXZ+Hxb -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority ======================================================= -----BEGIN CERTIFICATE----- MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ D/xwzoiQ -----END CERTIFICATE----- Microsec e-Szigno Root CA 2009 ============================== -----BEGIN CERTIFICATE----- MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG 0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm 1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi LXpUq3DDfSJlgnCW -----END CERTIFICATE----- E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi =================================================== -----BEGIN CERTIFICATE----- MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz ZS1H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OSR49XrXMGs3xtq fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX -----END CERTIFICATE----- GlobalSign Root CA - R3 ======================= -----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ 0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r kpeDMdmztcpHWD9f -----END CERTIFICATE----- TC TrustCenter Universal CA III =============================== -----BEGIN CERTIFICATE----- MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1 M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+ KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== -----END CERTIFICATE----- Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P B99jBVzpv5R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ARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi 6Et8Vcad+qMUu2WFbm5PEn4KPJ2V -----END CERTIFICATE----- Izenpe.com ========== -----BEGIN CERTIFICATE----- MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ 03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU +zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjM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cs30cQhbIHsvm0m5hzkQiCeR7Cs g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== -----END CERTIFICATE----- Chambers of Commerce Root - 2008 ================================ -----BEGIN CERTIFICATE----- MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl cnMgb2YgQ29tb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y5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH 3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF 9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ -----END CERTIFICATE----- Global Chambersign Root - 2008 ============================== -----BEGIN CERTIFICATE----- MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIG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nn4SPIVqczmyETr P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z 09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B -----END CERTIFICATE----- Go Daddy Root Certificate Authority - G2 ======================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq 9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD +qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r 5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 -----END CERTIFICATE----- Starfield Root Certificate Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx 4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 -----END CERTIFICATE----- Starfield Services Root Certificate Authority - G2 ================================================== -----BEGIN CERTIFICATE----- MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmlj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i3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 -----END CERTIFICATE----- AffirmTrust Commercial ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv 0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= -----END CERTIFICATE----- AffirmTrust Networking ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 /PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu UFUaNU52Q3Eg75N3ThVwLofDwR1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ERTIFICATE----- AffirmTrust Premium ECC ======================= -----BEGIN CERTIFICATE----- MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM eQ== -----END CERTIFICATE----- Certum Trusted Network CA ========================= -----BEGIN CERTIFICATE----- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- Certinomis - Autorité Racine ============================= -----BEGIN CERTIFICATE----- MIIFnDCCA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FgCQfna 4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ vgt2Fl43N+bYdJeimUV5 -----END CERTIFICATE----- Root CA Generalitat Valenciana ============================== -----BEGIN CERTIFICATE----- MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 I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wBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt +GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= -----END CERTIFICATE----- A-Trust-nQual-03 ================ -----BEGIN CERTIFICATE----- MIIDzzCCAreg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ZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 ahq97BvIxYSazQ== -----END CERTIFICATE----- TWCA Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP 4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG 9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== -----END CERTIFICATE----- Security Communication RootCA2 ============================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ +T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R 3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV spHEfbmwhRkGeC7bYRr6hf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Vr/sXE7zDkJ lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D 5EI= -----END CERTIFICATE----- Hellenic Academic and Research Institutions RootCA 2011 ======================================================= -----BEGIN CERTIFICATE----- MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI 1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa 71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u 8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH 3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD /md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N 7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 -----END CERTIFICATE----- Actalis Authentication Root CA ============================== -----BEGIN CERTIFICATE----- MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pb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sNjLiNmsGe+b7bAEzlgqqI0 JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC 4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo 2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== -----END CERTIFICATE----- Trustis FPS Root CA =================== -----BEGIN CERTIFICATE----- MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P 8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl iB6XzCGcKQENZetX2fNXlrtIzYE= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM3WhcNMzYwOTE3MTk0N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bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= -----END CERTIFICATE----- StartCom Certification Authority G2 =================================== -----BEGIN CERTIFICATE----- MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG 4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K 2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG /+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm 7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm obp573PYtlNXLfbQ4ddI -----END CERTIFICATE----- Buypass Class 2 Root CA ======================= -----BEGIN CERTIFIC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BAf8wHQYD VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN rJgWVqA= -----END CERTIFICATE----- Buypass Class 3 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MS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hyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz 6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi Cp/HuZc= -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 3 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK 9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W 0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== -----END CERTIFICATE----- EE Certification Centre Root CA =============================== -----BEGIN CERTIFICATE----- MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw MTAxMDM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U 3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM dcGWxZ0= -----END CERTIFICATE----- src/Guzzle/Http/Resources/cacert.pem.md5000064400000000041151742734620014142 0ustar0047961e7ef15667c93cd99be01b51f00a src/Guzzle/Http/Url.php000064400000031763151742734620011032 0ustar00getParser('url')->parseUrl($url); // Convert the query string into a QueryString object if (0 !== strlen($parts['query'])) { $parts['query'] = QueryString::fromString($parts['query']); } return new self($parts['scheme'], $parts['host'], $parts['user'], $parts['pass'], $parts['port'], $parts['path'], $parts['query'], $parts['fragment']); } /** * Build a URL from parse_url parts. The generated URL will be a relative URL if a scheme or host are not provided. * * @param array $parts Array of parse_url parts * * @return string */ public static function buildUrl(array $parts) { $url = $scheme = ''; if (isset($parts['scheme'])) { $scheme = $parts['scheme']; $url .= $scheme . ':'; } if (isset($parts['host'])) { $url .= '//'; if (isset($parts['user'])) { $url .= $parts['user']; if (isset($parts['pass'])) { $url .= ':' . $parts['pass']; } $url .= '@'; } $url .= $parts['host']; // Only include the port if it is not the default port of the scheme if (isset($parts['port']) && !(($scheme == 'http' && $parts['port'] == 80) || ($scheme == 'https' && $parts['port'] == 443)) ) { $url .= ':' . $parts['port']; } } // Add the path component if present if (isset($parts['path']) && 0 !== strlen($parts['path'])) { // Always ensure that the path begins with '/' if set and something is before the path if ($url && $parts['path'][0] != '/' && substr($url, -1) != '/') { $url .= '/'; } $url .= $parts['path']; } // Add the query string if present if (isset($parts['query'])) { $url .= '?' . $parts['query']; } // Ensure that # is only added to the url if fragment contains anything. if (isset($parts['fragment'])) { $url .= '#' . $parts['fragment']; } return $url; } /** * Create a new URL from URL parts * * @param string $scheme Scheme of the URL * @param string $host Host of the URL * @param string $username Username of the URL * @param string $password Password of the URL * @param int $port Port of the URL * @param string $path Path of the URL * @param QueryString|array|string $query Query string of the URL * @param string $fragment Fragment of the URL */ public function __construct($scheme, $host, $username = null, $password = null, $port = null, $path = null, QueryString $query = null, $fragment = null) { $this->scheme = $scheme; $this->host = $host; $this->port = $port; $this->username = $username; $this->password = $password; $this->fragment = $fragment; if (!$query) { $this->query = new QueryString(); } else { $this->setQuery($query); } $this->setPath($path); } /** * Clone the URL */ public function __clone() { $this->query = clone $this->query; } /** * Returns the URL as a URL string * * @return string */ public function __toString() { return self::buildUrl($this->getParts()); } /** * Get the parts of the URL as an array * * @return array */ public function getParts() { return array( 'scheme' => $this->scheme, 'user' => $this->username, 'pass' => $this->password, 'host' => $this->host, 'port' => $this->port, 'path' => $this->getPath(), 'query' => (string) $this->query ?: null, 'fragment' => $this->fragment, ); } /** * Set the host of the request. * * @param string $host Host to set (e.g. www.yahoo.com, yahoo.com) * * @return Url */ public function setHost($host) { if (strpos($host, ':') === false) { $this->host = $host; } else { list($host, $port) = explode(':', $host); $this->host = $host; $this->setPort($port); } return $this; } /** * Get the host part of the URL * * @return string */ public function getHost() { return $this->host; } /** * Set the scheme part of the URL (http, https, ftp, etc) * * @param string $scheme Scheme to set * * @return Url */ public function setScheme($scheme) { $this->scheme = $scheme; return $this; } /** * Get the scheme part of the URL * * @return string */ public function getScheme() { return $this->scheme; } /** * Set the port part of the URL * * @param int $port Port to set * * @return Url */ public function setPort($port) { $this->port = $port; return $this; } /** * Get the port part of the URl. Will return the default port for a given scheme if no port has been set. * * @return int|null */ public function getPort() { if ($this->port) { return $this->port; } elseif ($this->scheme == 'http') { return 80; } elseif ($this->scheme == 'https') { return 443; } return null; } /** * Set the path part of the URL * * @param array|string $path Path string or array of path segments * * @return Url */ public function setPath($path) { if (is_array($path)) { $this->path = '/' . implode('/', $path); } else { $this->path = (string) $path; } return $this; } /** * Normalize the URL so that double slashes and relative paths are removed * * @return Url */ public function normalizePath() { if (!$this->path || $this->path == '/' || $this->path == '*') { return $this; } // Replace // and /./ with / $this->path = str_replace(array('/./', '//'), '/', $this->path); // Remove dot segments if (strpos($this->path, '..') !== false) { // Remove trailing relative paths if possible $segments = $this->getPathSegments(); $last = end($segments); $trailingSlash = false; if ($last === '') { array_pop($segments); $trailingSlash = true; } while ($last == '..' || $last == '.') { if ($last == '..') { array_pop($segments); $last = array_pop($segments); } if ($last == '.' || $last == '') { $last = array_pop($segments); } } $this->path = implode('/', $segments); if ($trailingSlash) { $this->path .= '/'; } } return $this; } /** * Add a relative path to the currently set path * * @param string $relativePath Relative path to add * * @return Url */ public function addPath($relativePath) { if (!$relativePath || $relativePath == '/') { return $this; } // Add a leading slash if needed if ($relativePath[0] != '/') { $relativePath = '/' . $relativePath; } return $this->setPath(str_replace('//', '/', $this->getPath() . $relativePath)); } /** * Get the path part of the URL * * @return string */ public function getPath() { return $this->path; } /** * Get the path segments of the URL as an array * * @return array */ public function getPathSegments() { return array_slice(explode('/', $this->getPath()), 1); } /** * Set the password part of the URL * * @param string $password Password to set * * @return Url */ public function setPassword($password) { $this->password = $password; return $this; } /** * Get the password part of the URL * * @return null|string */ public function getPassword() { return $this->password; } /** * Set the username part of the URL * * @param string $username Username to set * * @return Url */ public function setUsername($username) { $this->username = $username; return $this; } /** * Get the username part of the URl * * @return null|string */ public function getUsername() { return $this->username; } /** * Get the query part of the URL as a QueryString object * * @return QueryString */ public function getQuery() { return $this->query; } /** * Set the query part of the URL * * @param QueryString|string|array $query Query to set * * @return Url */ public function setQuery($query) { if (is_string($query)) { $output = null; parse_str($query, $output); $this->query = new QueryString($output); } elseif (is_array($query)) { $this->query = new QueryString($query); } elseif ($query instanceof QueryString) { $this->query = $query; } return $this; } /** * Get the fragment part of the URL * * @return null|string */ public function getFragment() { return $this->fragment; } /** * Set the fragment part of the URL * * @param string $fragment Fragment to set * * @return Url */ public function setFragment($fragment) { $this->fragment = $fragment; return $this; } /** * Check if this is an absolute URL * * @return bool */ public function isAbsolute() { return $this->scheme && $this->host; } /** * Combine the URL with another URL. Follows the rules specific in RFC 3986 section 5.4. * * @param string $url Relative URL to combine with * * @return Url * @throws InvalidArgumentException * @link http://tools.ietf.org/html/rfc3986#section-5.4 */ public function combine($url) { $url = self::factory($url); // Use the more absolute URL as the base URL if (!$this->isAbsolute() && $url->isAbsolute()) { $url = $url->combine($this); } // Passing a URL with a scheme overrides everything if ($buffer = $url->getScheme()) { $this->scheme = $buffer; $this->host = $url->getHost(); $this->port = $url->getPort(); $this->username = $url->getUsername(); $this->password = $url->getPassword(); $this->path = $url->getPath(); $this->query = $url->getQuery(); $this->fragment = $url->getFragment(); return $this; } // Setting a host overrides the entire rest of the URL if ($buffer = $url->getHost()) { $this->host = $buffer; $this->port = $url->getPort(); $this->username = $url->getUsername(); $this->password = $url->getPassword(); $this->path = $url->getPath(); $this->fragment = $url->getFragment(); return $this; } $path = $url->getPath(); $query = $url->getQuery(); if (!$path) { if (count($query)) { $this->query = $query; } } else { if ($path[0] == '/') { $this->path = $path; } else { $this->path .= '/' . $path; } $this->normalizePath(); $this->query = $query; } $this->fragment = $url->getFragment(); return $this; } } src/Guzzle/Http/composer.json000064400000001450151742734620012267 0ustar00{ "name": "guzzle/http", "description": "HTTP libraries used by Guzzle", "homepage": "http://guzzlephp.org/", "keywords": ["http client", "http", "client", "Guzzle", "curl"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/common": "self.version", "guzzle/parser": "self.version", "guzzle/stream": "self.version" }, "suggest": { "ext-curl": "*" }, "autoload": { "psr-0": { "Guzzle\\Http": "" } }, "target-dir": "Guzzle/Http", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Inflection/Inflector.php000064400000001651151742734620013361 0ustar00 array(), 'camel' => array() ); /** * @var int Max entries per cache */ protected $maxCacheSize; /** * @var InflectorInterface Decorated inflector */ protected $decoratedInflector; /** * @param InflectorInterface $inflector Inflector being decorated * @param int $maxCacheSize Maximum number of cached items to hold per cache */ public function __construct(InflectorInterface $inflector, $maxCacheSize = 500) { $this->decoratedInflector = $inflector; $this->maxCacheSize = $maxCacheSize; } /** * {@inheritdoc} */ public function snake($word) { if (!isset($this->cache['snake'][$word])) { $this->pruneCache('snake'); $this->cache['snake'][$word] = $this->decoratedInflector->snake($word); } return $this->cache['snake'][$word]; } /** * Converts strings from snake_case to upper CamelCase * * @param string $word Value to convert into upper CamelCase * * @return string */ public function camel($word) { if (!isset($this->cache['camel'][$word])) { $this->pruneCache('camel'); $this->cache['camel'][$word] = $this->decoratedInflector->camel($word); } return $this->cache['camel'][$word]; } /** * Prune one of the named caches by removing 20% of the cache if it is full * * @param string $cache Type of cache to prune */ protected function pruneCache($cache) { if (count($this->cache[$cache]) == $this->maxCacheSize) { $this->cache[$cache] = array_slice($this->cache[$cache], $this->maxCacheSize * 0.2); } } } src/Guzzle/Inflection/PreComputedInflector.php000064400000003531151742734620015530 0ustar00 array(), 'camel' => array() ); /** * @var InflectorInterface Decorated inflector */ protected $decoratedInflector; /** * Decorate using a pre-computed map. * * @param InflectorInterface $inflector Inflector being decorated * @param array $snake Hash of pre-computed camel to snake * @param array $camel Hash of pre-computed snake to camel * @param bool $mirror Mirror snake and camel reflections */ public function __construct(InflectorInterface $inflector, array $snake = array(), array $camel = array(), $mirror = false) { if ($mirror) { $camel = array_merge(array_flip($snake), $camel); $snake = array_merge(array_flip($camel), $snake); } $this->decoratedInflector = $inflector; $this->mapping = array( 'snake' => $snake, 'camel' => $camel ); } /** * {@inheritdoc} */ public function snake($word) { return isset($this->mapping['snake'][$word]) ? $this->mapping['snake'][$word] : $this->decoratedInflector->snake($word); } /** * Converts strings from snake_case to upper CamelCase * * @param string $word Value to convert into upper CamelCase * * @return string */ public function camel($word) { return isset($this->mapping['camel'][$word]) ? $this->mapping['camel'][$word] : $this->decoratedInflector->camel($word); } } src/Guzzle/Inflection/composer.json000064400000001162151742734620013442 0ustar00{ "name": "guzzle/inflection", "description": "Guzzle inflection component", "homepage": "http://guzzlephp.org/", "keywords": ["inflection", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2" }, "autoload": { "psr-0": { "Guzzle\\Inflection": "" } }, "target-dir": "Guzzle/Inflection", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Iterator/AppendIterator.php000064400000000674151742734620014060 0ustar00getArrayIterator()->append($iterator); } } src/Guzzle/Iterator/ChunkedIterator.php000064400000002343151742734620014225 0ustar00chunkSize = $chunkSize; } /** * {@inheritdoc} */ public function rewind() { $this->next(); } /** * {@inheritdoc} */ public function next() { $this->chunk = array(); $inner = $this->getInnerIterator(); for ($i = 0; $i < $this->chunkSize && $inner->valid(); $i++) { $this->chunk[] = $inner->current(); $inner->next(); } } /** * {@inheritdoc} */ public function current() { return $this->chunk; } /** * {@inheritdoc} */ public function valid() { return !empty($this->chunk); } } src/Guzzle/Iterator/FilterIterator.php000064400000002016151742734620014066 0ustar00callback = $callback; } /** * {@inheritdoc} */ public function accept() { return call_user_func($this->callback, $this->current()); } } src/Guzzle/Iterator/MapIterator.php000064400000001605151742734620013361 0ustar00callback = $callback; } /** * {@inheritdoc} */ public function current() { return call_user_func($this->callback, parent::current()); } } src/Guzzle/Iterator/MethodProxyIterator.php000064400000001142151742734620015122 0ustar00getInnerIterator(); while ($i instanceof \OuterIterator) { $i = $i->getInnerIterator(); } return call_user_func_array(array($i, $name), $args); } } src/Guzzle/Iterator/README.md000064400000003012151742734620011672 0ustar00Guzzle Iterator =============== [![Build Status](https://secure.travis-ci.org/guzzle/iterator.png?branch=master)](http://travis-ci.org/guzzle/guzzle) Component library that provides useful Iterators and Iterator decorators - ChunkedIterator: Pulls out chunks from an inner iterator and yields the chunks as arrays - FilterIterator: Used when PHP 5.4's CallbackFilterIterator is not available - MapIterator: Maps values before yielding - MethodProxyIterator: Proxies missing method calls to the innermost iterator ### Installing via Composer The recommended way to install is through [Composer](http://getcomposer.org). 1. Add ``guzzle/iterator`` as a dependency in your project's ``composer.json`` file: { "require": { "guzzle/iterator": "*" } } Consider tightening your dependencies to a known version when deploying mission critical applications (e.g. ``2.7.*``). 2. Download and install Composer: curl -s http://getcomposer.org/installer | php 3. Install your dependencies: php composer.phar install 4. Require Composer's autoloader Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process: require 'vendor/autoload.php'; You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at [getcomposer.org](http://getcomposer.org). src/Guzzle/Iterator/composer.json000064400000001241151742734620013137 0ustar00{ "name": "guzzle/iterator", "description": "Provides helpful iterators and iterator decorators", "keywords": ["iterator", "guzzle"], "homepage": "http://guzzlephp.org/", "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/common": ">=2.8.0" }, "autoload": { "psr-0": { "Guzzle\\Iterator": "/" } }, "target-dir": "Guzzle/Log", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Log/AbstractLogAdapter.php000064400000000505151742734620013566 0ustar00log; } } src/Guzzle/Log/ArrayLogAdapter.php000064400000001211151742734620013074 0ustar00logs[] = array('message' => $message, 'priority' => $priority, 'extras' => $extras); } /** * Get logged entries * * @return array */ public function getLogs() { return $this->logs; } /** * Clears logged entries */ public function clearLogs() { $this->logs = array(); } } src/Guzzle/Log/ClosureLogAdapter.php000064400000001216151742734620013437 0ustar00log = $logObject; } /** * {@inheritdoc} */ public function log($message, $priority = LOG_INFO, $extras = null) { call_user_func($this->log, $message, $priority, $extras); } } src/Guzzle/Log/LogAdapterInterface.php000064400000000750151742734620013725 0ustar00>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{curl_stderr}"; const SHORT_FORMAT = '[{ts}] "{method} {resource} {protocol}/{version}" {code}'; /** * @var string Template used to format log messages */ protected $template; /** * @param string $template Log message template */ public function __construct($template = self::DEFAULT_FORMAT) { $this->template = $template ?: self::DEFAULT_FORMAT; } /** * Set the template to use for logging * * @param string $template Log message template * * @return self */ public function setTemplate($template) { $this->template = $template; return $this; } /** * Returns a formatted message * * @param RequestInterface $request Request that was sent * @param Response $response Response that was received * @param CurlHandle $handle Curl handle associated with the message * @param array $customData Associative array of custom template data * * @return string */ public function format( RequestInterface $request, Response $response = null, CurlHandle $handle = null, array $customData = array() ) { $cache = $customData; return preg_replace_callback( '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', function (array $matches) use ($request, $response, $handle, &$cache) { if (array_key_exists($matches[1], $cache)) { return $cache[$matches[1]]; } $result = ''; switch ($matches[1]) { case 'request': $result = (string) $request; break; case 'response': $result = (string) $response; break; case 'req_body': $result = $request instanceof EntityEnclosingRequestInterface ? (string) $request->getBody() : ''; break; case 'res_body': $result = $response ? $response->getBody(true) : ''; break; case 'ts': $result = gmdate('c'); break; case 'method': $result = $request->getMethod(); break; case 'url': $result = (string) $request->getUrl(); break; case 'resource': $result = $request->getResource(); break; case 'protocol': $result = 'HTTP'; break; case 'version': $result = $request->getProtocolVersion(); break; case 'host': $result = $request->getHost(); break; case 'hostname': $result = gethostname(); break; case 'port': $result = $request->getPort(); break; case 'code': $result = $response ? $response->getStatusCode() : ''; break; case 'phrase': $result = $response ? $response->getReasonPhrase() : ''; break; case 'connect_time': if ($handle) { $result = $handle->getInfo(CURLINFO_CONNECT_TIME); } elseif ($response) { $result = $response->getInfo('connect_time'); } break; case 'total_time': if ($handle) { $result = $handle->getInfo(CURLINFO_TOTAL_TIME); } elseif ($response) { $result = $response->getInfo('total_time'); } break; case 'curl_error': $result = $handle ? $handle->getError() : ''; break; case 'curl_code': $result = $handle ? $handle->getErrorNo() : ''; break; case 'curl_stderr': $result = $handle ? $handle->getStderr() : ''; break; default: if (strpos($matches[1], 'req_header_') === 0) { $result = $request->getHeader(substr($matches[1], 11)); } elseif (strpos($matches[1], 'res_header_') === 0) { $result = $response->getHeader(substr($matches[1], 11)); } } $cache[$matches[1]] = $result; return $result; }, $this->template ); } } src/Guzzle/Log/MonologLogAdapter.php000064400000001501151742734620013432 0ustar00 Logger::DEBUG, LOG_INFO => Logger::INFO, LOG_WARNING => Logger::WARNING, LOG_ERR => Logger::ERROR, LOG_CRIT => Logger::CRITICAL, LOG_ALERT => Logger::ALERT ); /** * {@inheritdoc} */ public function __construct(Logger $logObject) { $this->log = $logObject; } /** * {@inheritdoc} */ public function log($message, $priority = LOG_INFO, $extras = null) { $this->log->addRecord(self::$mapping[$priority], $message); } } src/Guzzle/Log/PsrLogAdapter.php000064400000001646151742734620012576 0ustar00 LogLevel::DEBUG, LOG_INFO => LogLevel::INFO, LOG_WARNING => LogLevel::WARNING, LOG_ERR => LogLevel::ERROR, LOG_CRIT => LogLevel::CRITICAL, LOG_ALERT => LogLevel::ALERT ); /** * {@inheritdoc} */ public function __construct(LoggerInterface $logObject) { $this->log = $logObject; } /** * {@inheritdoc} */ public function log($message, $priority = LOG_INFO, $extras = null) { $this->log->log(self::$mapping[$priority], $message, $extras); } } src/Guzzle/Log/Zf1LogAdapter.php000064400000000675151742734620012473 0ustar00log = $logObject; } /** * {@inheritdoc} */ public function log($message, $priority = LOG_INFO, $extras = null) { $this->log->log($message, $priority, $extras); } } src/Guzzle/Log/Zf2LogAdapter.php000064400000000733151742734620012467 0ustar00log = $logObject; } /** * {@inheritdoc} */ public function log($message, $priority = LOG_INFO, $extras = null) { $this->log->log($priority, $message, $extras ?: array()); } } src/Guzzle/Log/composer.json000064400000001240151742734620012066 0ustar00{ "name": "guzzle/log", "description": "Guzzle log adapter component", "homepage": "http://guzzlephp.org/", "keywords": ["log", "adapter", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2" }, "autoload": { "psr-0": { "Guzzle\\Log": "" } }, "suggest": { "guzzle/http": "self.version" }, "target-dir": "Guzzle/Log", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Parser/Cookie/CookieParser.php000064400000006030151742734620014371 0ustar00 'Domain', 'path' => 'Path', 'max_age' => 'Max-Age', 'expires' => 'Expires', 'version' => 'Version', 'secure' => 'Secure', 'port' => 'Port', 'discard' => 'Discard', 'comment' => 'Comment', 'comment_url' => 'Comment-Url', 'http_only' => 'HttpOnly' ); /** * {@inheritdoc} */ public function parseCookie($cookie, $host = null, $path = null, $decode = false) { // Explode the cookie string using a series of semicolons $pieces = array_filter(array_map('trim', explode(';', $cookie))); // The name of the cookie (first kvp) must include an equal sign. if (empty($pieces) || !strpos($pieces[0], '=')) { return false; } // Create the default return array $data = array_merge(array_fill_keys(array_keys(self::$cookieParts), null), array( 'cookies' => array(), 'data' => array(), 'path' => $path ?: '/', 'http_only' => false, 'discard' => false, 'domain' => $host )); $foundNonCookies = 0; // Add the cookie pieces into the parsed data array foreach ($pieces as $part) { $cookieParts = explode('=', $part, 2); $key = trim($cookieParts[0]); if (count($cookieParts) == 1) { // Can be a single value (e.g. secure, httpOnly) $value = true; } else { // Be sure to strip wrapping quotes $value = trim($cookieParts[1], " \n\r\t\0\x0B\""); if ($decode) { $value = urldecode($value); } } // Only check for non-cookies when cookies have been found if (!empty($data['cookies'])) { foreach (self::$cookieParts as $mapValue => $search) { if (!strcasecmp($search, $key)) { $data[$mapValue] = $mapValue == 'port' ? array_map('trim', explode(',', $value)) : $value; $foundNonCookies++; continue 2; } } } // If cookies have not yet been retrieved, or this value was not found in the pieces array, treat it as a // cookie. IF non-cookies have been parsed, then this isn't a cookie, it's cookie data. Cookies then data. $data[$foundNonCookies ? 'data' : 'cookies'][$key] = $value; } // Calculate the expires date if (!$data['expires'] && $data['max_age']) { $data['expires'] = time() + (int) $data['max_age']; } return $data; } } src/Guzzle/Parser/Cookie/CookieParserInterface.php000064400000002714151742734620016217 0ustar00 $requestUrl, 'scheme' => 'http' ); // Check for the Host header if (isset($parts['headers']['Host'])) { $urlParts['host'] = $parts['headers']['Host']; } elseif (isset($parts['headers']['host'])) { $urlParts['host'] = $parts['headers']['host']; } else { $urlParts['host'] = ''; } if (false === strpos($urlParts['host'], ':')) { $urlParts['port'] = ''; } else { $hostParts = explode(':', $urlParts['host']); $urlParts['host'] = trim($hostParts[0]); $urlParts['port'] = (int) trim($hostParts[1]); if ($urlParts['port'] == 443) { $urlParts['scheme'] = 'https'; } } // Check if a query is present $path = $urlParts['path']; $qpos = strpos($path, '?'); if ($qpos) { $urlParts['query'] = substr($path, $qpos + 1); $urlParts['path'] = substr($path, 0, $qpos); } else { $urlParts['query'] = ''; } return $urlParts; } } src/Guzzle/Parser/Message/MessageParser.php000064400000006516151742734620014730 0ustar00parseMessage($message); // Parse the protocol and protocol version if (isset($parts['start_line'][2])) { $startParts = explode('/', $parts['start_line'][2]); $protocol = strtoupper($startParts[0]); $version = isset($startParts[1]) ? $startParts[1] : '1.1'; } else { $protocol = 'HTTP'; $version = '1.1'; } $parsed = array( 'method' => strtoupper($parts['start_line'][0]), 'protocol' => $protocol, 'version' => $version, 'headers' => $parts['headers'], 'body' => $parts['body'] ); $parsed['request_url'] = $this->getUrlPartsFromMessage($parts['start_line'][1], $parsed); return $parsed; } /** * {@inheritdoc} */ public function parseResponse($message) { if (!$message) { return false; } $parts = $this->parseMessage($message); list($protocol, $version) = explode('/', trim($parts['start_line'][0])); return array( 'protocol' => $protocol, 'version' => $version, 'code' => $parts['start_line'][1], 'reason_phrase' => isset($parts['start_line'][2]) ? $parts['start_line'][2] : '', 'headers' => $parts['headers'], 'body' => $parts['body'] ); } /** * Parse a message into parts * * @param string $message Message to parse * * @return array */ protected function parseMessage($message) { $startLine = null; $headers = array(); $body = ''; // Iterate over each line in the message, accounting for line endings $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE); for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) { $line = $lines[$i]; // If two line breaks were encountered, then this is the end of body if (empty($line)) { if ($i < $totalLines - 1) { $body = implode('', array_slice($lines, $i + 2)); } break; } // Parse message headers if (!$startLine) { $startLine = explode(' ', $line, 3); } elseif (strpos($line, ':')) { $parts = explode(':', $line, 2); $key = trim($parts[0]); $value = isset($parts[1]) ? trim($parts[1]) : ''; if (!isset($headers[$key])) { $headers[$key] = $value; } elseif (!is_array($headers[$key])) { $headers[$key] = array($headers[$key], $value); } else { $headers[$key][] = $value; } } } return array( 'start_line' => $startLine, 'headers' => $headers, 'body' => $body ); } } src/Guzzle/Parser/Message/MessageParserInterface.php000064400000001267151742734620016547 0ustar00 $parts->requestMethod, 'protocol' => 'HTTP', 'version' => number_format($parts->httpVersion, 1), 'headers' => $parts->headers, 'body' => $parts->body ); $parsed['request_url'] = $this->getUrlPartsFromMessage($parts->requestUrl, $parsed); return $parsed; } /** * {@inheritdoc} */ public function parseResponse($message) { if (!$message) { return false; } $parts = http_parse_message($message); return array( 'protocol' => 'HTTP', 'version' => number_format($parts->httpVersion, 1), 'code' => $parts->responseCode, 'reason_phrase' => $parts->responseStatus, 'headers' => $parts->headers, 'body' => $parts->body ); } } src/Guzzle/Parser/ParserRegistry.php000064400000005576151742734620013575 0ustar00 'Guzzle\\Parser\\Message\\MessageParser', 'cookie' => 'Guzzle\\Parser\\Cookie\\CookieParser', 'url' => 'Guzzle\\Parser\\Url\\UrlParser', 'uri_template' => 'Guzzle\\Parser\\UriTemplate\\UriTemplate', ); /** * Get a singleton instance * * @return self * @codeCoverageIgnore */ public static function getInstance() { if (!self::$instance) { self::$instance = new static; } return self::$instance; } /** * Constructor used to apply the most performant parsers based on loaded extensions */ public function __construct() { // Use the PECL URI template parser if available if (extension_loaded('uri_template')) { $this->mapping['uri_template'] = 'Guzzle\\Parser\\UriTemplate\\PeclUriTemplate'; } } /** * Get a parser by name from an instance * * @param string $name Name of the parser to retrieve * * @return mixed|null */ public function getParser($name) { if (!isset($this->instances[$name])) { if (!isset($this->mapping[$name])) { return null; } $class = $this->mapping[$name]; $this->instances[$name] = new $class(); } return $this->instances[$name]; } /** * Register a custom parser by name with the register * * @param string $name Name or handle of the parser to register * @param mixed $parser Instantiated parser to register */ public function registerParser($name, $parser) { $this->instances[$name] = $parser; } /** * Get a specific parser by handle name * * @param string $name Name of the parser to retrieve * * @return mixed|null Returns null if the parser is not found or cannot be instantiated * @deprecated Will be removed in 3.1.0 * @codeCoverageIgnore */ public static function get($name) { return self::getInstance()->getParser($name); } /** * Register a custom parser by name with the register * * @param string $name Name or handle of the parser to register * @param mixed $parser Instantiated parser to register * @deprecated Will be removed in 3.1.0 * @codeCoverageIgnore */ public static function set($name, $parser) { self::getInstance()->registerParser($name, $parser); } } src/Guzzle/Parser/UriTemplate/PeclUriTemplate.php000064400000001502151742734620016063 0ustar00 true, '#' => true, '.' => true, '/' => true, ';' => true, '?' => true, '&' => true ); /** * @var array Delimiters */ private static $delims = array( ':', '/', '?', '#', '[', ']', '@', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=' ); /** * @var array Percent encoded delimiters */ private static $delimsPct = array( '%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%3B', '%3D' ); /** * {@inheritdoc} */ public function expand($template, array $variables) { $this->template = $template; $this->variables = $variables; // Check to ensure that the preg_* function is needed if (false === strpos($this->template, '{')) { return $this->template; } return preg_replace_callback(self::$regex, array($this, 'expandMatch'), $this->template); } /** * Parse an expression into parts * * @param string $expression Expression to parse * * @return array Returns an associative array of parts */ private function parseExpression($expression) { // Check for URI operators $operator = ''; if (isset(self::$operatorHash[$expression[0]])) { $operator = $expression[0]; $expression = substr($expression, 1); } $values = explode(',', $expression); foreach ($values as &$value) { $value = trim($value); $varspec = array(); $substrPos = strpos($value, ':'); if ($substrPos) { $varspec['value'] = substr($value, 0, $substrPos); $varspec['modifier'] = ':'; $varspec['position'] = (int) substr($value, $substrPos + 1); } elseif (substr($value, -1) == '*') { $varspec['modifier'] = '*'; $varspec['value'] = substr($value, 0, -1); } else { $varspec['value'] = (string) $value; $varspec['modifier'] = ''; } $value = $varspec; } return array( 'operator' => $operator, 'values' => $values ); } /** * Process an expansion * * @param array $matches Matches met in the preg_replace_callback * * @return string Returns the replacement string */ private function expandMatch(array $matches) { static $rfc1738to3986 = array( '+' => '%20', '%7e' => '~' ); $parsed = self::parseExpression($matches[1]); $replacements = array(); $prefix = $parsed['operator']; $joiner = $parsed['operator']; $useQueryString = false; if ($parsed['operator'] == '?') { $joiner = '&'; $useQueryString = true; } elseif ($parsed['operator'] == '&') { $useQueryString = true; } elseif ($parsed['operator'] == '#') { $joiner = ','; } elseif ($parsed['operator'] == ';') { $useQueryString = true; } elseif ($parsed['operator'] == '' || $parsed['operator'] == '+') { $joiner = ','; $prefix = ''; } foreach ($parsed['values'] as $value) { if (!array_key_exists($value['value'], $this->variables) || $this->variables[$value['value']] === null) { continue; } $variable = $this->variables[$value['value']]; $actuallyUseQueryString = $useQueryString; $expanded = ''; if (is_array($variable)) { $isAssoc = $this->isAssoc($variable); $kvp = array(); foreach ($variable as $key => $var) { if ($isAssoc) { $key = rawurlencode($key); $isNestedArray = is_array($var); } else { $isNestedArray = false; } if (!$isNestedArray) { $var = rawurlencode($var); if ($parsed['operator'] == '+' || $parsed['operator'] == '#') { $var = $this->decodeReserved($var); } } if ($value['modifier'] == '*') { if ($isAssoc) { if ($isNestedArray) { // Nested arrays must allow for deeply nested structures $var = strtr(http_build_query(array($key => $var)), $rfc1738to3986); } else { $var = $key . '=' . $var; } } elseif ($key > 0 && $actuallyUseQueryString) { $var = $value['value'] . '=' . $var; } } $kvp[$key] = $var; } if (empty($variable)) { $actuallyUseQueryString = false; } elseif ($value['modifier'] == '*') { $expanded = implode($joiner, $kvp); if ($isAssoc) { // Don't prepend the value name when using the explode modifier with an associative array $actuallyUseQueryString = false; } } else { if ($isAssoc) { // When an associative array is encountered and the explode modifier is not set, then the // result must be a comma separated list of keys followed by their respective values. foreach ($kvp as $k => &$v) { $v = $k . ',' . $v; } } $expanded = implode(',', $kvp); } } else { if ($value['modifier'] == ':') { $variable = substr($variable, 0, $value['position']); } $expanded = rawurlencode($variable); if ($parsed['operator'] == '+' || $parsed['operator'] == '#') { $expanded = $this->decodeReserved($expanded); } } if ($actuallyUseQueryString) { if (!$expanded && $joiner != '&') { $expanded = $value['value']; } else { $expanded = $value['value'] . '=' . $expanded; } } $replacements[] = $expanded; } $ret = implode($joiner, $replacements); if ($ret && $prefix) { return $prefix . $ret; } return $ret; } /** * Determines if an array is associative * * @param array $array Array to check * * @return bool */ private function isAssoc(array $array) { return (bool) count(array_filter(array_keys($array), 'is_string')); } /** * Removes percent encoding on reserved characters (used with + and # modifiers) * * @param string $string String to fix * * @return string */ private function decodeReserved($string) { return str_replace(self::$delimsPct, self::$delims, $string); } } src/Guzzle/Parser/UriTemplate/UriTemplateInterface.php000064400000000776151742734620017114 0ustar00utf8 = $utf8; } /** * {@inheritdoc} */ public function parseUrl($url) { $parts = parse_url($url); // Need to handle query parsing specially for UTF-8 requirements if ($this->utf8 && isset($parts['query'])) { $queryPos = strpos($url, '?'); if (isset($parts['fragment'])) { $parts['query'] = substr($url, $queryPos + 1, strpos($url, '#') - $queryPos - 1); } else { $parts['query'] = substr($url, $queryPos + 1); } } $parts['scheme'] = isset($parts['scheme']) ? $parts['scheme'] : null; $parts['host'] = isset($parts['host']) ? $parts['host'] : null; $parts['path'] = isset($parts['path']) ? $parts['path'] : null; $parts['port'] = isset($parts['port']) ? $parts['port'] : null; $parts['query'] = isset($parts['query']) ? $parts['query'] : null; $parts['user'] = isset($parts['user']) ? $parts['user'] : null; $parts['pass'] = isset($parts['pass']) ? $parts['pass'] : null; $parts['fragment'] = isset($parts['fragment']) ? $parts['fragment'] : null; return $parts; } } src/Guzzle/Parser/Url/UrlParserInterface.php000064400000001024151742734620015072 0ustar00=5.3.2" }, "autoload": { "psr-0": { "Guzzle\\Parser": "" } }, "target-dir": "Guzzle/Parser", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Async/AsyncPlugin.php000064400000005521151742734620014111 0ustar00 'onBeforeSend', 'request.exception' => 'onRequestTimeout', 'request.sent' => 'onRequestSent', 'curl.callback.progress' => 'onCurlProgress' ); } /** * Event used to ensure that progress callback are emitted from the curl handle's request mediator. * * @param Event $event */ public function onBeforeSend(Event $event) { // Ensure that progress callbacks are dispatched $event['request']->getCurlOptions()->set('progress', true); } /** * Event emitted when a curl progress function is called. When the amount of data uploaded == the amount of data to * upload OR any bytes have been downloaded, then time the request out after 1ms because we're done with * transmitting the request, and tell curl not download a body. * * @param Event $event */ public function onCurlProgress(Event $event) { if (!$event['handle']) { return; } if ($event['downloaded'] || ($event['uploaded'] || $event['upload_size'] === $event['uploaded'])) { $event['handle']->getOptions() ->set(CURLOPT_TIMEOUT_MS, 1) ->set(CURLOPT_NOBODY, true); // Timeout after 1ms curl_setopt($event['handle']->getHandle(), CURLOPT_TIMEOUT_MS, 1); // Even if the response is quick, tell curl not to download the body curl_setopt($event['handle']->getHandle(), CURLOPT_NOBODY, true); } } /** * Event emitted when a curl exception occurs. Ignore the exception and set a mock response. * * @param Event $event */ public function onRequestTimeout(Event $event) { if ($event['exception'] instanceof CurlException) { $event['request']->setResponse(new Response(200, array( 'X-Guzzle-Async' => 'Did not wait for the response' ))); } } /** * Event emitted when a request completes because it took less than 1ms. Add an X-Guzzle-Async header to notify the * caller that there is no body in the message. * * @param Event $event */ public function onRequestSent(Event $event) { // Let the caller know this was meant to be async $event['request']->getResponse()->setHeader('X-Guzzle-Async', 'Did not wait for the response'); } } src/Guzzle/Plugin/Async/composer.json000064400000001234151742734620013663 0ustar00{ "name": "guzzle/plugin-async", "description": "Guzzle async request plugin", "homepage": "http://guzzlephp.org/", "keywords": ["plugin", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Async": "" } }, "target-dir": "Guzzle/Plugin/Async", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Backoff/AbstractBackoffStrategy.php000064400000006206151742734620016676 0ustar00next = $next; } /** * Get the next backoff strategy in the chain * * @return AbstractBackoffStrategy|null */ public function getNext() { return $this->next; } /** * {@inheritdoc} */ public function getBackoffPeriod( $retries, RequestInterface $request, Response $response = null, HttpException $e = null ) { $delay = $this->getDelay($retries, $request, $response, $e); if ($delay === false) { // The strategy knows that this must not be retried return false; } elseif ($delay === null) { // If the strategy is deferring a decision and the next strategy will not make a decision then return false return !$this->next || !$this->next->makesDecision() ? false : $this->next->getBackoffPeriod($retries, $request, $response, $e); } elseif ($delay === true) { // if the strategy knows that it must retry but is deferring to the next to determine the delay if (!$this->next) { return 0; } else { $next = $this->next; while ($next->makesDecision() && $next->getNext()) { $next = $next->getNext(); } return !$next->makesDecision() ? $next->getBackoffPeriod($retries, $request, $response, $e) : 0; } } else { return $delay; } } /** * Check if the strategy does filtering and makes decisions on whether or not to retry. * * Strategies that return false will never retry if all of the previous strategies in a chain defer on a backoff * decision. * * @return bool */ abstract public function makesDecision(); /** * Implement the concrete strategy * * @param int $retries Number of retries of the request * @param RequestInterface $request Request that was sent * @param Response $response Response that was received. Note that there may not be a response * @param HttpException $e Exception that was encountered if any * * @return bool|int|null Returns false to not retry or the number of seconds to delay between retries. Return true * or null to defer to the next strategy if available, and if not, return 0. */ abstract protected function getDelay( $retries, RequestInterface $request, Response $response = null, HttpException $e = null ); } src/Guzzle/Plugin/Backoff/AbstractErrorCodeBackoffStrategy.php000064400000002122151742734620020474 0ustar00errorCodes = array_fill_keys($codes ?: static::$defaultErrorCodes, 1); $this->next = $next; } /** * Get the default failure codes to retry * * @return array */ public static function getDefaultFailureCodes() { return static::$defaultErrorCodes; } /** * {@inheritdoc} */ public function makesDecision() { return true; } } src/Guzzle/Plugin/Backoff/BackoffLogger.php000064400000004575151742734620014636 0ustar00logger = $logger; $this->formatter = $formatter ?: new MessageFormatter(self::DEFAULT_FORMAT); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array(BackoffPlugin::RETRY_EVENT => 'onRequestRetry'); } /** * Set the template to use for logging * * @param string $template Log message template * * @return self */ public function setTemplate($template) { $this->formatter->setTemplate($template); return $this; } /** * Called when a request is being retried * * @param Event $event Event emitted */ public function onRequestRetry(Event $event) { $this->logger->log($this->formatter->format( $event['request'], $event['response'], $event['handle'], array( 'retries' => $event['retries'], 'delay' => $event['delay'] ) )); } } src/Guzzle/Plugin/Backoff/BackoffPlugin.php000064400000010551151742734620014644 0ustar00strategy = $strategy; } /** * Retrieve a basic truncated exponential backoff plugin that will retry HTTP errors and cURL errors * * @param int $maxRetries Maximum number of retries * @param array $httpCodes HTTP response codes to retry * @param array $curlCodes cURL error codes to retry * * @return self */ public static function getExponentialBackoff( $maxRetries = 3, array $httpCodes = null, array $curlCodes = null ) { return new self(new TruncatedBackoffStrategy($maxRetries, new HttpBackoffStrategy($httpCodes, new CurlBackoffStrategy($curlCodes, new ExponentialBackoffStrategy() ) ) )); } /** * {@inheritdoc} */ public static function getAllEvents() { return array(self::RETRY_EVENT); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array( 'request.sent' => 'onRequestSent', 'request.exception' => 'onRequestSent', CurlMultiInterface::POLLING_REQUEST => 'onRequestPoll' ); } /** * Called when a request has been sent and isn't finished processing * * @param Event $event */ public function onRequestSent(Event $event) { $request = $event['request']; $response = $event['response']; $exception = $event['exception']; $params = $request->getParams(); $retries = (int) $params->get(self::RETRY_PARAM); $delay = $this->strategy->getBackoffPeriod($retries, $request, $response, $exception); if ($delay !== false) { // Calculate how long to wait until the request should be retried $params->set(self::RETRY_PARAM, ++$retries) ->set(self::DELAY_PARAM, microtime(true) + $delay); // Send the request again $request->setState(RequestInterface::STATE_TRANSFER); $this->dispatch(self::RETRY_EVENT, array( 'request' => $request, 'response' => $response, 'handle' => $exception ? $exception->getCurlHandle() : null, 'retries' => $retries, 'delay' => $delay )); } } /** * Called when a request is polling in the curl multi object * * @param Event $event */ public function onRequestPoll(Event $event) { $request = $event['request']; $delay = $request->getParams()->get(self::DELAY_PARAM); // If the duration of the delay has passed, retry the request using the pool if (null !== $delay && microtime(true) >= $delay) { // Remove the request from the pool and then add it back again. This is required for cURL to know that we // want to retry sending the easy handle. $request->getParams()->remove(self::DELAY_PARAM); // Rewind the request body if possible if ($request instanceof EntityEnclosingRequestInterface && $request->getBody()) { $request->getBody()->seek(0); } $multi = $event['curl_multi']; $multi->remove($request); $multi->add($request, true); } } } src/Guzzle/Plugin/Backoff/BackoffStrategyInterface.php000064400000001743151742734620017034 0ustar00callback = $callback; $this->decision = (bool) $decision; $this->next = $next; } /** * {@inheritdoc} */ public function makesDecision() { return $this->decision; } /** * {@inheritdoc} */ protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null) { return call_user_func($this->callback, $retries, $request, $response, $e); } } src/Guzzle/Plugin/Backoff/ConstantBackoffStrategy.php000064400000001751151742734620016724 0ustar00delay = $delay; } /** * {@inheritdoc} */ public function makesDecision() { return false; } /** * {@inheritdoc} */ protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null) { return $this->delay; } } src/Guzzle/Plugin/Backoff/CurlBackoffStrategy.php000064400000001774151742734620016045 0ustar00errorCodes[$e->getErrorNo()]) ? true : null; } } } src/Guzzle/Plugin/Backoff/ExponentialBackoffStrategy.php000064400000001330151742734620017412 0ustar00isSuccessful()) { return false; } else { return isset($this->errorCodes[$response->getStatusCode()]) ? true : null; } } } } src/Guzzle/Plugin/Backoff/LinearBackoffStrategy.php000064400000001743151742734620016346 0ustar00step = $step; } /** * {@inheritdoc} */ public function makesDecision() { return false; } /** * {@inheritdoc} */ protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null) { return $retries * $this->step; } } src/Guzzle/Plugin/Backoff/ReasonPhraseBackoffStrategy.php000064400000001370151742734620017522 0ustar00errorCodes[$response->getReasonPhrase()]) ? true : null; } } } src/Guzzle/Plugin/Backoff/TruncatedBackoffStrategy.php000064400000002045151742734620017061 0ustar00max = $maxRetries; $this->next = $next; } /** * {@inheritdoc} */ public function makesDecision() { return true; } /** * {@inheritdoc} */ protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null) { return $retries < $this->max ? null : false; } } src/Guzzle/Plugin/Backoff/composer.json000064400000001311151742734620014135 0ustar00{ "name": "guzzle/plugin-backoff", "description": "Guzzle backoff retry plugins", "homepage": "http://guzzlephp.org/", "keywords": ["plugin", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version", "guzzle/log": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Backoff": "" } }, "target-dir": "Guzzle/Plugin/Backoff", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Cache/CacheKeyProviderInterface.php000064400000000644151742734620016614 0ustar00 $options); } elseif ($options instanceof CacheStorageInterface) { $options = array('storage' => $options); } elseif (class_exists('Doctrine\Common\Cache\ArrayCache')) { $options = array('storage' => new DefaultCacheStorage(new DoctrineCacheAdapter(new ArrayCache()), 3600)); } else { // @codeCoverageIgnoreStart throw new InvalidArgumentException('No cache was provided and Doctrine is not installed'); // @codeCoverageIgnoreEnd } } // Add a cache storage if a cache adapter was provided if (!isset($options['adapter'])) { $this->storage = $options['storage']; } else { $this->storage = new DefaultCacheStorage( $options['adapter'], array_key_exists('default_ttl', $options) ? $options['default_ttl'] : 3600 ); } // Use the provided key provider or the default if (!isset($options['key_provider'])) { $this->keyProvider = new DefaultCacheKeyProvider(); } else { if (is_callable($options['key_provider'])) { $this->keyProvider = new CallbackCacheKeyProvider($options['key_provider']); } else { $this->keyProvider = $options['key_provider']; } } if (!isset($options['can_cache'])) { $this->canCache = new DefaultCanCacheStrategy(); } else { if (is_callable($options['can_cache'])) { $this->canCache = new CallbackCanCacheStrategy($options['can_cache']); } else { $this->canCache = $options['can_cache']; } } // Use the provided revalidation strategy or the default if (isset($options['revalidation'])) { $this->revalidation = $options['revalidation']; } else { $this->revalidation = new DefaultRevalidation($this->keyProvider, $this->storage, $this); } if (!isset($options['debug_headers'])) { $this->debugHeaders = true; } else { $this->debugHeaders = (bool) $options['debug_headers']; } } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array( 'request.before_send' => array('onRequestBeforeSend', -255), 'request.sent' => array('onRequestSent', 255), 'request.error' => array('onRequestError', 0), 'request.exception' => array('onRequestException', 0), ); } /** * Check if a response in cache will satisfy the request before sending * * @param Event $event */ public function onRequestBeforeSend(Event $event) { $request = $event['request']; $request->addHeader('Via', sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION)); // Intercept PURGE requests if ($request->getMethod() == 'PURGE') { $this->purge($request); $request->setResponse(new Response(200, array(), 'purged')); return; } if (!$this->canCache->canCacheRequest($request)) { return; } $hashKey = $this->keyProvider->getCacheKey($request); // If the cached data was found, then make the request into a // manually set request if ($cachedData = $this->storage->fetch($hashKey)) { $request->getParams()->set('cache.lookup', true); $response = new Response($cachedData[0], $cachedData[1], $cachedData[2]); $response->setHeader('Age', time() - strtotime($response->getDate() ? : 'now')); // Validate that the response satisfies the request if ($this->canResponseSatisfyRequest($request, $response)) { $request->getParams()->set('cache.hit', true); $request->setResponse($response); } } } /** * If possible, store a response in cache after sending * * @param Event $event */ public function onRequestSent(Event $event) { $request = $event['request']; $response = $event['response']; $cacheKey = $this->keyProvider->getCacheKey($request); if ($request->getParams()->get('cache.hit') === null && $this->canCache->canCacheRequest($request) && $this->canCache->canCacheResponse($response) ) { $this->storage->cache($cacheKey, $response, $request->getParams()->get('cache.override_ttl')); } $this->addResponseHeaders($cacheKey, $request, $response); } /** * If possible, return a cache response on an error * * @param Event $event */ public function onRequestError(Event $event) { $request = $event['request']; if (!$this->canCache->canCacheRequest($request)) { return; } $cacheKey = $this->keyProvider->getCacheKey($request); if ($cachedData = $this->storage->fetch($cacheKey)) { $response = new Response($cachedData[0], $cachedData[1], $cachedData[2]); $response->setRequest($request); $response->setHeader('Age', time() - strtotime($response->getDate() ? : 'now')); if (!$this->canResponseSatisfyFailedRequest($request, $response)) { return; } $request->getParams()->set('cache.hit', 'error'); $this->addResponseHeaders($cacheKey, $request, $response); $event['response'] = $response; $event->stopPropagation(); } } /** * If possible, set a cache response on a cURL exception * * @param Event $event * * @return null */ public function onRequestException(Event $event) { if (!$event['exception'] instanceof CurlException) { return; } $request = $event['request']; if (!$this->canCache->canCacheRequest($request)) { return; } $cacheKey = $this->keyProvider->getCacheKey($request); if ($cachedData = $this->storage->fetch($cacheKey)) { $response = new Response($cachedData[0], $cachedData[1], $cachedData[2]); $response->setHeader('Age', time() - strtotime($response->getDate() ? : 'now')); if (!$this->canResponseSatisfyFailedRequest($request, $response)) { return; } $request->getParams()->set('cache.hit', 'error'); $request->setResponse($response); $event->stopPropagation(); } } /** * Check if a cache response satisfies a request's caching constraints * * @param RequestInterface $request Request to validate * @param Response $response Response to validate * * @return bool */ public function canResponseSatisfyRequest(RequestInterface $request, Response $response) { $responseAge = $response->getAge(); // Check the request's max-age header against the age of the response if ($request->hasCacheControlDirective('max-age') && $responseAge > $request->getCacheControlDirective('max-age')) { return false; } // Check the response's max-age header if ($response->isFresh() === false) { $maxStale = $request->getCacheControlDirective('max-stale'); if (null !== $maxStale) { if ($maxStale !== true && $response->getFreshness() < (-1 * $maxStale)) { return false; } } elseif ($response->hasCacheControlDirective('max-age') && $responseAge > $response->getCacheControlDirective('max-age') ) { return false; } } // Only revalidate GET requests if ($request->getMethod() == RequestInterface::GET) { // Check if the response must be validated against the origin server if ($request->getHeader('Pragma') == 'no-cache' || $request->hasCacheControlDirective('no-cache') || $request->hasCacheControlDirective('must-revalidate') || $response->hasCacheControlDirective('must-revalidate') || $response->hasCacheControlDirective('no-cache')) { // no-cache: When no parameters are present, always revalidate // When parameters are present in no-cache and the request includes those same parameters, then the // response must re-validate. I'll need an example of what fields look like in order to implement a // smarter version of no-cache // Requests can decline to revalidate against the origin server by setting the cache.revalidate param: // - never - To never revalidate and always contact the origin server // - skip - To skip revalidation and just use what is in cache switch ($request->getParams()->get('cache.revalidate')) { case 'never': return false; case 'skip': return true; default: return $this->revalidation->revalidate($request, $response); } } } return true; } /** * Check if a cache response satisfies a failed request's caching constraints * * @param RequestInterface $request Request to validate * @param Response $response Response to validate * * @return bool */ public function canResponseSatisfyFailedRequest(RequestInterface $request, Response $response) { $requestStaleIfError = $request->getCacheControlDirective('stale-if-error'); $responseStaleIfError = $response->getCacheControlDirective('stale-if-error'); if (!$requestStaleIfError && !$responseStaleIfError) { return false; } if ($requestStaleIfError !== true && $requestStaleIfError !== null && $response->getAge() - $response->getMaxAge() > $requestStaleIfError ) { return false; } if ($responseStaleIfError !== true && $responseStaleIfError !== null && $response->getAge() - $response->getMaxAge() > $responseStaleIfError ) { return false; } return true; } /** * Purge a request from the cache storage * * @param RequestInterface $request Request to purge */ public function purge(RequestInterface $request) { // If the request has a cache.purge_methods param, then use that, otherwise use the default known methods $methods = $request->getParams()->get('cache.purge_methods') ?: array('GET', 'HEAD', 'POST', 'PUT', 'DELETE'); foreach ($methods as $method) { // Clone the request with each method and clear from the cache $cloned = RequestFactory::getInstance()->cloneRequestWithMethod($request, $method); $key = $this->keyProvider->getCacheKey($cloned); $this->storage->delete($key); } } /** * Add the plugin's headers to a response * * @param string $cacheKey Cache key * @param RequestInterface $request Request * @param Response $response Response to add headers to */ protected function addResponseHeaders($cacheKey, RequestInterface $request, Response $response) { if (!$response->hasHeader('X-Guzzle-Cache')) { $response->setHeader('X-Guzzle-Cache', "key={$cacheKey}"); } $response->addHeader('Via', sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION)); if ($this->debugHeaders) { if ($request->getParams()->get('cache.lookup') === true) { $response->addHeader('X-Cache-Lookup', 'HIT from GuzzleCache'); } else { $response->addHeader('X-Cache-Lookup', 'MISS from GuzzleCache'); } if ($request->getParams()->get('cache.hit') === true) { $response->addHeader('X-Cache', 'HIT from GuzzleCache'); } elseif ($request->getParams()->get('cache.hit') === 'error') { $response->addHeader('X-Cache', 'HIT_ERROR from GuzzleCache'); } else { $response->addHeader('X-Cache', 'MISS from GuzzleCache'); } } if ($response->isFresh() === false) { $response->addHeader('Warning', sprintf('110 GuzzleCache/%s "Response is stale"', Version::VERSION)); if ($request->getParams()->get('cache.hit') === 'error') { $response->addHeader( 'Warning', sprintf('111 GuzzleCache/%s "Revalidation failed"', Version::VERSION) ); } } } } src/Guzzle/Plugin/Cache/CacheStorageInterface.php000064400000001342151742734620015751 0ustar00callback = $callback; } /** * {@inheritdoc} */ public function getCacheKey(RequestInterface $request) { return call_user_func($this->callback, $request); } } src/Guzzle/Plugin/Cache/CallbackCanCacheStrategy.php000064400000003336151742734620016372 0ustar00requestCallback = $requestCallback; $this->responseCallback = $responseCallback; } /** * {@inheritdoc} */ public function canCacheRequest(RequestInterface $request) { return $this->requestCallback ? call_user_func($this->requestCallback, $request) : parent::canCache($request); } /** * {@inheritdoc} */ public function canCacheResponse(Response $response) { return $this->responseCallback ? call_user_func($this->responseCallback, $response) : parent::canCacheResponse($response); } } src/Guzzle/Plugin/Cache/CanCacheStrategyInterface.php000064400000001211151742734620016564 0ustar00getParams()->get(self::CACHE_KEY); if (!$key) { $cloned = clone $request; $cloned->removeHeader('Cache-Control'); // Check to see how and if the key should be filtered foreach (explode(';', $request->getParams()->get(self::CACHE_KEY_FILTER)) as $part) { $pieces = array_map('trim', explode('=', $part)); if (isset($pieces[1])) { foreach (array_map('trim', explode(',', $pieces[1])) as $remove) { if ($pieces[0] == 'header') { $cloned->removeHeader($remove); } elseif ($pieces[0] == 'query') { $cloned->getQuery()->remove($remove); } } } } $raw = (string) $cloned; $key = 'GZ' . md5($raw); $request->getParams()->set(self::CACHE_KEY, $key)->set(self::CACHE_KEY_RAW, $raw); } return $key; } } src/Guzzle/Plugin/Cache/DefaultCacheStorage.php000064400000004366151742734620015446 0ustar00cache = $cache; $this->defaultTtl = $defaultTtl; } /** * {@inheritdoc} */ public function cache($key, Response $response, $ttl = null) { if ($ttl === null) { $ttl = $this->defaultTtl; } $ttl += $response->getMaxAge(); if ($ttl) { $response->setHeader('X-Guzzle-Cache', "key={$key}; ttl={$ttl}"); // Remove excluded headers from the response (see RFC 2616:13.5.1) foreach ($this->excludeResponseHeaders as $header) { $response->removeHeader($header); } // Add a Date header to the response if none is set (for validation) if (!$response->getDate()) { $response->setHeader('Date', gmdate(ClientInterface::HTTP_DATE)); } $this->cache->save( $key, array($response->getStatusCode(), $response->getHeaders()->getAll(), $response->getBody(true)), $ttl ); } } /** * {@inheritdoc} */ public function delete($key) { $this->cache->delete($key); } /** * {@inheritdoc} */ public function fetch($key) { return $this->cache->fetch($key); } } src/Guzzle/Plugin/Cache/DefaultCanCacheStrategy.php000064400000001115151742734620016253 0ustar00canCache(); } /** * {@inheritdoc} */ public function canCacheResponse(Response $response) { return $response->isSuccessful() && $response->canCache(); } } src/Guzzle/Plugin/Cache/DefaultRevalidation.php000064400000013105151742734620015526 0ustar00cacheKey = $cacheKey; $this->storage = $cache; $this->plugin = $plugin; } /** * {@inheritdoc} */ public function revalidate(RequestInterface $request, Response $response) { try { $revalidate = $this->createRevalidationRequest($request, $response); $validateResponse = $revalidate->send(); if ($validateResponse->getStatusCode() == 200) { return $this->handle200Response($request, $validateResponse); } elseif ($validateResponse->getStatusCode() == 304) { return $this->handle304Response($request, $validateResponse, $response); } } catch (BadResponseException $e) { $this->handleBadResponse($e); } // Other exceptions encountered in the revalidation request are ignored // in hopes that sending a request to the origin server will fix it return false; } /** * Handles a bad response when attempting to revalidate * * @param BadResponseException $e Exception encountered * * @throws BadResponseException */ protected function handleBadResponse(BadResponseException $e) { // 404 errors mean the resource no longer exists, so remove from // cache, and prevent an additional request by throwing the exception if ($e->getResponse()->getStatusCode() == 404) { $this->storage->delete($this->cacheKey->getCacheKey($e->getRequest())); throw $e; } } /** * Creates a request to use for revalidation * * @param RequestInterface $request Request * @param Response $response Response to revalidate * * @return RequestInterface returns a revalidation request */ protected function createRevalidationRequest(RequestInterface $request, Response $response) { $revalidate = clone $request; $revalidate->removeHeader('Pragma') ->removeHeader('Cache-Control') ->setHeader('If-Modified-Since', $response->getLastModified() ?: $response->getDate()); if ($response->getEtag()) { $revalidate->setHeader('If-None-Match', '"' . $response->getEtag() . '"'); } // Remove any cache plugins that might be on the request $revalidate->getEventDispatcher()->removeSubscriber($this->plugin); return $revalidate; } /** * Handles a 200 response response from revalidating. The server does not support validation, so use this response. * * @param RequestInterface $request Request that was sent * @param Response $validateResponse Response received * * @return bool Returns true if valid, false if invalid */ protected function handle200Response(RequestInterface $request, Response $validateResponse) { $request->setResponse($validateResponse); // Store this response in cache if possible if ($validateResponse->canCache()) { $this->storage->cache( $this->cacheKey->getCacheKey($request), $validateResponse, $request->getParams()->get('cache.override_ttl') ); } return false; } /** * Handle a 304 response and ensure that it is still valid * * @param RequestInterface $request Request that was sent * @param Response $validateResponse Response received * @param Response $response Original cached response * * @return bool Returns true if valid, false if invalid */ protected function handle304Response(RequestInterface $request, Response $validateResponse, Response $response) { static $replaceHeaders = array('Date', 'Expires', 'Cache-Control', 'ETag', 'Last-Modified'); // Make sure that this response has the same ETag if ($validateResponse->getEtag() != $response->getEtag()) { return false; } // Replace cached headers with any of these headers from the // origin server that might be more up to date $modified = false; foreach ($replaceHeaders as $name) { if ($validateResponse->hasHeader($name)) { $modified = true; $response->setHeader($name, $validateResponse->getHeader($name)); } } // Store the updated response in cache if ($modified && $response->canCache()) { $this->storage->cache( $this->cacheKey->getCacheKey($request), $response, $request->getParams()->get('cache.override_ttl') ); } return true; } } src/Guzzle/Plugin/Cache/DenyRevalidation.php000064400000000632151742734620015042 0ustar00=5.3.2", "guzzle/http": "self.version", "guzzle/cache": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Cache": "" } }, "target-dir": "Guzzle/Plugin/Cache", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Cookie/Cookie.php000064400000027200151742734620013220 0ustar00 '', 'value' => '', 'domain' => '', 'path' => '/', 'expires' => null, 'max_age' => 0, 'comment' => null, 'comment_url' => null, 'port' => array(), 'version' => null, 'secure' => false, 'discard' => false, 'http_only' => false ); $this->data = array_merge($defaults, $data); // Extract the expires value and turn it into a UNIX timestamp if needed if (!$this->getExpires() && $this->getMaxAge()) { // Calculate the expires date $this->setExpires(time() + (int) $this->getMaxAge()); } elseif ($this->getExpires() && !is_numeric($this->getExpires())) { $this->setExpires(strtotime($this->getExpires())); } } /** * Get the cookie as an array * * @return array */ public function toArray() { return $this->data; } /** * Get the cookie name * * @return string */ public function getName() { return $this->data['name']; } /** * Set the cookie name * * @param string $name Cookie name * * @return Cookie */ public function setName($name) { return $this->setData('name', $name); } /** * Get the cookie value * * @return string */ public function getValue() { return $this->data['value']; } /** * Set the cookie value * * @param string $value Cookie value * * @return Cookie */ public function setValue($value) { return $this->setData('value', $value); } /** * Get the domain * * @return string|null */ public function getDomain() { return $this->data['domain']; } /** * Set the domain of the cookie * * @param string $domain * * @return Cookie */ public function setDomain($domain) { return $this->setData('domain', $domain); } /** * Get the path * * @return string */ public function getPath() { return $this->data['path']; } /** * Set the path of the cookie * * @param string $path Path of the cookie * * @return Cookie */ public function setPath($path) { return $this->setData('path', $path); } /** * Maximum lifetime of the cookie in seconds * * @return int|null */ public function getMaxAge() { return $this->data['max_age']; } /** * Set the max-age of the cookie * * @param int $maxAge Max age of the cookie in seconds * * @return Cookie */ public function setMaxAge($maxAge) { return $this->setData('max_age', $maxAge); } /** * The UNIX timestamp when the cookie expires * * @return mixed */ public function getExpires() { return $this->data['expires']; } /** * Set the unix timestamp for which the cookie will expire * * @param int $timestamp Unix timestamp * * @return Cookie */ public function setExpires($timestamp) { return $this->setData('expires', $timestamp); } /** * Version of the cookie specification. RFC 2965 is 1 * * @return mixed */ public function getVersion() { return $this->data['version']; } /** * Set the cookie version * * @param string|int $version Version to set * * @return Cookie */ public function setVersion($version) { return $this->setData('version', $version); } /** * Get whether or not this is a secure cookie * * @return null|bool */ public function getSecure() { return $this->data['secure']; } /** * Set whether or not the cookie is secure * * @param bool $secure Set to true or false if secure * * @return Cookie */ public function setSecure($secure) { return $this->setData('secure', (bool) $secure); } /** * Get whether or not this is a session cookie * * @return null|bool */ public function getDiscard() { return $this->data['discard']; } /** * Set whether or not this is a session cookie * * @param bool $discard Set to true or false if this is a session cookie * * @return Cookie */ public function setDiscard($discard) { return $this->setData('discard', $discard); } /** * Get the comment * * @return string|null */ public function getComment() { return $this->data['comment']; } /** * Set the comment of the cookie * * @param string $comment Cookie comment * * @return Cookie */ public function setComment($comment) { return $this->setData('comment', $comment); } /** * Get the comment URL of the cookie * * @return string|null */ public function getCommentUrl() { return $this->data['comment_url']; } /** * Set the comment URL of the cookie * * @param string $commentUrl Cookie comment URL for more information * * @return Cookie */ public function setCommentUrl($commentUrl) { return $this->setData('comment_url', $commentUrl); } /** * Get an array of acceptable ports this cookie can be used with * * @return array */ public function getPorts() { return $this->data['port']; } /** * Set a list of acceptable ports this cookie can be used with * * @param array $ports Array of acceptable ports * * @return Cookie */ public function setPorts(array $ports) { return $this->setData('port', $ports); } /** * Get whether or not this is an HTTP only cookie * * @return bool */ public function getHttpOnly() { return $this->data['http_only']; } /** * Set whether or not this is an HTTP only cookie * * @param bool $httpOnly Set to true or false if this is HTTP only * * @return Cookie */ public function setHttpOnly($httpOnly) { return $this->setData('http_only', $httpOnly); } /** * Get an array of extra cookie data * * @return array */ public function getAttributes() { return $this->data['data']; } /** * Get a specific data point from the extra cookie data * * @param string $name Name of the data point to retrieve * * @return null|string */ public function getAttribute($name) { return array_key_exists($name, $this->data['data']) ? $this->data['data'][$name] : null; } /** * Set a cookie data attribute * * @param string $name Name of the attribute to set * @param string $value Value to set * * @return Cookie */ public function setAttribute($name, $value) { $this->data['data'][$name] = $value; return $this; } /** * Check if the cookie matches a path value * * @param string $path Path to check against * * @return bool */ public function matchesPath($path) { return !$this->getPath() || 0 === stripos($path, $this->getPath()); } /** * Check if the cookie matches a domain value * * @param string $domain Domain to check against * * @return bool */ public function matchesDomain($domain) { $cookieDomain = $this->getDomain(); // Domain not set or exact match. if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { return true; } // . prefix match. if (strpos($cookieDomain, '.') === 0) { $realDomain = substr($cookieDomain, 1); // Root domains don't match except for .local. if (!substr_count($realDomain, '.') && strcasecmp($realDomain, 'local')) { return false; } if (substr($domain, -strlen($realDomain)) === $realDomain) { // Match exact or 1 deep subdomain. return !strcasecmp($domain, $realDomain) || substr_count(substr($domain, 0, -strlen($realDomain)), '.') === 1; } } return false; } /** * Check if the cookie is compatible with a specific port * * @param int $port Port to check * * @return bool */ public function matchesPort($port) { return count($this->getPorts()) == 0 || in_array($port, $this->getPorts()); } /** * Check if the cookie is expired * * @return bool */ public function isExpired() { return $this->getExpires() && time() > $this->getExpires(); } /** * Check if the cookie is valid according to RFC 6265 * * @return bool|string Returns true if valid or an error message if invalid */ public function validate() { // Names must not be empty, but can be 0 $name = $this->getName(); if (empty($name) && !is_numeric($name)) { return 'The cookie name must not be empty'; } // Check if any of the invalid characters are present in the cookie name if (strpbrk($name, self::getInvalidCharacters()) !== false) { return 'The cookie name must not contain invalid characters: ' . $name; } // Value must not be empty, but can be 0 $value = $this->getValue(); if (empty($value) && !is_numeric($value)) { return 'The cookie value must not be empty'; } // Domains must not be empty, but can be 0 // A "0" is not a valid internet domain, but may be used as server name in a private network $domain = $this->getDomain(); if (empty($domain) && !is_numeric($domain)) { return 'The cookie domain must not be empty'; } return true; } /** * Set a value and return the cookie object * * @param string $key Key to set * @param string $value Value to set * * @return Cookie */ private function setData($key, $value) { $this->data[$key] = $value; return $this; } } src/Guzzle/Plugin/Cookie/CookieJar/ArrayCookieJar.php000064400000016124151742734620016525 0ustar00strictMode = $strictMode; } /** * Enable or disable strict mode on the cookie jar * * @param bool $strictMode Set to true to throw exceptions when invalid cookies are added. False to ignore them. * * @return self */ public function setStrictMode($strictMode) { $this->strictMode = $strictMode; } /** * {@inheritdoc} */ public function remove($domain = null, $path = null, $name = null) { $cookies = $this->all($domain, $path, $name, false, false); $this->cookies = array_filter($this->cookies, function (Cookie $cookie) use ($cookies) { return !in_array($cookie, $cookies, true); }); return $this; } /** * {@inheritdoc} */ public function removeTemporary() { $this->cookies = array_filter($this->cookies, function (Cookie $cookie) { return !$cookie->getDiscard() && $cookie->getExpires(); }); return $this; } /** * {@inheritdoc} */ public function removeExpired() { $currentTime = time(); $this->cookies = array_filter($this->cookies, function (Cookie $cookie) use ($currentTime) { return !$cookie->getExpires() || $currentTime < $cookie->getExpires(); }); return $this; } /** * {@inheritdoc} */ public function all($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true) { return array_values(array_filter($this->cookies, function (Cookie $cookie) use ( $domain, $path, $name, $skipDiscardable, $skipExpired ) { return false === (($name && $cookie->getName() != $name) || ($skipExpired && $cookie->isExpired()) || ($skipDiscardable && ($cookie->getDiscard() || !$cookie->getExpires())) || ($path && !$cookie->matchesPath($path)) || ($domain && !$cookie->matchesDomain($domain))); })); } /** * {@inheritdoc} */ public function add(Cookie $cookie) { // Only allow cookies with set and valid domain, name, value $result = $cookie->validate(); if ($result !== true) { if ($this->strictMode) { throw new InvalidCookieException($result); } else { return false; } } // Resolve conflicts with previously set cookies foreach ($this->cookies as $i => $c) { // Two cookies are identical, when their path, domain, port and name are identical if ($c->getPath() != $cookie->getPath() || $c->getDomain() != $cookie->getDomain() || $c->getPorts() != $cookie->getPorts() || $c->getName() != $cookie->getName() ) { continue; } // The previously set cookie is a discard cookie and this one is not so allow the new cookie to be set if (!$cookie->getDiscard() && $c->getDiscard()) { unset($this->cookies[$i]); continue; } // If the new cookie's expiration is further into the future, then replace the old cookie if ($cookie->getExpires() > $c->getExpires()) { unset($this->cookies[$i]); continue; } // If the value has changed, we better change it if ($cookie->getValue() !== $c->getValue()) { unset($this->cookies[$i]); continue; } // The cookie exists, so no need to continue return false; } $this->cookies[] = $cookie; return true; } /** * Serializes the cookie cookieJar * * @return string */ public function serialize() { // Only serialize long term cookies and unexpired cookies return json_encode(array_map(function (Cookie $cookie) { return $cookie->toArray(); }, $this->all(null, null, null, true, true))); } /** * Unserializes the cookie cookieJar */ public function unserialize($data) { $data = json_decode($data, true); if (empty($data)) { $this->cookies = array(); } else { $this->cookies = array_map(function (array $cookie) { return new Cookie($cookie); }, $data); } } /** * Returns the total number of stored cookies * * @return int */ public function count() { return count($this->cookies); } /** * Returns an iterator * * @return \ArrayIterator */ public function getIterator() { return new \ArrayIterator($this->cookies); } /** * {@inheritdoc} */ public function addCookiesFromResponse(Response $response) { if ($cookieHeader = $response->getSetCookie()) { $request = $response->getRequest(); $parser = ParserRegistry::getInstance()->getParser('cookie'); foreach ($cookieHeader as $cookie) { if ($parsed = $request ? $parser->parseCookie($cookie, $request->getHost(), $request->getPath()) : $parser->parseCookie($cookie) ) { // Break up cookie v2 into multiple cookies foreach ($parsed['cookies'] as $key => $value) { $row = $parsed; $row['name'] = $key; $row['value'] = $value; unset($row['cookies']); $this->add(new Cookie($row)); } } } } } /** * {@inheritdoc} */ public function getMatchingCookies(RequestInterface $request) { // Find cookies that match this request $cookies = $this->all($request->getHost(), $request->getPath()); // Remove ineligible cookies foreach ($cookies as $index => $cookie) { if (!$cookie->matchesPort($request->getPort()) || ($cookie->getSecure() && $request->getScheme() != 'https')) { unset($cookies[$index]); } }; return $cookies; } } src/Guzzle/Plugin/Cookie/CookieJar/CookieJarInterface.php000064400000005364151742734620017353 0ustar00filename = $cookieFile; $this->load(); } /** * Saves the file when shutting down */ public function __destruct() { $this->persist(); } /** * Save the contents of the data array to the file * * @throws RuntimeException if the file cannot be found or created */ protected function persist() { if (false === file_put_contents($this->filename, $this->serialize())) { // @codeCoverageIgnoreStart throw new RuntimeException('Unable to open file ' . $this->filename); // @codeCoverageIgnoreEnd } } /** * Load the contents of the json formatted file into the data array and discard any unsaved state */ protected function load() { $json = file_get_contents($this->filename); if (false === $json) { // @codeCoverageIgnoreStart throw new RuntimeException('Unable to open file ' . $this->filename); // @codeCoverageIgnoreEnd } $this->unserialize($json); $this->cookies = $this->cookies ?: array(); } } src/Guzzle/Plugin/Cookie/CookiePlugin.php000064400000003647151742734620014410 0ustar00cookieJar = $cookieJar ?: new ArrayCookieJar(); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array( 'request.before_send' => array('onRequestBeforeSend', 125), 'request.sent' => array('onRequestSent', 125) ); } /** * Get the cookie cookieJar * * @return CookieJarInterface */ public function getCookieJar() { return $this->cookieJar; } /** * Add cookies before a request is sent * * @param Event $event */ public function onRequestBeforeSend(Event $event) { $request = $event['request']; if (!$request->getParams()->get('cookies.disable')) { $request->removeHeader('Cookie'); // Find cookies that match this request foreach ($this->cookieJar->getMatchingCookies($request) as $cookie) { $request->addCookie($cookie->getName(), $cookie->getValue()); } } } /** * Extract cookies from a sent request * * @param Event $event */ public function onRequestSent(Event $event) { $this->cookieJar->addCookiesFromResponse($event['response']); } } src/Guzzle/Plugin/Cookie/Exception/InvalidCookieException.php000064400000000252151742734620020342 0ustar00=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Cookie": "" } }, "target-dir": "Guzzle/Plugin/Cookie", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/CurlAuth/CurlAuthPlugin.php000064400000002210151742734620015225 0ustar00username = $username; $this->password = $password; $this->scheme = $scheme; } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array('client.create_request' => array('onRequestCreate', 255)); } /** * Add basic auth * * @param Event $event */ public function onRequestCreate(Event $event) { $event['request']->setAuth($this->username, $this->password, $this->scheme); } } src/Guzzle/Plugin/CurlAuth/composer.json000064400000001262151742734620014336 0ustar00{ "name": "guzzle/plugin-curlauth", "description": "Guzzle cURL authorization plugin", "homepage": "http://guzzlephp.org/", "keywords": ["plugin", "curl", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\CurlAuth": "" } }, "target-dir": "Guzzle/Plugin/CurlAuth", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/ErrorResponse/ErrorResponseExceptionInterface.php000064400000001126151742734620021715 0ustar00 array('onCommandBeforeSend', -1)); } /** * Adds a listener to requests before they sent from a command * * @param Event $event Event emitted */ public function onCommandBeforeSend(Event $event) { $command = $event['command']; if ($operation = $command->getOperation()) { if ($operation->getErrorResponses()) { $request = $command->getRequest(); $request->getEventDispatcher() ->addListener('request.complete', $this->getErrorClosure($request, $command, $operation)); } } } /** * @param RequestInterface $request Request that received an error * @param CommandInterface $command Command that created the request * @param Operation $operation Operation that defines the request and errors * * @return \Closure Returns a closure */ protected function getErrorClosure(RequestInterface $request, CommandInterface $command, Operation $operation) { return function (Event $event) use ($request, $command, $operation) { $response = $event['response']; foreach ($operation->getErrorResponses() as $error) { if (!isset($error['class'])) { continue; } if (isset($error['code']) && $response->getStatusCode() != $error['code']) { continue; } if (isset($error['reason']) && $response->getReasonPhrase() != $error['reason']) { continue; } $className = $error['class']; $errorClassInterface = __NAMESPACE__ . '\\ErrorResponseExceptionInterface'; if (!class_exists($className)) { throw new ErrorResponseException("{$className} does not exist");; } elseif (!is_subclass_of($className, $errorClassInterface)) { throw new ErrorResponseException("{$className} must implement {$errorClassInterface}"); } throw $className::fromCommand($command, $response); } }; } } src/Guzzle/Plugin/ErrorResponse/Exception/ErrorResponseException.php000064400000000241151742734620022027 0ustar00=5.3.2", "guzzle/service": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\ErrorResponse": "" } }, "target-dir": "Guzzle/Plugin/ErrorResponse", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/History/HistoryPlugin.php000064400000005161151742734620015061 0ustar00 'onRequestComplete'); } /** * Add a request to the history * * @param RequestInterface $request Request to add * * @return HistoryPlugin */ public function add(RequestInterface $request) { if ($request->getResponse()) { $this->requests[] = $request; if (count($this->requests) > $this->getlimit()) { array_shift($this->requests); } } return $this; } /** * Set the max number of requests to store * * @param int $limit Limit * * @return HistoryPlugin */ public function setLimit($limit) { $this->limit = (int) $limit; return $this; } /** * Get the request limit * * @return int */ public function getLimit() { return $this->limit; } /** * Get the requests in the history * * @return \ArrayIterator */ public function getIterator() { return new \ArrayIterator($this->requests); } /** * Get the number of requests in the history * * @return int */ public function count() { return count($this->requests); } /** * Get the last request sent * * @return RequestInterface */ public function getLastRequest() { return end($this->requests); } /** * Get the last response in the history * * @return Response */ public function getLastResponse() { return $this->getLastRequest()->getResponse(); } /** * Clears the history * * @return HistoryPlugin */ public function clear() { $this->requests = array(); return $this; } /** * {@inheritdoc} */ public function onRequestComplete(Event $event) { $this->add($event['request']); } } src/Guzzle/Plugin/History/composer.json000064400000001234151742734620014247 0ustar00{ "name": "guzzle/plugin-history", "description": "Guzzle history plugin", "homepage": "http://guzzlephp.org/", "keywords": ["plugin", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\History": "" } }, "target-dir": "Guzzle/Plugin/History", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Log/LogPlugin.php000064400000013233151742734620013220 0ustar00logAdapter = $logAdapter; $this->formatter = $formatter instanceof MessageFormatter ? $formatter : new MessageFormatter($formatter); $this->wireBodies = $wireBodies; } /** * Get a log plugin that outputs full request, response, and curl error information to stderr * * @param bool $wireBodies Set to false to disable request/response body output when they use are not repeatable * @param resource $stream Stream to write to when logging * * @return self */ public static function getDebugPlugin($wireBodies = true, $stream = STDERR) { return new self(new ClosureLogAdapter(function ($m) use ($stream) { fwrite($stream, $m . PHP_EOL); }), "# Request:\n{request}\n\n# Response:\n{response}\n\n# Errors: {curl_code} {curl_error}", $wireBodies); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array( 'curl.callback.write' => array('onCurlWrite', 255), 'curl.callback.read' => array('onCurlRead', 255), 'request.before_send' => array('onRequestBeforeSend', 255), 'request.sent' => array('onRequestSent', 255) ); } /** * Event triggered when curl data is read from a request * * @param Event $event */ public function onCurlRead(Event $event) { // Stream the request body to the log if the body is not repeatable if ($wire = $event['request']->getParams()->get('request_wire')) { $wire->write($event['read']); } } /** * Event triggered when curl data is written to a response * * @param Event $event */ public function onCurlWrite(Event $event) { // Stream the response body to the log if the body is not repeatable if ($wire = $event['request']->getParams()->get('response_wire')) { $wire->write($event['write']); } } /** * Called before a request is sent * * @param Event $event */ public function onRequestBeforeSend(Event $event) { if ($this->wireBodies) { $request = $event['request']; // Ensure that curl IO events are emitted $request->getCurlOptions()->set('emit_io', true); // We need to make special handling for content wiring and non-repeatable streams. if ($request instanceof EntityEnclosingRequestInterface && $request->getBody() && (!$request->getBody()->isSeekable() || !$request->getBody()->isReadable()) ) { // The body of the request cannot be recalled so logging the body will require us to buffer it $request->getParams()->set('request_wire', EntityBody::factory()); } if (!$request->isResponseBodyRepeatable()) { // The body of the response cannot be recalled so logging the body will require us to buffer it $request->getParams()->set('response_wire', EntityBody::factory()); } } } /** * Triggers the actual log write when a request completes * * @param Event $event */ public function onRequestSent(Event $event) { $request = $event['request']; $response = $event['response']; $handle = $event['handle']; if ($wire = $request->getParams()->get('request_wire')) { $request = clone $request; $request->setBody($wire); } if ($wire = $request->getParams()->get('response_wire')) { $response = clone $response; $response->setBody($wire); } // Send the log message to the adapter, adding a category and host $priority = $response && !$response->isSuccessful() ? LOG_ERR : LOG_DEBUG; $message = $this->formatter->format($request, $response, $handle); $this->logAdapter->log($message, $priority, array( 'request' => $request, 'response' => $response, 'handle' => $handle )); } } src/Guzzle/Plugin/Log/composer.json000064400000001323151742734620013326 0ustar00{ "name": "guzzle/plugin-log", "description": "Guzzle log plugin for over the wire logging", "homepage": "http://guzzlephp.org/", "keywords": ["plugin", "log", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version", "guzzle/log": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Log": "" } }, "target-dir": "Guzzle/Plugin/Log", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Md5/CommandContentMd5Plugin.php000064400000004272151742734620015665 0ustar00contentMd5Param = $contentMd5Param; $this->validateMd5Param = $validateMd5Param; } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array('command.before_send' => array('onCommandBeforeSend', -255)); } /** * {@inheritdoc} */ public function onCommandBeforeSend(Event $event) { $command = $event['command']; $request = $command->getRequest(); // Only add an MD5 is there is a MD5 option on the operation and it has a payload if ($request instanceof EntityEnclosingRequestInterface && $request->getBody() && $command->getOperation()->hasParam($this->contentMd5Param)) { // Check if an MD5 checksum value should be passed along to the request if ($command[$this->contentMd5Param] === true) { $request->setHeader('Content-MD5', $request->getBody()->getContentMd5(true, true)); } } // Check if MD5 validation should be used with the response if ($command[$this->validateMd5Param] === true) { $request->addSubscriber(new Md5ValidatorPlugin(true, false)); } } } src/Guzzle/Plugin/Md5/Md5ValidatorPlugin.php000064400000006756151742734620014712 0ustar00contentLengthCutoff = $contentLengthCutoff; $this->contentEncoded = $contentEncoded; } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array('request.complete' => array('onRequestComplete', 255)); } /** * {@inheritdoc} * @throws UnexpectedValueException */ public function onRequestComplete(Event $event) { $response = $event['response']; if (!$contentMd5 = $response->getContentMd5()) { return; } $contentEncoding = $response->getContentEncoding(); if ($contentEncoding && !$this->contentEncoded) { return false; } // Make sure that the size of the request is under the cutoff size if ($this->contentLengthCutoff) { $size = $response->getContentLength() ?: $response->getBody()->getSize(); if (!$size || $size > $this->contentLengthCutoff) { return; } } if (!$contentEncoding) { $hash = $response->getBody()->getContentMd5(); } elseif ($contentEncoding == 'gzip') { $response->getBody()->compress('zlib.deflate'); $hash = $response->getBody()->getContentMd5(); $response->getBody()->uncompress(); } elseif ($contentEncoding == 'compress') { $response->getBody()->compress('bzip2.compress'); $hash = $response->getBody()->getContentMd5(); $response->getBody()->uncompress(); } else { return; } if ($contentMd5 !== $hash) { throw new UnexpectedValueException( "The response entity body may have been modified over the wire. The Content-MD5 " . "received ({$contentMd5}) did not match the calculated MD5 hash ({$hash})." ); } } } src/Guzzle/Plugin/Md5/composer.json000064400000001215151742734620013232 0ustar00{ "name": "guzzle/plugin-md5", "description": "Guzzle MD5 plugins", "homepage": "http://guzzlephp.org/", "keywords": ["plugin", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Md5": "" } }, "target-dir": "Guzzle/Plugin/Md5", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Mock/MockPlugin.php000064400000013111151742734620013533 0ustar00readBodies = $readBodies; $this->temporary = $temporary; if ($responses) { foreach ($responses as $response) { $this->addResponse($response); } } } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array('client.create_request' => 'onRequestCreate'); } /** * {@inheritdoc} */ public static function getAllEvents() { return array('mock.request'); } /** * Get a mock response from a file * * @param string $file File to retrieve a mock response from * * @return Response * @throws InvalidArgumentException if the file is not found */ public static function getMockFile($path) { if (!file_exists($path)) { throw new InvalidArgumentException('Unable to open mock file: ' . $path); } return Response::fromMessage(file_get_contents($path)); } /** * Set whether or not to consume the entity body of a request when a mock * response is used * * @param bool $consumeBody Set to true to read and consume entity bodies * * @return self */ public function readBodies($readBodies) { $this->readBodies = $readBodies; return $this; } /** * Returns the number of remaining mock responses * * @return int */ public function count() { return count($this->queue); } /** * Add a response to the end of the queue * * @param string|Response $response Response object or path to response file * * @return MockPlugin * @throws InvalidArgumentException if a string or Response is not passed */ public function addResponse($response) { if (!($response instanceof Response)) { if (!is_string($response)) { throw new InvalidArgumentException('Invalid response'); } $response = self::getMockFile($response); } $this->queue[] = $response; return $this; } /** * Clear the queue * * @return MockPlugin */ public function clearQueue() { $this->queue = array(); return $this; } /** * Returns an array of mock responses remaining in the queue * * @return array */ public function getQueue() { return $this->queue; } /** * Check if this is a temporary plugin * * @return bool */ public function isTemporary() { return $this->temporary; } /** * Get a response from the front of the list and add it to a request * * @param RequestInterface $request Request to mock * * @return MockPlugin */ public function dequeue(RequestInterface $request) { $this->dispatch('mock.request', array( 'plugin' => $this, 'request' => $request )); $request->setResponse(array_shift($this->queue), true); if ($this->readBodies && $request instanceof EntityEnclosingRequestInterface) { $request->getEventDispatcher()->addListener('request.sent', function (Event $event) { while ($data = $event['request']->getBody()->read(8096)); }); } return $this; } /** * Clear the array of received requests */ public function flush() { $this->received = array(); } /** * Get an array of requests that were mocked by this plugin * * @return array */ public function getReceivedRequests() { return $this->received; } /** * Called when a request completes * * @param Event $event */ public function onRequestCreate(Event $event) { if (!empty($this->queue)) { $request = $event['request']; $this->dequeue($request); $this->received[] = $request; // Detach the filter from the client so it's a one-time use if ($this->temporary && empty($this->queue) && $request->getClient()) { $request->getClient()->getEventDispatcher()->removeSubscriber($this); } } } } src/Guzzle/Plugin/Mock/composer.json000064400000001230151742734620013473 0ustar00{ "name": "guzzle/plugin-mock", "description": "Guzzle Mock plugin", "homepage": "http://guzzlephp.org/", "keywords": ["mock", "plugin", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Mock": "" } }, "target-dir": "Guzzle/Plugin/Mock", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/Oauth/OauthPlugin.php000064400000021174151742734620014121 0ustar00config = Collection::fromConfig($config, array( 'version' => '1.0', 'consumer_key' => 'anonymous', 'consumer_secret' => 'anonymous', 'signature_method' => 'HMAC-SHA1', 'signature_callback' => function($stringToSign, $key) { return hash_hmac('sha1', $stringToSign, $key, true); } ), array( 'signature_method', 'signature_callback', 'version', 'consumer_key', 'consumer_secret' )); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return array( 'request.before_send' => array('onRequestBeforeSend', -1000) ); } /** * Request before-send event handler * * @param Event $event Event received * @return array */ public function onRequestBeforeSend(Event $event) { $timestamp = $this->getTimestamp($event); $request = $event['request']; $nonce = $this->generateNonce($request); $authorizationParams = array( 'oauth_callback' => $this->config['callback'], 'oauth_consumer_key' => $this->config['consumer_key'], 'oauth_nonce' => $nonce, 'oauth_signature' => $this->getSignature($request, $timestamp, $nonce), 'oauth_signature_method' => $this->config['signature_method'], 'oauth_timestamp' => $timestamp, 'oauth_token' => $this->config['token'], 'oauth_version' => $this->config['version'], ); $request->setHeader( 'Authorization', $this->buildAuthorizationHeader($authorizationParams) ); return $authorizationParams; } /** * Builds the Authorization header for a request * * @param array $authorizationParams Associative array of authorization parameters * * @return string */ private function buildAuthorizationHeader($authorizationParams) { $authorizationString = 'OAuth '; foreach ($authorizationParams as $key => $val) { if ($val) { $authorizationString .= $key . '="' . urlencode($val) . '", '; } } return substr($authorizationString, 0, -2); } /** * Calculate signature for request * * @param RequestInterface $request Request to generate a signature for * @param integer $timestamp Timestamp to use for nonce * @param string $nonce * * @return string */ public function getSignature(RequestInterface $request, $timestamp, $nonce) { $string = $this->getStringToSign($request, $timestamp, $nonce); $key = urlencode($this->config['consumer_secret']) . '&' . urlencode($this->config['token_secret']); return base64_encode(call_user_func($this->config['signature_callback'], $string, $key)); } /** * Calculate string to sign * * @param RequestInterface $request Request to generate a signature for * @param int $timestamp Timestamp to use for nonce * @param string $nonce * * @return string */ public function getStringToSign(RequestInterface $request, $timestamp, $nonce) { $params = $this->getParamsToSign($request, $timestamp, $nonce); // Convert booleans to strings. $params = $this->prepareParameters($params); // Build signing string from combined params $parameterString = new QueryString($params); $url = Url::factory($request->getUrl())->setQuery('')->setFragment(null); return strtoupper($request->getMethod()) . '&' . rawurlencode($url) . '&' . rawurlencode((string) $parameterString); } /** * Parameters sorted and filtered in order to properly sign a request * * @param RequestInterface $request Request to generate a signature for * @param integer $timestamp Timestamp to use for nonce * @param string $nonce * * @return array */ public function getParamsToSign(RequestInterface $request, $timestamp, $nonce) { $params = new Collection(array( 'oauth_consumer_key' => $this->config['consumer_key'], 'oauth_nonce' => $nonce, 'oauth_signature_method' => $this->config['signature_method'], 'oauth_timestamp' => $timestamp, 'oauth_version' => $this->config['version'] )); // Filter out oauth_token during temp token step, as in request_token. if ($this->config['token']) { $params->add('oauth_token', $this->config['token']); } // Add query string parameters $params->merge($request->getQuery()); // Add POST fields to signing string if required if ($this->shouldPostFieldsBeSigned($request)) { $params->merge($request->getPostFields()); } // Sort params $params = $params->getAll(); ksort($params); return $params; } /** * Decide whether the post fields should be added to the base string that Oauth signs. * This implementation is correct. Non-conformant APIs may require that this method be * overwritten e.g. the Flickr API incorrectly adds the post fields when the Content-Type * is 'application/x-www-form-urlencoded' * * @param $request * @return bool Whether the post fields should be signed or not */ public function shouldPostFieldsBeSigned($request) { if (!$this->config->get('disable_post_params') && $request instanceof EntityEnclosingRequestInterface && (string) $request->getHeader('Content-Type') == 'application/x-www-form-urlencoded') { return true; } return false; } /** * Returns a Nonce Based on the unique id and URL. This will allow for multiple requests in parallel with the same * exact timestamp to use separate nonce's. * * @param RequestInterface $request Request to generate a nonce for * * @return string */ public function generateNonce(RequestInterface $request) { return sha1(uniqid('', true) . $request->getUrl()); } /** * Gets timestamp from event or create new timestamp * * @param Event $event Event containing contextual information * * @return int */ public function getTimestamp(Event $event) { return $event['timestamp'] ?: time(); } /** * Convert booleans to strings, removed unset parameters, and sorts the array * * @param array $data Data array * * @return array */ protected function prepareParameters($data) { ksort($data); foreach ($data as $key => &$value) { switch (gettype($value)) { case 'NULL': unset($data[$key]); break; case 'array': $data[$key] = self::prepareParameters($value); break; case 'boolean': $data[$key] = $value ? 'true' : 'false'; break; } } return $data; } } src/Guzzle/Plugin/Oauth/composer.json000064400000001235151742734620013667 0ustar00{ "name": "guzzle/plugin-oauth", "description": "Guzzle OAuth plugin", "homepage": "http://guzzlephp.org/", "keywords": ["oauth", "plugin", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin\\Oauth": "" } }, "target-dir": "Guzzle/Plugin/Oauth", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Plugin/composer.json000064400000002524151742734620012611 0ustar00{ "name": "guzzle/plugin", "description": "Guzzle plugin component containing all Guzzle HTTP plugins", "homepage": "http://guzzlephp.org/", "keywords": ["http", "client", "plugin", "extension", "guzzle"], "license": "MIT", "authors": [ { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" } ], "require": { "php": ">=5.3.2", "guzzle/http": "self.version" }, "suggest": { "guzzle/cache": "self.version", "guzzle/log": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Plugin": "" } }, "target-dir": "Guzzle/Plugin", "replace": { "guzzle/plugin-async": "self.version", "guzzle/plugin-backoff": "self.version", "guzzle/plugin-cache": "self.version", "guzzle/plugin-cookie": "self.version", "guzzle/plugin-curlauth": "self.version", "guzzle/plugin-error-response": "self.version", "guzzle/plugin-history": "self.version", "guzzle/plugin-log": "self.version", "guzzle/plugin-md5": "self.version", "guzzle/plugin-mock": "self.version", "guzzle/plugin-oauth": "self.version" }, "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Service/AbstractConfigLoader.php000064400000011432151742734620014760 0ustar00loadedFiles = array(); if (is_string($config)) { $config = $this->loadFile($config); } elseif (!is_array($config)) { throw new InvalidArgumentException('Unknown type passed to configuration loader: ' . gettype($config)); } else { $this->mergeIncludes($config); } return $this->build($config, $options); } /** * Add an include alias to the loader * * @param string $filename Filename to alias (e.g. _foo) * @param string $alias Actual file to use (e.g. /path/to/foo.json) * * @return self */ public function addAlias($filename, $alias) { $this->aliases[$filename] = $alias; return $this; } /** * Remove an alias from the loader * * @param string $alias Alias to remove * * @return self */ public function removeAlias($alias) { unset($this->aliases[$alias]); return $this; } /** * Perform the parsing of a config file and create the end result * * @param array $config Configuration data * @param array $options Options to use when building * * @return mixed */ protected abstract function build($config, array $options); /** * Load a configuration file (can load JSON or PHP files that return an array when included) * * @param string $filename File to load * * @return array * @throws InvalidArgumentException * @throws RuntimeException when the JSON cannot be parsed */ protected function loadFile($filename) { if (isset($this->aliases[$filename])) { $filename = $this->aliases[$filename]; } if (!is_readable($filename)) { throw new InvalidArgumentException("Unable to open {$filename} for reading"); } $ext = pathinfo($filename, PATHINFO_EXTENSION); if ($ext == 'js' || $ext == 'json') { $config = json_decode(file_get_contents($filename), true); // Throw an exception if there was an error loading the file if ($error = json_last_error()) { throw new RuntimeException("Error loading JSON data from {$filename}: {$error}"); } } elseif ($ext == 'php') { $config = require $filename; if (!is_array($config)) { throw new InvalidArgumentException('PHP files must return an array of configuration data'); } } else { throw new InvalidArgumentException('Unknown file extension: ' . $filename); } // Keep track of this file being loaded to prevent infinite recursion $this->loadedFiles[$filename] = true; // Merge include files into the configuration array $this->mergeIncludes($config, dirname($filename)); return $config; } /** * Merges in all include files * * @param array $config Config data that contains includes * @param string $basePath Base path to use when a relative path is encountered * * @return array Returns the merged and included data */ protected function mergeIncludes(&$config, $basePath = null) { if (!empty($config['includes'])) { foreach ($config['includes'] as &$path) { // Account for relative paths if ($path[0] != DIRECTORY_SEPARATOR && !isset($this->aliases[$path]) && $basePath) { $path = "{$basePath}/{$path}"; } // Don't load the same files more than once if (!isset($this->loadedFiles[$path])) { $this->loadedFiles[$path] = true; $config = $this->mergeData($this->loadFile($path), $config); } } } } /** * Default implementation for merging two arrays of data (uses array_merge_recursive) * * @param array $a Original data * @param array $b Data to merge into the original and overwrite existing values * * @return array */ protected function mergeData(array $a, array $b) { return array_merge_recursive($a, $b); } } src/Guzzle/Service/Builder/ServiceBuilder.php000064400000014556151742734620015247 0ustar00load($config, $globalParameters); } /** * Construct a new service builder * * @param array $serviceBuilderConfig Service configuration settings: * - name: Name of the service * - class: Client class to instantiate using a factory method * - params: array of key value pair configuration settings for the builder */ public function __construct(array $serviceBuilderConfig) { $this->builderConfig = $serviceBuilderConfig; } /** * {@inheritdoc} */ public static function getAllEvents() { return array('service_builder.create_client'); } /** * Restores the service builder from JSON * * @param string $serialized JSON data to restore from */ public function unserialize($serialized) { $this->builderConfig = json_decode($serialized, true); } /** * Represents the service builder as a string * * @return array */ public function serialize() { return json_encode($this->builderConfig); } /** * Attach a plugin to every client created by the builder * * @param EventSubscriberInterface $plugin Plugin to attach to each client * * @return self */ public function addGlobalPlugin(EventSubscriberInterface $plugin) { $this->plugins[] = $plugin; return $this; } /** * Get data from the service builder without triggering the building of a service * * @param string $name Name of the service to retrieve * * @return array|null */ public function getData($name) { return isset($this->builderConfig[$name]) ? $this->builderConfig[$name] : null; } /** * {@inheritdoc} */ public function get($name, $throwAway = false) { if (!isset($this->builderConfig[$name])) { // Check aliases and return a match if found foreach ($this->builderConfig as $actualName => $config) { if (isset($config['alias']) && $config['alias'] == $name) { return $this->get($actualName, $throwAway); } } throw new ServiceNotFoundException('No service is registered as ' . $name); } if (!$throwAway && isset($this->clients[$name])) { return $this->clients[$name]; } // Convert references to the actual client foreach ($this->builderConfig[$name]['params'] as &$v) { if (is_string($v) && substr($v, 0, 1) == '{' && substr($v, -1) == '}') { $v = $this->get(trim(trim($v, '{}'))); } } // Get the configured parameters and merge in any parameters provided for throw-away clients $config = $this->builderConfig[$name]['params']; if (is_array($throwAway)) { $config = $throwAway + $config; } $class = $this->builderConfig[$name]['class']; $client = $class::factory($config); if (!$throwAway) { $this->clients[$name] = $client; } foreach ($this->plugins as $plugin) { $client->addSubscriber($plugin); } // Dispatch an event letting listeners know a client was created $this->dispatch('service_builder.create_client', array('client' => $client)); return $client; } /** * {@inheritdoc} */ public function set($key, $service) { $this->builderConfig[$key] = $service; return $this; } /** * Register a client by name with the service builder * * @param string $offset Name of the client to register * @param ClientInterface $value Client to register */ public function offsetSet($offset, $value) { $this->set($offset, $value); } /** * Remove a registered client by name * * @param string $offset Client to remove by name */ public function offsetUnset($offset) { unset($this->builderConfig[$offset]); } /** * Check if a client is registered with the service builder by name * * @param string $offset Name to check to see if a client exists * * @return bool */ public function offsetExists($offset) { return isset($this->builderConfig[$offset]); } /** * Get a registered client by name * * @param string $offset Registered client name to retrieve * * @return ClientInterface */ public function offsetGet($offset) { return $this->get($offset); } } src/Guzzle/Service/Builder/ServiceBuilderInterface.php000064400000002123151742734620017053 0ustar00 &$service) { $service['params'] = isset($service['params']) ? $service['params'] : array(); // Check if this client builder extends another client if (!empty($service['extends'])) { // Make sure that the service it's extending has been defined if (!isset($services[$service['extends']])) { throw new ServiceNotFoundException( "{$name} is trying to extend a non-existent service: {$service['extends']}" ); } $extended = &$services[$service['extends']]; // Use the correct class attribute if (empty($service['class'])) { $service['class'] = isset($extended['class']) ? $extended['class'] : ''; } if ($extendsParams = isset($extended['params']) ? $extended['params'] : false) { $service['params'] = $service['params'] + $extendsParams; } } // Overwrite default values with global parameter values if (!empty($options)) { $service['params'] = $options + $service['params']; } $service['class'] = isset($service['class']) ? $service['class'] : ''; } return new $class($services); } /** * {@inheritdoc} */ protected function mergeData(array $a, array $b) { $result = $b + $a; // Merge services using a recursive union of arrays if (isset($a['services']) && $b['services']) { // Get a union of the services of the two arrays $result['services'] = $b['services'] + $a['services']; // Merge each service in using a union of the two arrays foreach ($result['services'] as $name => &$service) { // By default, services completely override a previously defined service unless it extends itself if (isset($a['services'][$name]['extends']) && isset($b['services'][$name]['extends']) && $b['services'][$name]['extends'] == $name ) { $service += $a['services'][$name]; // Use the `extends` attribute of the parent $service['extends'] = $a['services'][$name]['extends']; // Merge parameters using a union if both have parameters if (isset($a['services'][$name]['params'])) { $service['params'] += $a['services'][$name]['params']; } } } } return $result; } } src/Guzzle/Service/CachingConfigLoader.php000064400000002376151742734620014560 0ustar00loader = $loader; $this->cache = $cache; } /** * {@inheritdoc} */ public function load($config, array $options = array()) { if (!is_string($config)) { $key = false; } else { $key = 'loader_' . crc32($config); if ($result = $this->cache->fetch($key)) { return $result; } } $result = $this->loader->load($config, $options); if ($key) { $this->cache->save($key, $result); } return $result; } } src/Guzzle/Service/Client.php000064400000022073151742734620012161 0ustar00enableMagicMethods) { throw new BadMethodCallException("Missing method {$method}. This client has not enabled magic methods."); } return $this->getCommand($method, isset($args[0]) ? $args[0] : array())->getResult(); } /** * Specify whether or not magic methods are enabled (disabled by default) * * @param bool $isEnabled Set to true to enable magic methods or false to disable them * * @return self */ public function enableMagicMethods($isEnabled) { $this->enableMagicMethods = $isEnabled; return $this; } /** * {@inheritdoc} */ public function getCommand($name, array $args = array()) { if (!($command = $this->getCommandFactory()->factory($name, $args))) { throw new InvalidArgumentException("Command was not found matching {$name}"); } $command->setClient($this); // Add global client options to the command if ($command instanceof Collection) { if ($options = $this->getConfig(self::COMMAND_PARAMS)) { foreach ($options as $key => $value) { if (!$command->hasKey($key)) { $command->set($key, $value); } } } } $this->dispatch('client.command.create', array( 'client' => $this, 'command' => $command )); return $command; } /** * {@inheritdoc} */ public function setCommandFactory(CommandFactoryInterface $factory) { $this->commandFactory = $factory; return $this; } /** * {@inheritdoc} */ public function setResourceIteratorFactory(ResourceIteratorFactoryInterface $factory) { $this->resourceIteratorFactory = $factory; return $this; } /** * {@inheritdoc} */ public function getIterator($command, array $commandOptions = null, array $iteratorOptions = array()) { if (!($command instanceof CommandInterface)) { $command = $this->getCommand($command, $commandOptions ?: array()); } return $this->getResourceIteratorFactory()->build($command, $iteratorOptions); } /** * {@inheritdoc} */ public function execute($command) { if ($command instanceof CommandInterface) { $command = array($command); $singleCommand = true; } elseif (is_array($command)) { $singleCommand = false; } else { throw new InvalidArgumentException('Command must be a command or array of commands'); } $failureException = null; $requests = array(); $successful = new \SplObjectStorage(); foreach ($command as $c) { $c->setClient($this); // Set the state to new if the command was previously executed $request = $c->prepare()->setState(RequestInterface::STATE_NEW); $successful[$request] = $c; $requests[] = $request; $this->dispatch('command.before_send', array('command' => $c)); } try { $this->send($requests); } catch (MultiTransferException $failureException) { $failures = new \SplObjectStorage(); // Remove failed requests from the successful requests array and add to the failures array foreach ($failureException->getFailedRequests() as $request) { if (isset($successful[$request])) { $failures[$request] = $successful[$request]; unset($successful[$request]); } } } foreach ($successful as $success) { $this->dispatch('command.after_send', array('command' => $successful[$success])); } // Return the response or throw an exception if (!$failureException) { return $singleCommand ? end($command)->getResult() : $command; } elseif ($singleCommand) { // If only sending a single request, then don't use a CommandTransferException throw $failureException->getFirst(); } else { // Throw a CommandTransferException using the successful and failed commands $e = CommandTransferException::fromMultiTransferException($failureException); foreach ($failures as $failure) { $e->addFailedCommand($failures[$failure]); } foreach ($successful as $success) { $e->addSuccessfulCommand($successful[$success]); } throw $e; } } /** * {@inheritdoc} */ public function setDescription(ServiceDescriptionInterface $service) { $this->serviceDescription = $service; // If a baseUrl was set on the description, then update the client if ($baseUrl = $service->getBaseUrl()) { $this->setBaseUrl($baseUrl); } return $this; } /** * {@inheritdoc} */ public function getDescription() { return $this->serviceDescription; } /** * {@inheritdoc} */ public function setInflector(InflectorInterface $inflector) { $this->inflector = $inflector; return $this; } /** * {@inheritdoc} */ public function getInflector() { if (!$this->inflector) { $this->inflector = Inflector::getDefault(); } return $this->inflector; } /** * {@inheritdoc} */ protected function getResourceIteratorFactory() { if (!$this->resourceIteratorFactory) { // Build the default resource iterator factory if one is not set $clientClass = get_class($this); $prefix = substr($clientClass, 0, strrpos($clientClass, '\\')); $this->resourceIteratorFactory = new ResourceIteratorClassFactory(array( "{$prefix}\\Iterator", "{$prefix}\\Model" )); } return $this->resourceIteratorFactory; } /** * Get the command factory associated with the client * * @return CommandFactoryInterface */ protected function getCommandFactory() { if (!$this->commandFactory) { $this->commandFactory = CompositeFactory::getDefaultChain($this); } return $this->commandFactory; } } src/Guzzle/Service/ClientInterface.php000064400000007302151742734620014000 0ustar00operation = $operation ?: $this->createOperation(); foreach ($this->operation->getParams() as $name => $arg) { $currentValue = $this->get($name); $configValue = $arg->getValue($currentValue); // If default or static values are set, then this should always be updated on the config object if ($currentValue !== $configValue) { $this->set($name, $configValue); } } $headers = $this->get(self::HEADERS_OPTION); if (!$headers instanceof Collection) { $this->set(self::HEADERS_OPTION, new Collection((array) $headers)); } // You can set a command.on_complete option in your parameters to set an onComplete callback if ($onComplete = $this->get('command.on_complete')) { $this->remove('command.on_complete'); $this->setOnComplete($onComplete); } $this->init(); } /** * Custom clone behavior */ public function __clone() { $this->request = null; $this->result = null; } /** * Execute the command in the same manner as calling a function * * @return mixed Returns the result of {@see AbstractCommand::execute} */ public function __invoke() { return $this->execute(); } /** * {@inheritdoc} */ public function getName() { return $this->operation->getName(); } /** * Get the API command information about the command * * @return OperationInterface */ public function getOperation() { return $this->operation; } /** * {@inheritdoc} */ public function setOnComplete($callable) { if (!is_callable($callable)) { throw new InvalidArgumentException('The onComplete function must be callable'); } $this->onComplete = $callable; return $this; } /** * {@inheritdoc} */ public function execute() { if (!$this->client) { throw new CommandException('A client must be associated with the command before it can be executed.'); } return $this->client->execute($this); } /** * {@inheritdoc} */ public function getClient() { return $this->client; } /** * {@inheritdoc} */ public function setClient(ClientInterface $client) { $this->client = $client; return $this; } /** * {@inheritdoc} */ public function getRequest() { if (!$this->request) { throw new CommandException('The command must be prepared before retrieving the request'); } return $this->request; } /** * {@inheritdoc} */ public function getResponse() { if (!$this->isExecuted()) { $this->execute(); } return $this->request->getResponse(); } /** * {@inheritdoc} */ public function getResult() { if (!$this->isExecuted()) { $this->execute(); } if (null === $this->result) { $this->process(); // Call the onComplete method if one is set if ($this->onComplete) { call_user_func($this->onComplete, $this); } } return $this->result; } /** * {@inheritdoc} */ public function setResult($result) { $this->result = $result; return $this; } /** * {@inheritdoc} */ public function isPrepared() { return $this->request !== null; } /** * {@inheritdoc} */ public function isExecuted() { return $this->request !== null && $this->request->getState() == 'complete'; } /** * {@inheritdoc} */ public function prepare() { if (!$this->isPrepared()) { if (!$this->client) { throw new CommandException('A client must be associated with the command before it can be prepared.'); } // If no response processing value was specified, then attempt to use the highest level of processing if (!$this->hasKey(self::RESPONSE_PROCESSING)) { $this->set(self::RESPONSE_PROCESSING, self::TYPE_MODEL); } // Notify subscribers of the client that the command is being prepared $this->client->dispatch('command.before_prepare', array('command' => $this)); // Fail on missing required arguments, and change parameters via filters $this->validate(); // Delegate to the subclass that implements the build method $this->build(); // Add custom request headers set on the command if ($headers = $this->get(self::HEADERS_OPTION)) { foreach ($headers as $key => $value) { $this->request->setHeader($key, $value); } } // Add any curl options to the request if ($options = $this->get(Client::CURL_OPTIONS)) { $this->request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($options)); } // Set a custom response body if ($responseBody = $this->get(self::RESPONSE_BODY)) { $this->request->setResponseBody($responseBody); } $this->client->dispatch('command.after_prepare', array('command' => $this)); } return $this->request; } /** * Set the validator used to validate and prepare command parameters and nested JSON schemas. If no validator is * set, then the command will validate using the default {@see SchemaValidator}. * * @param ValidatorInterface $validator Validator used to prepare and validate properties against a JSON schema * * @return self */ public function setValidator(ValidatorInterface $validator) { $this->validator = $validator; return $this; } /** * {@inheritdoc} */ public function getRequestHeaders() { return $this->get(self::HEADERS_OPTION); } /** * Initialize the command (hook that can be implemented in subclasses) */ protected function init() {} /** * Create the request object that will carry out the command */ abstract protected function build(); /** * Hook used to create an operation for concrete commands that are not associated with a service description * * @return OperationInterface */ protected function createOperation() { return new Operation(array('name' => get_class($this))); } /** * Create the result of the command after the request has been completed. * Override this method in subclasses to customize this behavior */ protected function process() { $this->result = $this->get(self::RESPONSE_PROCESSING) != self::TYPE_RAW ? DefaultResponseParser::getInstance()->parse($this) : $this->request->getResponse(); } /** * Validate and prepare the command based on the schema and rules defined by the command's Operation object * * @throws ValidationException when validation errors occur */ protected function validate() { // Do not perform request validation/transformation if it is disable if ($this->get(self::DISABLE_VALIDATION)) { return; } $errors = array(); $validator = $this->getValidator(); foreach ($this->operation->getParams() as $name => $schema) { $value = $this->get($name); if (!$validator->validate($schema, $value)) { $errors = array_merge($errors, $validator->getErrors()); } elseif ($value !== $this->get($name)) { // Update the config value if it changed and no validation errors were encountered $this->data[$name] = $value; } } // Validate additional parameters if ($properties = $this->operation->getAdditionalParameters()) { foreach ($this->getAll() as $name => $value) { // It's only additional if it isn't defined in the schema if (!$this->operation->hasParam($name)) { // Always set the name so that error messages are useful $properties->setName($name); if (!$validator->validate($properties, $value)) { $errors = array_merge($errors, $validator->getErrors()); } elseif ($value !== $this->get($name)) { $this->data[$name] = $value; } } } } if (!empty($errors)) { $e = new ValidationException('Validation errors: ' . implode("\n", $errors)); $e->setErrors($errors); throw $e; } } /** * Get the validator used to prepare and validate properties. If no validator has been set on the command, then * the default {@see SchemaValidator} will be used. * * @return ValidatorInterface */ protected function getValidator() { if (!$this->validator) { $this->validator = SchemaValidator::getInstance(); } return $this->validator; } } src/Guzzle/Service/Command/ClosureCommand.php000064400000002447151742734620015237 0ustar00get('closure')) { throw new InvalidArgumentException('A closure must be passed in the parameters array'); } } /** * {@inheritdoc} * @throws UnexpectedValueException If the closure does not return a request */ protected function build() { $closure = $this->get('closure'); /** @var $closure \Closure */ $this->request = $closure($this, $this->operation); if (!$this->request || !$this->request instanceof RequestInterface) { throw new UnexpectedValueException('Closure command did not return a RequestInterface object'); } } } src/Guzzle/Service/Command/CommandInterface.php000064400000006577151742734620015533 0ustar00factory = $factory; } /** * Add a location visitor to the serializer * * @param string $location Location to associate with the visitor * @param RequestVisitorInterface $visitor Visitor to attach * * @return self */ public function addVisitor($location, RequestVisitorInterface $visitor) { $this->factory->addRequestVisitor($location, $visitor); return $this; } /** * {@inheritdoc} */ public function prepare(CommandInterface $command) { $request = $this->createRequest($command); // Keep an array of visitors found in the operation $foundVisitors = array(); $operation = $command->getOperation(); // Add arguments to the request using the location attribute foreach ($operation->getParams() as $name => $arg) { /** @var $arg \Guzzle\Service\Description\Parameter */ $location = $arg->getLocation(); // Skip 'uri' locations because they've already been processed if ($location && $location != 'uri') { // Instantiate visitors as they are detected in the properties if (!isset($foundVisitors[$location])) { $foundVisitors[$location] = $this->factory->getRequestVisitor($location); } // Ensure that a value has been set for this parameter $value = $command->get($name); if ($value !== null) { // Apply the parameter value with the location visitor $foundVisitors[$location]->visit($command, $request, $arg, $value); } } } // Serialize additional parameters if ($additional = $operation->getAdditionalParameters()) { if ($visitor = $this->prepareAdditionalParameters($operation, $command, $request, $additional)) { $foundVisitors[$additional->getLocation()] = $visitor; } } // Call the after method on each visitor found in the operation foreach ($foundVisitors as $visitor) { $visitor->after($command, $request); } return $request; } /** * Serialize additional parameters * * @param OperationInterface $operation Operation that owns the command * @param CommandInterface $command Command to prepare * @param RequestInterface $request Request to serialize * @param Parameter $additional Additional parameters * * @return null|RequestVisitorInterface */ protected function prepareAdditionalParameters( OperationInterface $operation, CommandInterface $command, RequestInterface $request, Parameter $additional ) { if (!($location = $additional->getLocation())) { return; } $visitor = $this->factory->getRequestVisitor($location); foreach ($command->getAll() as $key => $value) { // Ignore values that are null or built-in command options if ($value !== null && $key != 'command.headers' && $key != 'command.response_processing' && !$operation->hasParam($key) ) { $additional->setName($key); $visitor->visit($command, $request, $additional, $value); } } return $visitor; } /** * Create a request for the command and operation * * @param CommandInterface $command Command to create a request for * * @return RequestInterface */ protected function createRequest(CommandInterface $command) { $operation = $command->getOperation(); $client = $command->getClient(); // If the command does not specify a template, then assume the base URL of the client if (!($uri = $operation->getUri())) { return $client->createRequest($operation->getHttpMethod(), $client->getBaseUrl()); } // Get the path values and use the client config settings $variables = array(); foreach ($operation->getParams() as $name => $arg) { if ($arg->getLocation() == 'uri') { if ($command->hasKey($name)) { $variables[$name] = $arg->filter($command->get($name)); if (!is_array($variables[$name])) { $variables[$name] = (string) $variables[$name]; } } } } // Merge the client's base URL with an expanded URI template return $client->createRequest( $operation->getHttpMethod(), (string) Url::factory($client->getBaseUrl()) ->combine(ParserRegistry::getInstance()->getParser('uri_template')->expand($uri, $variables)) ); } } src/Guzzle/Service/Command/DefaultResponseParser.php000064400000003147151742734620016602 0ustar00getRequest()->getResponse(); // Account for hard coded content-type values specified in service descriptions if ($contentType = $command->get('command.expects')) { $response->setHeader('Content-Type', $contentType); } else { $contentType = (string) $response->getHeader('Content-Type'); } return $this->handleParsing($command, $response, $contentType); } /** * {@inheritdoc} */ protected function handleParsing(AbstractCommand $command, Response $response, $contentType) { $result = $response; if ($result->getBody()) { if (stripos($contentType, 'json') !== false) { $result = $result->json(); } if (stripos($contentType, 'xml') !== false) { $result = $result->xml(); } } return $result; } } src/Guzzle/Service/Command/Factory/AliasFactory.php000064400000002235151742734620016307 0ustar00client = $client; $this->aliases = $aliases; } /** * {@inheritdoc} */ public function factory($name, array $args = array()) { if (isset($this->aliases[$name])) { try { return $this->client->getCommand($this->aliases[$name], $args); } catch (InvalidArgumentException $e) { return null; } } } } src/Guzzle/Service/Command/Factory/CompositeFactory.php000064400000010167151742734620017223 0ustar00getDescription()) { $factories[] = new ServiceDescriptionFactory($description); } $factories[] = new ConcreteClassFactory($client); return new self($factories); } /** * @param array $factories Array of command factories */ public function __construct(array $factories = array()) { $this->factories = $factories; } /** * Add a command factory to the chain * * @param FactoryInterface $factory Factory to add * @param string|FactoryInterface $before Insert the new command factory before a command factory class or object * matching a class name. * * @return CompositeFactory */ public function add(FactoryInterface $factory, $before = null) { $pos = null; if ($before) { foreach ($this->factories as $i => $f) { if ($before instanceof FactoryInterface) { if ($f === $before) { $pos = $i; break; } } elseif (is_string($before)) { if ($f instanceof $before) { $pos = $i; break; } } } } if ($pos === null) { $this->factories[] = $factory; } else { array_splice($this->factories, $i, 0, array($factory)); } return $this; } /** * Check if the chain contains a specific command factory * * @param FactoryInterface|string $factory Factory to check * * @return bool */ public function has($factory) { return (bool) $this->find($factory); } /** * Remove a specific command factory from the chain * * @param string|FactoryInterface $factory Factory to remove by name or instance * * @return CompositeFactory */ public function remove($factory = null) { if (!($factory instanceof FactoryInterface)) { $factory = $this->find($factory); } $this->factories = array_values(array_filter($this->factories, function($f) use ($factory) { return $f !== $factory; })); return $this; } /** * Get a command factory by class name * * @param string|FactoryInterface $factory Command factory class or instance * * @return null|FactoryInterface */ public function find($factory) { foreach ($this->factories as $f) { if ($factory === $f || (is_string($factory) && $f instanceof $factory)) { return $f; } } } /** * Create a command using the associated command factories * * @param string $name Name of the command * @param array $args Command arguments * * @return CommandInterface */ public function factory($name, array $args = array()) { foreach ($this->factories as $factory) { $command = $factory->factory($name, $args); if ($command) { return $command; } } } /** * {@inheritdoc} */ public function count() { return count($this->factories); } /** * {@inheritdoc} */ public function getIterator() { return new \ArrayIterator($this->factories); } } src/Guzzle/Service/Command/Factory/ConcreteClassFactory.php000064400000003202151742734620020001 0ustar00client = $client; $this->inflector = $inflector ?: Inflector::getDefault(); } /** * {@inheritdoc} */ public function factory($name, array $args = array()) { // Determine the class to instantiate based on the namespace of the current client and the default directory $prefix = $this->client->getConfig('command.prefix'); if (!$prefix) { // The prefix can be specified in a factory method and is cached $prefix = implode('\\', array_slice(explode('\\', get_class($this->client)), 0, -1)) . '\\Command\\'; $this->client->getConfig()->set('command.prefix', $prefix); } $class = $prefix . str_replace(' ', '\\', ucwords(str_replace('.', ' ', $this->inflector->camel($name)))); // Create the concrete command if it exists if (class_exists($class)) { return new $class($args); } } } src/Guzzle/Service/Command/Factory/FactoryInterface.php000064400000000652151742734620017157 0ustar00map = $map; } /** * {@inheritdoc} */ public function factory($name, array $args = array()) { if (isset($this->map[$name])) { $class = $this->map[$name]; return new $class($args); } } } src/Guzzle/Service/Command/Factory/ServiceDescriptionFactory.php000064400000003723151742734620021065 0ustar00setServiceDescription($description); $this->inflector = $inflector; } /** * Change the service description used with the factory * * @param ServiceDescriptionInterface $description Service description to use * * @return FactoryInterface */ public function setServiceDescription(ServiceDescriptionInterface $description) { $this->description = $description; return $this; } /** * Returns the service description * * @return ServiceDescriptionInterface */ public function getServiceDescription() { return $this->description; } /** * {@inheritdoc} */ public function factory($name, array $args = array()) { $command = $this->description->getOperation($name); // If an inflector was passed, then attempt to get the command using snake_case inflection if (!$command && $this->inflector) { $command = $this->description->getOperation($this->inflector->snake($name)); } if ($command) { $class = $command->getClass(); return new $class($args, $command, $this->description); } } } src/Guzzle/Service/Command/LocationVisitor/Request/AbstractRequestVisitor.php000064400000004501151742734620023571 0ustar00resolveRecursively($value, $param) : $param->filter($value); } /** * Map nested parameters into the location_key based parameters * * @param array $value Value to map * @param Parameter $param Parameter that holds information about the current key * * @return array Returns the mapped array */ protected function resolveRecursively(array $value, Parameter $param) { foreach ($value as $name => &$v) { switch ($param->getType()) { case 'object': if ($subParam = $param->getProperty($name)) { $key = $subParam->getWireName(); $value[$key] = $this->prepareValue($v, $subParam); if ($name != $key) { unset($value[$name]); } } elseif ($param->getAdditionalProperties() instanceof Parameter) { $v = $this->prepareValue($v, $param->getAdditionalProperties()); } break; case 'array': if ($items = $param->getItems()) { $v = $this->prepareValue($v, $items); } break; } } return $param->filter($value); } } src/Guzzle/Service/Command/LocationVisitor/Request/BodyVisitor.php000064400000004724151742734620021361 0ustar00filter($value); $entityBody = EntityBody::factory($value); $request->setBody($entityBody); $this->addExpectHeader($request, $entityBody, $param->getData('expect_header')); // Add the Content-Encoding header if one is set on the EntityBody if ($encoding = $entityBody->getContentEncoding()) { $request->setHeader('Content-Encoding', $encoding); } } /** * Add the appropriate expect header to a request * * @param EntityEnclosingRequestInterface $request Request to update * @param EntityBodyInterface $body Entity body of the request * @param string|int $expect Expect header setting */ protected function addExpectHeader(EntityEnclosingRequestInterface $request, EntityBodyInterface $body, $expect) { // Allow the `expect` data parameter to be set to remove the Expect header from the request if ($expect === false) { $request->removeHeader('Expect'); } elseif ($expect !== true) { // Default to using a MB as the point in which to start using the expect header $expect = $expect ?: 1048576; // If the expect_header value is numeric then only add if the size is greater than the cutoff if (is_numeric($expect) && $body->getSize()) { if ($body->getSize() < $expect) { $request->removeHeader('Expect'); } else { $request->setHeader('Expect', '100-Continue'); } } } } } src/Guzzle/Service/Command/LocationVisitor/Request/HeaderVisitor.php000064400000003036151742734620021647 0ustar00filter($value); if ($param->getType() == 'object' && $param->getAdditionalProperties() instanceof Parameter) { $this->addPrefixedHeaders($request, $param, $value); } else { $request->setHeader($param->getWireName(), $value); } } /** * Add a prefixed array of headers to the request * * @param RequestInterface $request Request to update * @param Parameter $param Parameter object * @param array $value Header array to add * * @throws InvalidArgumentException */ protected function addPrefixedHeaders(RequestInterface $request, Parameter $param, $value) { if (!is_array($value)) { throw new InvalidArgumentException('An array of mapped headers expected, but received a single value'); } $prefix = $param->getSentAs(); foreach ($value as $headerName => $headerValue) { $request->setHeader($prefix . $headerName, $headerValue); } } } src/Guzzle/Service/Command/LocationVisitor/Request/JsonVisitor.php000064400000004263151742734620021373 0ustar00data = new \SplObjectStorage(); } /** * Set the Content-Type header to add to the request if JSON is added to the body. This visitor does not add a * Content-Type header unless you specify one here. * * @param string $header Header to set when JSON is added (e.g. application/json) * * @return self */ public function setContentTypeHeader($header = 'application/json') { $this->jsonContentType = $header; return $this; } /** * {@inheritdoc} */ public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value) { if (isset($this->data[$command])) { $json = $this->data[$command]; } else { $json = array(); } $json[$param->getWireName()] = $this->prepareValue($value, $param); $this->data[$command] = $json; } /** * {@inheritdoc} */ public function after(CommandInterface $command, RequestInterface $request) { if (isset($this->data[$command])) { $request->setBody(json_encode($this->data[$command])); unset($this->data[$command]); // Don't overwrite the Content-Type if one is set if ($this->jsonContentType && !$request->hasHeader('Content-Type')) { $request->setHeader('Content-Type', $this->jsonContentType); } } } } src/Guzzle/Service/Command/LocationVisitor/Request/PostFieldVisitor.php000064400000001062151742734620022345 0ustar00setPostField($param->getWireName(), $this->prepareValue($value, $param)); } } src/Guzzle/Service/Command/LocationVisitor/Request/PostFileVisitor.php000064400000001343151742734620022203 0ustar00filter($value); if ($value instanceof PostFileInterface) { $request->addPostFile($value); } else { $request->addPostFile($param->getWireName(), $value); } } } src/Guzzle/Service/Command/LocationVisitor/Request/QueryVisitor.php000064400000001075151742734620021565 0ustar00getQuery()->set($param->getWireName(), $this->prepareValue($value, $param)); } } src/Guzzle/Service/Command/LocationVisitor/Request/RequestVisitorInterface.php000064400000002067151742734620023733 0ustar00setResponseBody($value); } } src/Guzzle/Service/Command/LocationVisitor/Request/XmlVisitor.php000064400000012602151742734620021216 0ustar00data = new \SplObjectStorage(); } /** * Change the content-type header that is added when XML is found * * @param string $header Header to set when XML is found * * @return self */ public function setContentTypeHeader($header) { $this->contentType = $header; return $this; } /** * {@inheritdoc} */ public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value) { $xml = isset($this->data[$command]) ? $this->data[$command] : $this->createRootElement($param->getParent()); $this->addXml($xml, $param, $value); $this->data[$command] = $xml; } /** * {@inheritdoc} */ public function after(CommandInterface $command, RequestInterface $request) { $xml = null; // If data was found that needs to be serialized, then do so if (isset($this->data[$command])) { $xml = $this->data[$command]->asXML(); unset($this->data[$command]); } else { // Check if XML should always be sent for the command $operation = $command->getOperation(); if ($operation->getData('xmlAllowEmpty')) { $xml = $this->createRootElement($operation)->asXML(); } } if ($xml) { $request->setBody($xml); // Don't overwrite the Content-Type if one is set if ($this->contentType && !$request->hasHeader('Content-Type')) { $request->setHeader('Content-Type', $this->contentType); } } } /** * Create the root XML element to use with a request * * @param Operation $operation Operation object * * @return \SimpleXMLElement */ protected function createRootElement(Operation $operation) { static $defaultRoot = array('name' => 'Request'); // If no root element was specified, then just wrap the XML in 'Request' $root = $operation->getData('xmlRoot') ?: $defaultRoot; // Allow the XML declaration to be customized with xmlEncoding $declaration = 'getData('xmlEncoding')) { $declaration .= ' encoding="' . $encoding . '"'; } $declaration .= "?>"; // Create the wrapping element with no namespaces if no namespaces were present if (empty($root['namespaces'])) { return new \SimpleXMLElement("{$declaration}\n<{$root['name']}/>"); } else { // Create the wrapping element with an array of one or more namespaces $xml = "{$declaration}\n<{$root['name']} "; foreach ((array) $root['namespaces'] as $prefix => $uri) { $xml .= is_numeric($prefix) ? "xmlns=\"{$uri}\" " : "xmlns:{$prefix}=\"{$uri}\" "; } return new \SimpleXMLElement($xml . "/>"); } } /** * Recursively build the XML body * * @param \SimpleXMLElement $xml XML to modify * @param Parameter $param API Parameter * @param mixed $value Value to add */ protected function addXml(\SimpleXMLElement $xml, Parameter $param, $value) { if ($value === null) { return; } $value = $param->filter($value); $type = $param->getType(); if ($type == 'object' || $type == 'array') { $ele = $param->getData('xmlFlattened') ? $xml : $xml->addChild($param->getWireName()); if ($param->getType() == 'array') { $this->addXmlArray($ele, $param, $value, $param->getData('xmlNamespace')); } elseif ($param->getType() == 'object') { $this->addXmlObject($ele, $param, $value); } } elseif ($param->getData('xmlAttribute')) { $xml->addAttribute($param->getWireName(), $value, $param->getData('xmlNamespace')); } else { $xml->addChild($param->getWireName(), $value, $param->getData('xmlNamespace')); } } /** * Add an array to the XML */ protected function addXmlArray(\SimpleXMLElement $xml, Parameter $param, &$value) { if ($items = $param->getItems()) { foreach ($value as $v) { $this->addXml($xml, $items, $v); } } } /** * Add an object to the XML */ protected function addXmlObject(\SimpleXMLElement $xml, Parameter $param, &$value) { foreach ($value as $name => $v) { if ($property = $param->getProperty($name)) { $this->addXml($xml, $property, $v); } } } } src/Guzzle/Service/Command/LocationVisitor/Response/AbstractResponseVisitor.php000064400000001341151742734620024104 0ustar00getName()] = $param->filter($response->getBody()); } } src/Guzzle/Service/Command/LocationVisitor/Response/HeaderVisitor.php000064400000003406151742734620022016 0ustar00getType() == 'object' && $param->getAdditionalProperties() instanceof Parameter) { $this->processPrefixedHeaders($response, $param, $value); } else { $value[$param->getName()] = $param->filter((string) $response->getHeader($param->getWireName())); } } /** * Process a prefixed header array * * @param Response $response Response that contains the headers * @param Parameter $param Parameter object * @param array $value Value response array to modify */ protected function processPrefixedHeaders(Response $response, Parameter $param, &$value) { // Grab prefixed headers that should be placed into an array with the prefix stripped if ($prefix = $param->getSentAs()) { $container = $param->getName(); $len = strlen($prefix); // Find all matching headers and place them into the containing element foreach ($response->getHeaders() as $key => $header) { if (stripos($key, $prefix) === 0) { // Account for multi-value headers $value[$container][substr($key, $len)] = count($header) == 1 ? end($header) : $header; } } } } } src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php000064400000005540151742734620021540 0ustar00getResponse()->json(); } /** * {@inheritdoc} */ public function visit(CommandInterface $command, Response $response, Parameter $param, &$value, $context = null) { $name = $param->getName(); $key = $param->getWireName(); if (isset($value[$key])) { $this->recursiveProcess($param, $value[$key]); if ($key != $name) { $value[$name] = $value[$key]; unset($value[$key]); } } } /** * Recursively process a parameter while applying filters * * @param Parameter $param API parameter being validated * @param mixed $value Value to validate and process. The value may change during this process. */ protected function recursiveProcess(Parameter $param, &$value) { if ($value === null) { return; } if (is_array($value)) { $type = $param->getType(); if ($type == 'array') { foreach ($value as &$item) { $this->recursiveProcess($param->getItems(), $item); } } elseif ($type == 'object' && !isset($value[0])) { // On the above line, we ensure that the array is associative and not numerically indexed if ($properties = $param->getProperties()) { foreach ($properties as $property) { $name = $property->getName(); $key = $property->getWireName(); if (isset($value[$key])) { $this->recursiveProcess($property, $value[$key]); } if ($key != $name) { $value[$name] = $value[$key]; unset($value[$key]); } } } } } $value = $param->filter($value); } } src/Guzzle/Service/Command/LocationVisitor/Response/ReasonPhraseVisitor.php000064400000001103151742734620023210 0ustar00getName()] = $response->getReasonPhrase(); } } src/Guzzle/Service/Command/LocationVisitor/Response/ResponseVisitorInterface.php000064400000003022151742734620024237 0ustar00getName()] = $response->getStatusCode(); } } src/Guzzle/Service/Command/LocationVisitor/Response/XmlVisitor.php000064400000012143151742734620021364 0ustar00getResponse()->xml()), true); } /** * {@inheritdoc} */ public function visit(CommandInterface $command, Response $response, Parameter $param, &$value, $context = null) { $sentAs = $param->getWireName(); $name = $param->getName(); if (isset($value[$sentAs])) { $this->recursiveProcess($param, $value[$sentAs]); if ($name != $sentAs) { $value[$name] = $value[$sentAs]; unset($value[$sentAs]); } } } /** * Recursively process a parameter while applying filters * * @param Parameter $param API parameter being processed * @param mixed $value Value to validate and process. The value may change during this process. */ protected function recursiveProcess(Parameter $param, &$value) { $type = $param->getType(); if (!is_array($value)) { if ($type == 'array') { // Cast to an array if the value was a string, but should be an array $this->recursiveProcess($param->getItems(), $value); $value = array($value); } } elseif ($type == 'object') { $this->processObject($param, $value); } elseif ($type == 'array') { $this->processArray($param, $value); } if ($value !== null) { $value = $param->filter($value); } } /** * Process an array * * @param Parameter $param API parameter being parsed * @param mixed $value Value to process */ protected function processArray(Parameter $param, &$value) { // Convert the node if it was meant to be an array if (!isset($value[0])) { // Collections fo nodes are sometimes wrapped in an additional array. For example: // 12 should become: // array('Items' => array(array('a' => 1), array('a' => 2)) // Some nodes are not wrapped. For example: 12 // should become array('Foo' => array(array('a' => 1), array('a' => 2)) if ($param->getItems() && isset($value[$param->getItems()->getWireName()])) { // Account for the case of a collection wrapping wrapped nodes: Items => Item[] $value = $value[$param->getItems()->getWireName()]; // If the wrapped node only had one value, then make it an array of nodes if (!isset($value[0]) || !is_array($value)) { $value = array($value); } } elseif (!empty($value)) { // Account for repeated nodes that must be an array: Foo => Baz, Foo => Baz, but only if the // value is set and not empty $value = array($value); } } foreach ($value as &$item) { $this->recursiveProcess($param->getItems(), $item); } } /** * Process an object * * @param Parameter $param API parameter being parsed * @param mixed $value Value to process */ protected function processObject(Parameter $param, &$value) { // Ensure that the array is associative and not numerically indexed if (!isset($value[0]) && ($properties = $param->getProperties())) { foreach ($properties as $property) { $name = $property->getName(); $sentAs = $property->getWireName(); if ($property->getData('xmlAttribute')) { $this->processXmlAttribute($property, $value); } elseif (isset($value[$sentAs])) { $this->recursiveProcess($property, $value[$sentAs]); if ($name != $sentAs) { $value[$name] = $value[$sentAs]; unset($value[$sentAs]); } } } } } /** * Process an XML attribute property * * @param Parameter $property Property to process * @param array $value Value to process and update */ protected function processXmlAttribute(Parameter $property, array &$value) { $sentAs = $property->getWireName(); if (isset($value['@attributes'][$sentAs])) { $value[$property->getName()] = $value['@attributes'][$sentAs]; unset($value['@attributes'][$sentAs]); if (empty($value['@attributes'])) { unset($value['@attributes']); } } } } src/Guzzle/Service/Command/LocationVisitor/VisitorFlyweight.php000064400000011374151742734620020775 0ustar00 'Guzzle\Service\Command\LocationVisitor\Request\BodyVisitor', 'request.header' => 'Guzzle\Service\Command\LocationVisitor\Request\HeaderVisitor', 'request.json' => 'Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor', 'request.postField' => 'Guzzle\Service\Command\LocationVisitor\Request\PostFieldVisitor', 'request.postFile' => 'Guzzle\Service\Command\LocationVisitor\Request\PostFileVisitor', 'request.query' => 'Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor', 'request.response_body' => 'Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor', 'request.xml' => 'Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor', 'response.body' => 'Guzzle\Service\Command\LocationVisitor\Response\BodyVisitor', 'response.header' => 'Guzzle\Service\Command\LocationVisitor\Response\HeaderVisitor', 'response.json' => 'Guzzle\Service\Command\LocationVisitor\Response\JsonVisitor', 'response.reasonPhrase' => 'Guzzle\Service\Command\LocationVisitor\Response\ReasonPhraseVisitor', 'response.statusCode' => 'Guzzle\Service\Command\LocationVisitor\Response\StatusCodeVisitor', 'response.xml' => 'Guzzle\Service\Command\LocationVisitor\Response\XmlVisitor' ); /** * @var array Array of mappings of location names to classes */ protected $mappings; /** * @var array Cache of instantiated visitors */ protected $cache = array(); /** * Get a cached instance of the flyweight factory * * @return self * @codeCoverageIgnore */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; } /** * Create a new flyweight * * @param array $mappings Array mapping request.name and response.name to location visitor classes. Leave null to * use the default values. */ public function __construct(array $mappings = null) { $this->mappings = $mappings === null ? self::$defaultMappings : $mappings; } /** * Get an instance of a request visitor by location name * * @param string $visitor Visitor name * * @return RequestVisitorInterface */ public function getRequestVisitor($visitor) { return $this->getKey('request.' . $visitor); } /** * Get an instance of a response visitor by location name * * @param string $visitor Visitor name * * @return ResponseVisitorInterface */ public function getResponseVisitor($visitor) { return $this->getKey('response.' . $visitor); } /** * Add a response visitor to the factory by name * * @param string $name Name of the visitor * @param RequestVisitorInterface $visitor Visitor to add * * @return self */ public function addRequestVisitor($name, RequestVisitorInterface $visitor) { $this->cache['request.' . $name] = $visitor; return $this; } /** * Add a response visitor to the factory by name * * @param string $name Name of the visitor * @param ResponseVisitorInterface $visitor Visitor to add * * @return self */ public function addResponseVisitor($name, ResponseVisitorInterface $visitor) { $this->cache['response.' . $name] = $visitor; return $this; } /** * Get a visitor by key value name * * @param string $key Key name to retrieve * * @return mixed * @throws InvalidArgumentException */ private function getKey($key) { if (!isset($this->cache[$key])) { if (!isset($this->mappings[$key])) { list($type, $name) = explode('.', $key); throw new InvalidArgumentException("No {$type} visitor has been mapped for {$name}"); } $this->cache[$key] = new $this->mappings[$key]; } return $this->cache[$key]; } } src/Guzzle/Service/Command/OperationCommand.php000064400000005166151742734620015564 0ustar00responseParser = $parser; return $this; } /** * Set the request serializer used with the command * * @param RequestSerializerInterface $serializer Request serializer * * @return self */ public function setRequestSerializer(RequestSerializerInterface $serializer) { $this->requestSerializer = $serializer; return $this; } /** * Get the request serializer used with the command * * @return RequestSerializerInterface */ public function getRequestSerializer() { if (!$this->requestSerializer) { // Use the default request serializer if none was found $this->requestSerializer = DefaultRequestSerializer::getInstance(); } return $this->requestSerializer; } /** * Get the response parser used for the operation * * @return ResponseParserInterface */ public function getResponseParser() { if (!$this->responseParser) { // Use the default response parser if none was found $this->responseParser = OperationResponseParser::getInstance(); } return $this->responseParser; } /** * {@inheritdoc} */ protected function build() { // Prepare and serialize the request $this->request = $this->getRequestSerializer()->prepare($this); } /** * {@inheritdoc} */ protected function process() { // Do not process the response if 'command.response_processing' is set to 'raw' $this->result = $this->get(self::RESPONSE_PROCESSING) == self::TYPE_RAW ? $this->request->getResponse() : $this->getResponseParser()->parse($this); } } src/Guzzle/Service/Command/OperationResponseParser.php000064400000014351151742734620017155 0ustar00factory = $factory; } /** * Add a location visitor to the command * * @param string $location Location to associate with the visitor * @param ResponseVisitorInterface $visitor Visitor to attach * * @return self */ public function addVisitor($location, ResponseVisitorInterface $visitor) { $this->factory->addResponseVisitor($location, $visitor); return $this; } /** * {@inheritdoc} */ protected function handleParsing(AbstractCommand $command, Response $response, $contentType) { $operation = $command->getOperation(); $type = $operation->getResponseType(); $model = null; if ($type == OperationInterface::TYPE_MODEL) { $model = $operation->getServiceDescription()->getModel($operation->getResponseClass()); } elseif ($type == OperationInterface::TYPE_CLASS) { $responseClassInterface = __NAMESPACE__ . '\ResponseClassInterface'; $className = $operation->getResponseClass(); if (!class_exists($className)) { throw new ResponseClassException("{$className} does not exist"); } elseif (!method_exists($className, 'fromCommand')) { throw new ResponseClassException("{$className} must implement {$responseClassInterface}"); } return $className::fromCommand($command); } if (!$model) { // Return basic processing if the responseType is not model or the model cannot be found return parent::handleParsing($command, $response, $contentType); } elseif ($command->get(AbstractCommand::RESPONSE_PROCESSING) != AbstractCommand::TYPE_MODEL) { // Returns a model with no visiting if the command response processing is not model return new Model(parent::handleParsing($command, $response, $contentType), $model); } else { return new Model($this->visitResult($model, $command, $response), $model); } } /** * Perform transformations on the result array * * @param Parameter $model Model that defines the structure * @param CommandInterface $command Command that performed the operation * @param Response $response Response received * * @return array Returns the array of result data */ protected function visitResult( Parameter $model, CommandInterface $command, Response $response ) { $foundVisitors = $result = array(); $props = $model->getProperties(); foreach ($props as $schema) { if ($location = $schema->getLocation()) { // Trigger the before method on the first found visitor of this type if (!isset($foundVisitors[$location])) { $foundVisitors[$location] = $this->factory->getResponseVisitor($location); $foundVisitors[$location]->before($command, $result); } } } // Visit additional properties when it is an actual schema if ($additional = $model->getAdditionalProperties()) { if ($additional instanceof Parameter) { // Only visit when a location is specified if ($location = $additional->getLocation()) { if (!isset($foundVisitors[$location])) { $foundVisitors[$location] = $this->factory->getResponseVisitor($location); $foundVisitors[$location]->before($command, $result); } // Only traverse if an array was parsed from the before() visitors if (is_array($result)) { // Find each additional property foreach (array_keys($result) as $key) { // Check if the model actually knows this property. If so, then it is not additional if (!$model->getProperty($key)) { // Set the name to the key so that we can parse it with each visitor $additional->setName($key); $foundVisitors[$location]->visit($command, $response, $additional, $result); } } // Reset the additionalProperties name to null $additional->setName(null); } } } } // Apply the parameter value with the location visitor foreach ($props as $schema) { if ($location = $schema->getLocation()) { $foundVisitors[$location]->visit($command, $response, $schema, $result); } } // Call the after() method of each found visitor foreach ($foundVisitors as $visitor) { $visitor->after($command); } return $result; } } src/Guzzle/Service/Command/RequestSerializerInterface.php000064400000000746151742734620017627 0ustar00 true, 'httpMethod' => true, 'uri' => true, 'class' => true, 'responseClass' => true, 'responseType' => true, 'responseNotes' => true, 'notes' => true, 'summary' => true, 'documentationUrl' => true, 'deprecated' => true, 'data' => true, 'parameters' => true, 'additionalParameters' => true, 'errorResponses' => true ); /** * @var array Parameters */ protected $parameters = array(); /** * @var Parameter Additional parameters schema */ protected $additionalParameters; /** * @var string Name of the command */ protected $name; /** * @var string HTTP method */ protected $httpMethod; /** * @var string This is a short summary of what the operation does */ protected $summary; /** * @var string A longer text field to explain the behavior of the operation. */ protected $notes; /** * @var string Reference URL providing more information about the operation */ protected $documentationUrl; /** * @var string HTTP URI of the command */ protected $uri; /** * @var string Class of the command object */ protected $class; /** * @var string This is what is returned from the method */ protected $responseClass; /** * @var string Type information about the response */ protected $responseType; /** * @var string Information about the response returned by the operation */ protected $responseNotes; /** * @var bool Whether or not the command is deprecated */ protected $deprecated; /** * @var array Array of errors that could occur when running the command */ protected $errorResponses; /** * @var ServiceDescriptionInterface */ protected $description; /** * @var array Extra operation information */ protected $data; /** * Builds an Operation object using an array of configuration data: * - name: (string) Name of the command * - httpMethod: (string) HTTP method of the operation * - uri: (string) URI template that can create a relative or absolute URL * - class: (string) Concrete class that implements this command * - parameters: (array) Associative array of parameters for the command. {@see Parameter} for information. * - summary: (string) This is a short summary of what the operation does * - notes: (string) A longer text field to explain the behavior of the operation. * - documentationUrl: (string) Reference URL providing more information about the operation * - responseClass: (string) This is what is returned from the method. Can be a primitive, PSR-0 compliant * class name, or model. * - responseNotes: (string) Information about the response returned by the operation * - responseType: (string) One of 'primitive', 'class', 'model', or 'documentation'. If not specified, this * value will be automatically inferred based on whether or not there is a model matching the * name, if a matching PSR-0 compliant class name is found, or set to 'primitive' by default. * - deprecated: (bool) Set to true if this is a deprecated command * - errorResponses: (array) Errors that could occur when executing the command. Array of hashes, each with a * 'code' (the HTTP response code), 'phrase' (response reason phrase or description of the * error), and 'class' (a custom exception class that would be thrown if the error is * encountered). * - data: (array) Any extra data that might be used to help build or serialize the operation * - additionalParameters: (null|array) Parameter schema to use when an option is passed to the operation that is * not in the schema * * @param array $config Array of configuration data * @param ServiceDescriptionInterface $description Service description used to resolve models if $ref tags are found */ public function __construct(array $config = array(), ServiceDescriptionInterface $description = null) { $this->description = $description; // Get the intersection of the available properties and properties set on the operation foreach (array_intersect_key($config, self::$properties) as $key => $value) { $this->{$key} = $value; } $this->class = $this->class ?: self::DEFAULT_COMMAND_CLASS; $this->deprecated = (bool) $this->deprecated; $this->errorResponses = $this->errorResponses ?: array(); $this->data = $this->data ?: array(); if (!$this->responseClass) { $this->responseClass = 'array'; $this->responseType = 'primitive'; } elseif ($this->responseType) { // Set the response type to perform validation $this->setResponseType($this->responseType); } else { // A response class was set and no response type was set, so guess what the type is $this->inferResponseType(); } // Parameters need special handling when adding if (!empty($config['parameters'])) { $this->parameters = array(); foreach ($config['parameters'] as $name => $param) { if ($param instanceof Parameter) { $param->setName($name)->setParent($this); $this->parameters[$name] = $param; } elseif (is_array($param)) { $param['name'] = $name; $this->addParam(new Parameter($param, $this->description)); } } } if (isset($config['additionalParameters'])) { if ($config['additionalParameters'] instanceof Parameter) { $this->setadditionalParameters($config['additionalParameters']); } elseif (is_array($config['additionalParameters'])) { $this->setadditionalParameters(new Parameter($config['additionalParameters'], $this->description)); } } } /** * {@inheritdoc} */ public function toArray() { $result = array(); // Grab valid properties and filter out values that weren't set foreach (array_keys(self::$properties) as $check) { if ($value = $this->{$check}) { $result[$check] = $value; } } // Remove the name property unset($result['name']); // Parameters need to be converted to arrays $result['parameters'] = array(); foreach ($this->parameters as $key => $param) { $result['parameters'][$key] = $param->toArray(); } // Additional parameters need to be cast to an array if ($this->additionalParameters instanceof Parameter) { $result['additionalParameters'] = $this->additionalParameters->toArray(); } return $result; } /** * {@inheritdoc} */ public function getServiceDescription() { return $this->description; } /** * {@inheritdoc} */ public function setServiceDescription(ServiceDescriptionInterface $description) { $this->description = $description; return $this; } /** * {@inheritdoc} */ public function getParams() { return $this->parameters; } /** * {@inheritdoc} */ public function getParamNames() { return array_keys($this->parameters); } /** * {@inheritdoc} */ public function hasParam($name) { return isset($this->parameters[$name]); } /** * {@inheritdoc} */ public function getParam($param) { return isset($this->parameters[$param]) ? $this->parameters[$param] : null; } /** * Add a parameter to the command * * @param Parameter $param Parameter to add * * @return self */ public function addParam(Parameter $param) { $this->parameters[$param->getName()] = $param; $param->setParent($this); return $this; } /** * Remove a parameter from the command * * @param string $name Name of the parameter to remove * * @return self */ public function removeParam($name) { unset($this->parameters[$name]); return $this; } /** * {@inheritdoc} */ public function getHttpMethod() { return $this->httpMethod; } /** * Set the HTTP method of the command * * @param string $httpMethod Method to set * * @return self */ public function setHttpMethod($httpMethod) { $this->httpMethod = $httpMethod; return $this; } /** * {@inheritdoc} */ public function getClass() { return $this->class; } /** * Set the concrete class of the command * * @param string $className Concrete class name * * @return self */ public function setClass($className) { $this->class = $className; return $this; } /** * {@inheritdoc} */ public function getName() { return $this->name; } /** * Set the name of the command * * @param string $name Name of the command * * @return self */ public function setName($name) { $this->name = $name; return $this; } /** * {@inheritdoc} */ public function getSummary() { return $this->summary; } /** * Set a short summary of what the operation does * * @param string $summary Short summary of the operation * * @return self */ public function setSummary($summary) { $this->summary = $summary; return $this; } /** * {@inheritdoc} */ public function getNotes() { return $this->notes; } /** * Set a longer text field to explain the behavior of the operation. * * @param string $notes Notes on the operation * * @return self */ public function setNotes($notes) { $this->notes = $notes; return $this; } /** * {@inheritdoc} */ public function getDocumentationUrl() { return $this->documentationUrl; } /** * Set the URL pointing to additional documentation on the command * * @param string $docUrl Documentation URL * * @return self */ public function setDocumentationUrl($docUrl) { $this->documentationUrl = $docUrl; return $this; } /** * {@inheritdoc} */ public function getResponseClass() { return $this->responseClass; } /** * Set what is returned from the method. Can be a primitive, class name, or model. For example: 'array', * 'Guzzle\\Foo\\Baz', or 'MyModelName' (to reference a model by ID). * * @param string $responseClass Type of response * * @return self */ public function setResponseClass($responseClass) { $this->responseClass = $responseClass; $this->inferResponseType(); return $this; } /** * {@inheritdoc} */ public function getResponseType() { return $this->responseType; } /** * Set qualifying information about the responseClass. One of 'primitive', 'class', 'model', or 'documentation' * * @param string $responseType Response type information * * @return self * @throws InvalidArgumentException */ public function setResponseType($responseType) { static $types = array( self::TYPE_PRIMITIVE => true, self::TYPE_CLASS => true, self::TYPE_MODEL => true, self::TYPE_DOCUMENTATION => true ); if (!isset($types[$responseType])) { throw new InvalidArgumentException('responseType must be one of ' . implode(', ', array_keys($types))); } $this->responseType = $responseType; return $this; } /** * {@inheritdoc} */ public function getResponseNotes() { return $this->responseNotes; } /** * Set notes about the response of the operation * * @param string $notes Response notes * * @return self */ public function setResponseNotes($notes) { $this->responseNotes = $notes; return $this; } /** * {@inheritdoc} */ public function getDeprecated() { return $this->deprecated; } /** * Set whether or not the command is deprecated * * @param bool $isDeprecated Set to true to mark as deprecated * * @return self */ public function setDeprecated($isDeprecated) { $this->deprecated = $isDeprecated; return $this; } /** * {@inheritdoc} */ public function getUri() { return $this->uri; } /** * Set the URI template of the command * * @param string $uri URI template to set * * @return self */ public function setUri($uri) { $this->uri = $uri; return $this; } /** * {@inheritdoc} */ public function getErrorResponses() { return $this->errorResponses; } /** * Add an error to the command * * @param string $code HTTP response code * @param string $reason HTTP response reason phrase or information about the error * @param string $class Exception class associated with the error * * @return self */ public function addErrorResponse($code, $reason, $class) { $this->errorResponses[] = array('code' => $code, 'reason' => $reason, 'class' => $class); return $this; } /** * Set all of the error responses of the operation * * @param array $errorResponses Hash of error name to a hash containing a code, reason, class * * @return self */ public function setErrorResponses(array $errorResponses) { $this->errorResponses = $errorResponses; return $this; } /** * {@inheritdoc} */ public function getData($name) { return isset($this->data[$name]) ? $this->data[$name] : null; } /** * Set a particular data point on the operation * * @param string $name Name of the data value * @param mixed $value Value to set * * @return self */ public function setData($name, $value) { $this->data[$name] = $value; return $this; } /** * Get the additionalParameters of the operation * * @return Paramter|null */ public function getAdditionalParameters() { return $this->additionalParameters; } /** * Set the additionalParameters of the operation * * @param Parameter|null $parameter Parameter to set * * @return self */ public function setAdditionalParameters($parameter) { if ($this->additionalParameters = $parameter) { $this->additionalParameters->setParent($this); } return $this; } /** * Infer the response type from the responseClass value */ protected function inferResponseType() { if (!$this->responseClass || $this->responseClass == 'array' || $this->responseClass == 'string' || $this->responseClass == 'boolean' || $this->responseClass == 'integer' ) { $this->responseType = self::TYPE_PRIMITIVE; } elseif ($this->description && $this->description->hasModel($this->responseClass)) { $this->responseType = self::TYPE_MODEL; } elseif (strpos($this->responseClass, '\\') !== false) { $this->responseType = self::TYPE_CLASS; } else { $this->responseType = self::TYPE_PRIMITIVE; } } } src/Guzzle/Service/Description/OperationInterface.php000064400000007211151742734620017004 0ustar00getModel($data['$ref'])) { $data = $model->toArray(); } } elseif (isset($data['extends'])) { // If this parameter extends from another parameter then start with the actual data // union in the parent's data (e.g. actual supersedes parent) if ($extends = $description->getModel($data['extends'])) { $data += $extends->toArray(); } } } // Pull configuration data into the parameter foreach ($data as $key => $value) { $this->{$key} = $value; } $this->serviceDescription = $description; $this->required = (bool) $this->required; $this->data = (array) $this->data; if ($this->filters) { $this->setFilters((array) $this->filters); } if ($this->type == 'object' && $this->additionalProperties === null) { $this->additionalProperties = true; } } /** * Convert the object to an array * * @return array */ public function toArray() { $result = array(); $checks = array('required', 'description', 'static', 'type', 'format', 'instanceOf', 'location', 'sentAs', 'pattern', 'minimum', 'maximum', 'minItems', 'maxItems', 'minLength', 'maxLength', 'data', 'enum', 'filters'); // Anything that is in the `Items` attribute of an array *must* include it's name if available if ($this->parent instanceof self && $this->parent->getType() == 'array' && isset($this->name)) { $result['name'] = $this->name; } foreach ($checks as $c) { if ($value = $this->{$c}) { $result[$c] = $value; } } if ($this->default !== null) { $result['default'] = $this->default; } if ($this->items !== null) { $result['items'] = $this->getItems()->toArray(); } if ($this->additionalProperties !== null) { $result['additionalProperties'] = $this->getAdditionalProperties(); if ($result['additionalProperties'] instanceof self) { $result['additionalProperties'] = $result['additionalProperties']->toArray(); } } if ($this->type == 'object' && $this->properties) { $result['properties'] = array(); foreach ($this->getProperties() as $name => $property) { $result['properties'][$name] = $property->toArray(); } } return $result; } /** * Get the default or static value of the command based on a value * * @param string $value Value that is currently set * * @return mixed Returns the value, a static value if one is present, or a default value */ public function getValue($value) { return $this->static || ($this->default !== null && !$value && ($this->type != 'boolean' || $value !== false)) ? $this->default : $value; } /** * Run a value through the filters OR format attribute associated with the parameter * * @param mixed $value Value to filter * * @return mixed Returns the filtered value */ public function filter($value) { // Formats are applied exclusively and supersed filters if ($this->format) { return SchemaFormatter::format($this->format, $value); } // Convert Boolean values if ($this->type == 'boolean' && !is_bool($value)) { $value = filter_var($value, FILTER_VALIDATE_BOOLEAN); } // Apply filters to the value if ($this->filters) { foreach ($this->filters as $filter) { if (is_array($filter)) { // Convert complex filters that hold value place holders foreach ($filter['args'] as &$data) { if ($data == '@value') { $data = $value; } elseif ($data == '@api') { $data = $this; } } $value = call_user_func_array($filter['method'], $filter['args']); } else { $value = call_user_func($filter, $value); } } } return $value; } /** * Get the name of the parameter * * @return string */ public function getName() { return $this->name; } /** * Get the key of the parameter, where sentAs will supersede name if it is set * * @return string */ public function getWireName() { return $this->sentAs ?: $this->name; } /** * Set the name of the parameter * * @param string $name Name to set * * @return self */ public function setName($name) { $this->name = $name; return $this; } /** * Get the type(s) of the parameter * * @return string|array */ public function getType() { return $this->type; } /** * Set the type(s) of the parameter * * @param string|array $type Type of parameter or array of simple types used in a union * * @return self */ public function setType($type) { $this->type = $type; return $this; } /** * Get if the parameter is required * * @return bool */ public function getRequired() { return $this->required; } /** * Set if the parameter is required * * @param bool $isRequired Whether or not the parameter is required * * @return self */ public function setRequired($isRequired) { $this->required = (bool) $isRequired; return $this; } /** * Get the default value of the parameter * * @return string|null */ public function getDefault() { return $this->default; } /** * Set the default value of the parameter * * @param string|null $default Default value to set * * @return self */ public function setDefault($default) { $this->default = $default; return $this; } /** * Get the description of the parameter * * @return string|null */ public function getDescription() { return $this->description; } /** * Set the description of the parameter * * @param string $description Description * * @return self */ public function setDescription($description) { $this->description = $description; return $this; } /** * Get the minimum acceptable value for an integer * * @return int|null */ public function getMinimum() { return $this->minimum; } /** * Set the minimum acceptable value for an integer * * @param int|null $min Minimum * * @return self */ public function setMinimum($min) { $this->minimum = $min; return $this; } /** * Get the maximum acceptable value for an integer * * @return int|null */ public function getMaximum() { return $this->maximum; } /** * Set the maximum acceptable value for an integer * * @param int $max Maximum * * @return self */ public function setMaximum($max) { $this->maximum = $max; return $this; } /** * Get the minimum allowed length of a string value * * @return int */ public function getMinLength() { return $this->minLength; } /** * Set the minimum allowed length of a string value * * @param int|null $min Minimum * * @return self */ public function setMinLength($min) { $this->minLength = $min; return $this; } /** * Get the maximum allowed length of a string value * * @return int|null */ public function getMaxLength() { return $this->maxLength; } /** * Set the maximum allowed length of a string value * * @param int $max Maximum length * * @return self */ public function setMaxLength($max) { $this->maxLength = $max; return $this; } /** * Get the maximum allowed number of items in an array value * * @return int|null */ public function getMaxItems() { return $this->maxItems; } /** * Set the maximum allowed number of items in an array value * * @param int $max Maximum * * @return self */ public function setMaxItems($max) { $this->maxItems = $max; return $this; } /** * Get the minimum allowed number of items in an array value * * @return int */ public function getMinItems() { return $this->minItems; } /** * Set the minimum allowed number of items in an array value * * @param int|null $min Minimum * * @return self */ public function setMinItems($min) { $this->minItems = $min; return $this; } /** * Get the location of the parameter * * @return string|null */ public function getLocation() { return $this->location; } /** * Set the location of the parameter * * @param string|null $location Location of the parameter * * @return self */ public function setLocation($location) { $this->location = $location; return $this; } /** * Get the sentAs attribute of the parameter that used with locations to sentAs an attribute when it is being * applied to a location. * * @return string|null */ public function getSentAs() { return $this->sentAs; } /** * Set the sentAs attribute * * @param string|null $name Name of the value as it is sent over the wire * * @return self */ public function setSentAs($name) { $this->sentAs = $name; return $this; } /** * Retrieve a known property from the parameter by name or a data property by name. When not specific name value * is specified, all data properties will be returned. * * @param string|null $name Specify a particular property name to retrieve * * @return array|mixed|null */ public function getData($name = null) { if (!$name) { return $this->data; } if (isset($this->data[$name])) { return $this->data[$name]; } elseif (isset($this->{$name})) { return $this->{$name}; } return null; } /** * Set the extra data properties of the parameter or set a specific extra property * * @param string|array|null $nameOrData The name of a specific extra to set or an array of extras to set * @param mixed|null $data When setting a specific extra property, specify the data to set for it * * @return self */ public function setData($nameOrData, $data = null) { if (is_array($nameOrData)) { $this->data = $nameOrData; } else { $this->data[$nameOrData] = $data; } return $this; } /** * Get whether or not the default value can be changed * * @return mixed|null */ public function getStatic() { return $this->static; } /** * Set to true if the default value cannot be changed * * @param bool $static True or false * * @return self */ public function setStatic($static) { $this->static = (bool) $static; return $this; } /** * Get an array of filters used by the parameter * * @return array */ public function getFilters() { return $this->filters ?: array(); } /** * Set the array of filters used by the parameter * * @param array $filters Array of functions to use as filters * * @return self */ public function setFilters(array $filters) { $this->filters = array(); foreach ($filters as $filter) { $this->addFilter($filter); } return $this; } /** * Add a filter to the parameter * * @param string|array $filter Method to filter the value through * * @return self * @throws InvalidArgumentException */ public function addFilter($filter) { if (is_array($filter)) { if (!isset($filter['method'])) { throw new InvalidArgumentException('A [method] value must be specified for each complex filter'); } } if (!$this->filters) { $this->filters = array($filter); } else { $this->filters[] = $filter; } return $this; } /** * Get the parent object (an {@see OperationInterface} or {@see Parameter} * * @return OperationInterface|Parameter|null */ public function getParent() { return $this->parent; } /** * Set the parent object of the parameter * * @param OperationInterface|Parameter|null $parent Parent container of the parameter * * @return self */ public function setParent($parent) { $this->parent = $parent; return $this; } /** * Get the properties of the parameter * * @return array */ public function getProperties() { if (!$this->propertiesCache) { $this->propertiesCache = array(); foreach (array_keys($this->properties) as $name) { $this->propertiesCache[$name] = $this->getProperty($name); } } return $this->propertiesCache; } /** * Get a specific property from the parameter * * @param string $name Name of the property to retrieve * * @return null|Parameter */ public function getProperty($name) { if (!isset($this->properties[$name])) { return null; } if (!($this->properties[$name] instanceof self)) { $this->properties[$name]['name'] = $name; $this->properties[$name] = new static($this->properties[$name], $this->serviceDescription); $this->properties[$name]->setParent($this); } return $this->properties[$name]; } /** * Remove a property from the parameter * * @param string $name Name of the property to remove * * @return self */ public function removeProperty($name) { unset($this->properties[$name]); $this->propertiesCache = null; return $this; } /** * Add a property to the parameter * * @param Parameter $property Properties to set * * @return self */ public function addProperty(Parameter $property) { $this->properties[$property->getName()] = $property; $property->setParent($this); $this->propertiesCache = null; return $this; } /** * Get the additionalProperties value of the parameter * * @return bool|Parameter|null */ public function getAdditionalProperties() { if (is_array($this->additionalProperties)) { $this->additionalProperties = new static($this->additionalProperties, $this->serviceDescription); $this->additionalProperties->setParent($this); } return $this->additionalProperties; } /** * Set the additionalProperties value of the parameter * * @param bool|Parameter|null $additional Boolean to allow any, an Parameter to specify a schema, or false to disallow * * @return self */ public function setAdditionalProperties($additional) { $this->additionalProperties = $additional; return $this; } /** * Set the items data of the parameter * * @param Parameter|null $items Items to set * * @return self */ public function setItems(Parameter $items = null) { if ($this->items = $items) { $this->items->setParent($this); } return $this; } /** * Get the item data of the parameter * * @return Parameter|null */ public function getItems() { if (is_array($this->items)) { $this->items = new static($this->items, $this->serviceDescription); $this->items->setParent($this); } return $this->items; } /** * Get the class that the parameter must implement * * @return null|string */ public function getInstanceOf() { return $this->instanceOf; } /** * Set the class that the parameter must be an instance of * * @param string|null $instanceOf Class or interface name * * @return self */ public function setInstanceOf($instanceOf) { $this->instanceOf = $instanceOf; return $this; } /** * Get the enum of strings that are valid for the parameter * * @return array|null */ public function getEnum() { return $this->enum; } /** * Set the enum of strings that are valid for the parameter * * @param array|null $enum Array of strings or null * * @return self */ public function setEnum(array $enum = null) { $this->enum = $enum; return $this; } /** * Get the regex pattern that must match a value when the value is a string * * @return string */ public function getPattern() { return $this->pattern; } /** * Set the regex pattern that must match a value when the value is a string * * @param string $pattern Regex pattern * * @return self */ public function setPattern($pattern) { $this->pattern = $pattern; return $this; } /** * Get the format attribute of the schema * * @return string */ public function getFormat() { return $this->format; } /** * Set the format attribute of the schema * * @param string $format Format to set (e.g. date, date-time, timestamp, time, date-time-http) * * @return self */ public function setFormat($format) { $this->format = $format; return $this; } } src/Guzzle/Service/Description/SchemaFormatter.php000064400000010054151742734620016306 0ustar00format($format); } elseif (is_numeric($dateTime)) { return gmdate($format, (int) $dateTime); } elseif ($dateTime instanceof \DateTime) { return $dateTime->setTimezone(self::getUtcTimeZone())->format($format); } throw new InvalidArgumentException('Date/Time values must be either a string, integer, or DateTime object'); } } src/Guzzle/Service/Description/SchemaValidator.php000064400000027264151742734620016303 0ustar00castIntegerToStringType = $castIntegerToStringType; } /** * {@inheritdoc} */ public function validate(Parameter $param, &$value) { $this->errors = array(); $this->recursiveProcess($param, $value); if (empty($this->errors)) { return true; } else { sort($this->errors); return false; } } /** * Get the errors encountered while validating * * @return array */ public function getErrors() { return $this->errors ?: array(); } /** * Recursively validate a parameter * * @param Parameter $param API parameter being validated * @param mixed $value Value to validate and validate. The value may change during this validate. * @param string $path Current validation path (used for error reporting) * @param int $depth Current depth in the validation validate * * @return bool Returns true if valid, or false if invalid */ protected function recursiveProcess(Parameter $param, &$value, $path = '', $depth = 0) { // Update the value by adding default or static values $value = $param->getValue($value); $required = $param->getRequired(); // if the value is null and the parameter is not required or is static, then skip any further recursion if ((null === $value && !$required) || $param->getStatic()) { return true; } $type = $param->getType(); // Attempt to limit the number of times is_array is called by tracking if the value is an array $valueIsArray = is_array($value); // If a name is set then update the path so that validation messages are more helpful if ($name = $param->getName()) { $path .= "[{$name}]"; } if ($type == 'object') { // Objects are either associative arrays, ToArrayInterface, or some other object if ($param->getInstanceOf()) { $instance = $param->getInstanceOf(); if (!($value instanceof $instance)) { $this->errors[] = "{$path} must be an instance of {$instance}"; return false; } } // Determine whether or not this "value" has properties and should be traversed $traverse = $temporaryValue = false; // Convert the value to an array if (!$valueIsArray && $value instanceof ToArrayInterface) { $value = $value->toArray(); } if ($valueIsArray) { // Ensure that the array is associative and not numerically indexed if (isset($value[0])) { $this->errors[] = "{$path} must be an array of properties. Got a numerically indexed array."; return false; } $traverse = true; } elseif ($value === null) { // Attempt to let the contents be built up by default values if possible $value = array(); $temporaryValue = $valueIsArray = $traverse = true; } if ($traverse) { if ($properties = $param->getProperties()) { // if properties were found, the validate each property of the value foreach ($properties as $property) { $name = $property->getName(); if (isset($value[$name])) { $this->recursiveProcess($property, $value[$name], $path, $depth + 1); } else { $current = null; $this->recursiveProcess($property, $current, $path, $depth + 1); // Only set the value if it was populated with something if ($current) { $value[$name] = $current; } } } } $additional = $param->getAdditionalProperties(); if ($additional !== true) { // If additional properties were found, then validate each against the additionalProperties attr. $keys = array_keys($value); // Determine the keys that were specified that were not listed in the properties of the schema $diff = array_diff($keys, array_keys($properties)); if (!empty($diff)) { // Determine which keys are not in the properties if ($additional instanceOf Parameter) { foreach ($diff as $key) { $this->recursiveProcess($additional, $value[$key], "{$path}[{$key}]", $depth); } } else { // if additionalProperties is set to false and there are additionalProperties in the values, then fail $keys = array_keys($value); $this->errors[] = sprintf('%s[%s] is not an allowed property', $path, reset($keys)); } } } // A temporary value will be used to traverse elements that have no corresponding input value. // This allows nested required parameters with default values to bubble up into the input. // Here we check if we used a temp value and nothing bubbled up, then we need to remote the value. if ($temporaryValue && empty($value)) { $value = null; $valueIsArray = false; } } } elseif ($type == 'array' && $valueIsArray && $param->getItems()) { foreach ($value as $i => &$item) { // Validate each item in an array against the items attribute of the schema $this->recursiveProcess($param->getItems(), $item, $path . "[{$i}]", $depth + 1); } } // If the value is required and the type is not null, then there is an error if the value is not set if ($required && $value === null && $type != 'null') { $message = "{$path} is " . ($param->getType() ? ('a required ' . implode(' or ', (array) $param->getType())) : 'required'); if ($param->getDescription()) { $message .= ': ' . $param->getDescription(); } $this->errors[] = $message; return false; } // Validate that the type is correct. If the type is string but an integer was passed, the class can be // instructed to cast the integer to a string to pass validation. This is the default behavior. if ($type && (!$type = $this->determineType($type, $value))) { if ($this->castIntegerToStringType && $param->getType() == 'string' && is_integer($value)) { $value = (string) $value; } else { $this->errors[] = "{$path} must be of type " . implode(' or ', (array) $param->getType()); } } // Perform type specific validation for strings, arrays, and integers if ($type == 'string') { // Strings can have enums which are a list of predefined values if (($enum = $param->getEnum()) && !in_array($value, $enum)) { $this->errors[] = "{$path} must be one of " . implode(' or ', array_map(function ($s) { return '"' . addslashes($s) . '"'; }, $enum)); } // Strings can have a regex pattern that the value must match if (($pattern = $param->getPattern()) && !preg_match($pattern, $value)) { $this->errors[] = "{$path} must match the following regular expression: {$pattern}"; } $strLen = null; if ($min = $param->getMinLength()) { $strLen = strlen($value); if ($strLen < $min) { $this->errors[] = "{$path} length must be greater than or equal to {$min}"; } } if ($max = $param->getMaxLength()) { if (($strLen ?: strlen($value)) > $max) { $this->errors[] = "{$path} length must be less than or equal to {$max}"; } } } elseif ($type == 'array') { $size = null; if ($min = $param->getMinItems()) { $size = count($value); if ($size < $min) { $this->errors[] = "{$path} must contain {$min} or more elements"; } } if ($max = $param->getMaxItems()) { if (($size ?: count($value)) > $max) { $this->errors[] = "{$path} must contain {$max} or fewer elements"; } } } elseif ($type == 'integer' || $type == 'number' || $type == 'numeric') { if (($min = $param->getMinimum()) && $value < $min) { $this->errors[] = "{$path} must be greater than or equal to {$min}"; } if (($max = $param->getMaximum()) && $value > $max) { $this->errors[] = "{$path} must be less than or equal to {$max}"; } } return empty($this->errors); } /** * From the allowable types, determine the type that the variable matches * * @param string $type Parameter type * @param mixed $value Value to determine the type * * @return string|bool Returns the matching type on */ protected function determineType($type, $value) { foreach ((array) $type as $t) { if ($t == 'string' && (is_string($value) || (is_object($value) && method_exists($value, '__toString')))) { return 'string'; } elseif ($t == 'object' && (is_array($value) || is_object($value))) { return 'object'; } elseif ($t == 'array' && is_array($value)) { return 'array'; } elseif ($t == 'integer' && is_integer($value)) { return 'integer'; } elseif ($t == 'boolean' && is_bool($value)) { return 'boolean'; } elseif ($t == 'number' && is_numeric($value)) { return 'number'; } elseif ($t == 'numeric' && is_numeric($value)) { return 'numeric'; } elseif ($t == 'null' && !$value) { return 'null'; } elseif ($t == 'any') { return 'any'; } } return false; } } src/Guzzle/Service/Description/ServiceDescription.php000064400000017371151742734620017037 0ustar00load($config, $options); } /** * Create a new ServiceDescription * * @param array $config Array of configuration data */ public function __construct(array $config = array()) { $this->fromArray($config); } /** * Serialize the service description * * @return string */ public function serialize() { $result = array( 'name' => $this->name, 'apiVersion' => $this->apiVersion, 'baseUrl' => $this->baseUrl, 'description' => $this->description ) + $this->extraData; $result['operations'] = array(); foreach ($this->getOperations() as $name => $operation) { $result['operations'][$operation->getName() ?: $name] = $operation->toArray(); } if (!empty($this->models)) { $result['models'] = array(); foreach ($this->models as $id => $model) { $result['models'][$id] = $model instanceof Parameter ? $model->toArray(): $model; } } return json_encode(array_filter($result)); } /** * Unserialize the service description * * @param string|array $json JSON data */ public function unserialize($json) { $this->operations = array(); $this->fromArray(json_decode($json, true)); } /** * {@inheritdoc} */ public function getBaseUrl() { return $this->baseUrl; } /** * Set the baseUrl of the description * * @param string $baseUrl Base URL of each operation * * @return self */ public function setBaseUrl($baseUrl) { $this->baseUrl = $baseUrl; return $this; } /** * {@inheritdoc} */ public function getOperations() { foreach (array_keys($this->operations) as $name) { $this->getOperation($name); } return $this->operations; } /** * {@inheritdoc} */ public function hasOperation($name) { return isset($this->operations[$name]); } /** * {@inheritdoc} */ public function getOperation($name) { // Lazily retrieve and build operations if (!isset($this->operations[$name])) { return null; } if (!($this->operations[$name] instanceof Operation)) { $this->operations[$name] = new Operation($this->operations[$name], $this); } return $this->operations[$name]; } /** * Add a operation to the service description * * @param OperationInterface $operation Operation to add * * @return self */ public function addOperation(OperationInterface $operation) { $this->operations[$operation->getName()] = $operation->setServiceDescription($this); return $this; } /** * {@inheritdoc} */ public function getModel($id) { if (!isset($this->models[$id])) { return null; } if (!($this->models[$id] instanceof Parameter)) { $this->models[$id] = new Parameter($this->models[$id], $this); } return $this->models[$id]; } /** * {@inheritdoc} */ public function getModels() { // Ensure all models are converted into parameter objects foreach (array_keys($this->models) as $id) { $this->getModel($id); } return $this->models; } /** * {@inheritdoc} */ public function hasModel($id) { return isset($this->models[$id]); } /** * Add a model to the service description * * @param Parameter $model Model to add * * @return self */ public function addModel(Parameter $model) { $this->models[$model->getName()] = $model; return $this; } /** * {@inheritdoc} */ public function getApiVersion() { return $this->apiVersion; } /** * {@inheritdoc} */ public function getName() { return $this->name; } /** * {@inheritdoc} */ public function getDescription() { return $this->description; } /** * {@inheritdoc} */ public function getData($key) { return isset($this->extraData[$key]) ? $this->extraData[$key] : null; } /** * {@inheritdoc} */ public function setData($key, $value) { $this->extraData[$key] = $value; return $this; } /** * Initialize the state from an array * * @param array $config Configuration data * @throws InvalidArgumentException */ protected function fromArray(array $config) { // Keep a list of default keys used in service descriptions that is later used to determine extra data keys $defaultKeys = array('name', 'models', 'apiVersion', 'baseUrl', 'description'); // Pull in the default configuration values foreach ($defaultKeys as $key) { if (isset($config[$key])) { $this->{$key} = $config[$key]; } } // Account for the Swagger name for Guzzle's baseUrl if (isset($config['basePath'])) { $this->baseUrl = $config['basePath']; } // Ensure that the models and operations properties are always arrays $this->models = (array) $this->models; $this->operations = (array) $this->operations; // We want to add operations differently than adding the other properties $defaultKeys[] = 'operations'; // Create operations for each operation if (isset($config['operations'])) { foreach ($config['operations'] as $name => $operation) { if (!($operation instanceof Operation) && !is_array($operation)) { throw new InvalidArgumentException('Invalid operation in service description: ' . gettype($operation)); } $this->operations[$name] = $operation; } } // Get all of the additional properties of the service description and store them in a data array foreach (array_diff(array_keys($config), $defaultKeys) as $key) { $this->extraData[$key] = $config[$key]; } } } src/Guzzle/Service/Description/ServiceDescriptionInterface.php000064400000004261151742734620020652 0ustar00 $op) { $name = $op['name'] = isset($op['name']) ? $op['name'] : $name; // Extend other operations if (!empty($op['extends'])) { $this->resolveExtension($name, $op, $operations); } $op['parameters'] = isset($op['parameters']) ? $op['parameters'] : array(); $operations[$name] = $op; } } return new ServiceDescription(array( 'apiVersion' => isset($config['apiVersion']) ? $config['apiVersion'] : null, 'baseUrl' => isset($config['baseUrl']) ? $config['baseUrl'] : null, 'description' => isset($config['description']) ? $config['description'] : null, 'operations' => $operations, 'models' => isset($config['models']) ? $config['models'] : null ) + $config); } /** * @param string $name Name of the operation * @param array $op Operation value array * @param array $operations Currently loaded operations * @throws DescriptionBuilderException when extending a non-existent operation */ protected function resolveExtension($name, array &$op, array &$operations) { $resolved = array(); $original = empty($op['parameters']) ? false: $op['parameters']; $hasClass = !empty($op['class']); foreach ((array) $op['extends'] as $extendedCommand) { if (empty($operations[$extendedCommand])) { throw new DescriptionBuilderException("{$name} extends missing operation {$extendedCommand}"); } $toArray = $operations[$extendedCommand]; $resolved = empty($resolved) ? $toArray['parameters'] : array_merge($resolved, $toArray['parameters']); $op = $op + $toArray; if (!$hasClass && isset($toArray['class'])) { $op['class'] = $toArray['class']; } } $op['parameters'] = $original ? array_merge($resolved, $original) : $resolved; } } src/Guzzle/Service/Description/ValidatorInterface.php000064400000001721151742734620016771 0ustar00getMessage(), $e->getCode(), $e->getPrevious()); return $ce->setExceptions($e->getIterator()->getArrayCopy()) ->setSuccessfulRequests($e->getSuccessfulRequests()) ->setFailedRequests($e->getFailedRequests()); } /** * Get all of the commands in the transfer * * @return array */ public function getAllCommands() { return array_merge($this->successfulCommands, $this->failedCommands); } /** * Add to the array of successful commands * * @param CommandInterface $command Successful command * * @return self */ public function addSuccessfulCommand(CommandInterface $command) { $this->successfulCommands[] = $command; return $this; } /** * Add to the array of failed commands * * @param CommandInterface $command Failed command * * @return self */ public function addFailedCommand(CommandInterface $command) { $this->failedCommands[] = $command; return $this; } /** * Get an array of successful commands * * @return array */ public function getSuccessfulCommands() { return $this->successfulCommands; } /** * Get an array of failed commands * * @return array */ public function getFailedCommands() { return $this->failedCommands; } } src/Guzzle/Service/Exception/DescriptionBuilderException.php000064400000000231151742734620020342 0ustar00invalidCommands = $commands; parent::__construct( 'Encountered commands in a batch transfer that use inconsistent clients. The batching ' . 'strategy you use with a command transfer must divide command batches by client.' ); } /** * Get the invalid commands * * @return array */ public function getCommands() { return $this->invalidCommands; } } src/Guzzle/Service/Exception/ResponseClassException.php000064400000000225151742734620017337 0ustar00errors = $errors; } /** * Get any validation errors * * @return array */ public function getErrors() { return $this->errors; } } src/Guzzle/Service/Resource/AbstractResourceIteratorFactory.php000064400000002137151742734620021046 0ustar00canBuild($command)) { throw new InvalidArgumentException('Iterator was not found for ' . $command->getName()); } $className = $this->getClassName($command); return new $className($command, $options); } /** * {@inheritdoc} */ public function canBuild(CommandInterface $command) { return (bool) $this->getClassName($command); } /** * Get the name of the class to instantiate for the command * * @param CommandInterface $command Command that is associated with the iterator * * @return string */ abstract protected function getClassName(CommandInterface $command); } src/Guzzle/Service/Resource/CompositeResourceIteratorFactory.php000064400000003521151742734620021243 0ustar00factories = $factories; } /** * {@inheritdoc} */ public function build(CommandInterface $command, array $options = array()) { if (!($factory = $this->getFactory($command))) { throw new InvalidArgumentException('Iterator was not found for ' . $command->getName()); } return $factory->build($command, $options); } /** * {@inheritdoc} */ public function canBuild(CommandInterface $command) { return $this->getFactory($command) !== false; } /** * Add a factory to the composite factory * * @param ResourceIteratorFactoryInterface $factory Factory to add * * @return self */ public function addFactory(ResourceIteratorFactoryInterface $factory) { $this->factories[] = $factory; return $this; } /** * Get the factory that matches the command object * * @param CommandInterface $command Command retrieving the iterator for * * @return ResourceIteratorFactoryInterface|bool */ protected function getFactory(CommandInterface $command) { foreach ($this->factories as $factory) { if ($factory->canBuild($command)) { return $factory; } } return false; } } src/Guzzle/Service/Resource/MapResourceIteratorFactory.php000064400000001705151742734620020020 0ustar00map = $map; } /** * {@inheritdoc} */ public function getClassName(CommandInterface $command) { $className = $command->getName(); if (isset($this->map[$className])) { return $this->map[$className]; } elseif (isset($this->map['*'])) { // If a wildcard was added, then always use that return $this->map['*']; } return null; } } src/Guzzle/Service/Resource/Model.php000064400000001464151742734620013573 0ustar00data = $data; $this->structure = $structure ?: new Parameter(); } /** * Get the structure of the model * * @return Parameter */ public function getStructure() { return $this->structure; } } src/Guzzle/Service/Resource/ResourceIterator.php000064400000020514151742734620016031 0ustar00originalCommand = $command; // Parse options from the array of options $this->data = $data; $this->limit = array_key_exists('limit', $data) ? $data['limit'] : 0; $this->pageSize = array_key_exists('page_size', $data) ? $data['page_size'] : false; } /** * Get all of the resources as an array (Warning: this could issue a large number of requests) * * @return array */ public function toArray() { return iterator_to_array($this, false); } /** * {@inheritdoc} */ public function setLimit($limit) { $this->limit = $limit; $this->resetState(); return $this; } /** * {@inheritdoc} */ public function setPageSize($pageSize) { $this->pageSize = $pageSize; $this->resetState(); return $this; } /** * Get an option from the iterator * * @param string $key Key of the option to retrieve * * @return mixed|null Returns NULL if not set or the value if set */ public function get($key) { return array_key_exists($key, $this->data) ? $this->data[$key] : null; } /** * Set an option on the iterator * * @param string $key Key of the option to set * @param mixed $value Value to set for the option * * @return ResourceIterator */ public function set($key, $value) { $this->data[$key] = $value; return $this; } /** * Return the current element. * * @return mixed Returns the current element. */ public function current() { return $this->resources ? current($this->resources) : false; } /** * Return the key of the current element. * * @return mixed */ public function key() { return max(0, $this->iteratedCount - 1); } /** * Return the total number of items that have been retrieved thus far. * * @return int */ public function count() { return $this->retrievedCount; } /** * Get the total number of requests sent * * @return int */ public function getRequestCount() { return $this->requestCount; } /** * Rewind the Iterator to the first element and send the original command */ public function rewind() { // Use the original command $this->command = clone $this->originalCommand; $this->resetState(); $this->next(); } /** * Check if there is a current element after calls to rewind() or next(). * * @return bool Returns TRUE if the current element is valid or FALSE */ public function valid() { return !$this->invalid && (!$this->resources || $this->current() || $this->nextToken) && (!$this->limit || $this->iteratedCount < $this->limit + 1); } /** * Move forward to next element and may trigger subsequent requests */ public function next() { $this->iteratedCount++; // Check if a new set of resources needs to be retrieved $sendRequest = false; if (!$this->resources) { $sendRequest = true; } else { // iterate over the internal array $current = next($this->resources); $sendRequest = $current === false && $this->nextToken && (!$this->limit || $this->iteratedCount < $this->limit + 1); } if ($sendRequest) { $this->dispatch('resource_iterator.before_send', array( 'iterator' => $this, 'resources' => $this->resources )); // Get a new command object from the original command $this->command = clone $this->originalCommand; // Send a request and retrieve the newly loaded resources $this->resources = $this->sendRequest(); $this->requestCount++; // If no resources were found, then the last request was not needed // and iteration must stop if (empty($this->resources)) { $this->invalid = true; } else { // Add to the number of retrieved resources $this->retrievedCount += count($this->resources); // Ensure that we rewind to the beginning of the array reset($this->resources); } $this->dispatch('resource_iterator.after_send', array( 'iterator' => $this, 'resources' => $this->resources )); } } /** * Retrieve the NextToken that can be used in other iterators. * * @return string Returns a NextToken */ public function getNextToken() { return $this->nextToken; } /** * Returns the value that should be specified for the page size for a request that will maintain any hard limits, * but still honor the specified pageSize if the number of items retrieved + pageSize < hard limit * * @return int Returns the page size of the next request. */ protected function calculatePageSize() { if ($this->limit && $this->iteratedCount + $this->pageSize > $this->limit) { return 1 + ($this->limit - $this->iteratedCount); } return (int) $this->pageSize; } /** * Reset the internal state of the iterator without triggering a rewind() */ protected function resetState() { $this->iteratedCount = 0; $this->retrievedCount = 0; $this->nextToken = false; $this->resources = null; $this->invalid = false; } /** * Send a request to retrieve the next page of results. Hook for subclasses to implement. * * @return array Returns the newly loaded resources */ abstract protected function sendRequest(); } src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.php000064400000006346151742734620020321 0ustar00iterator = $iterator; $this->callback = $callback; } /** * Apply the callback to the contents of the resource iterator * * @param int $perBatch The number of records to group per batch transfer * * @return int Returns the number of iterated resources */ public function apply($perBatch = 50) { $this->iterated = $this->batches = $batches = 0; $that = $this; $it = $this->iterator; $callback = $this->callback; $batch = BatchBuilder::factory() ->createBatchesWith(new BatchSizeDivisor($perBatch)) ->transferWith(new BatchClosureTransfer(function (array $batch) use ($that, $callback, &$batches, $it) { $batches++; $that->dispatch('iterator_batch.before_batch', array('iterator' => $it, 'batch' => $batch)); call_user_func_array($callback, array($it, $batch)); $that->dispatch('iterator_batch.after_batch', array('iterator' => $it, 'batch' => $batch)); })) ->autoFlushAt($perBatch) ->build(); $this->dispatch('iterator_batch.created_batch', array('batch' => $batch)); foreach ($this->iterator as $resource) { $this->iterated++; $batch->add($resource); } $batch->flush(); $this->batches = $batches; return $this->iterated; } /** * Get the total number of batches sent * * @return int */ public function getBatchCount() { return $this->batches; } /** * Get the total number of iterated resources * * @return int */ public function getIteratedCount() { return $this->iterated; } } src/Guzzle/Service/Resource/ResourceIteratorClassFactory.php000064400000004005151742734620020344 0ustar00 AbcFoo). */ class ResourceIteratorClassFactory extends AbstractResourceIteratorFactory { /** * @var array List of namespaces used to look for classes */ protected $namespaces; /** * @var InflectorInterface Inflector used to determine class names */ protected $inflector; /** * @param string|array $namespaces List of namespaces for iterator objects * @param InflectorInterface $inflector Inflector used to resolve class names */ public function __construct($namespaces = array(), InflectorInterface $inflector = null) { $this->namespaces = (array) $namespaces; $this->inflector = $inflector ?: Inflector::getDefault(); } /** * Registers a namespace to check for Iterators * * @param string $namespace Namespace which contains Iterator classes * * @return self */ public function registerNamespace($namespace) { array_unshift($this->namespaces, $namespace); return $this; } /** * {@inheritdoc} */ protected function getClassName(CommandInterface $command) { $iteratorName = $this->inflector->camel($command->getName()) . 'Iterator'; // Determine the name of the class to load foreach ($this->namespaces as $namespace) { $potentialClassName = $namespace . '\\' . $iteratorName; if (class_exists($potentialClassName)) { return $potentialClassName; } } return false; } } src/Guzzle/Service/Resource/ResourceIteratorFactoryInterface.php000064400000001420151742734620021175 0ustar00=5.3.2", "guzzle/cache": "self.version", "guzzle/http": "self.version", "guzzle/inflection": "self.version" }, "autoload": { "psr-0": { "Guzzle\\Service": "" } }, "target-dir": "Guzzle/Service", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } src/Guzzle/Stream/PhpStreamRequestFactory.php000064400000020735151742734620015405 0ustar00contextOptions = stream_context_get_options($context); $this->context = $context; } elseif (is_array($context) || !$context) { $this->contextOptions = $context; $this->createContext($params); } elseif ($context) { throw new InvalidArgumentException('$context must be an array or resource'); } $this->setUrl($request); $this->addDefaultContextOptions($request); $this->addSslOptions($request); $this->addBodyOptions($request); $this->addProxyOptions($request); // Dispatch the before send event $request->dispatch('request.before_send', array( 'request' => $request, 'context' => $this->context, 'context_options' => $this->contextOptions )); // Create the file handle but silence errors return $this->createStream($params) ->setCustomData('request', $request) ->setCustomData('response_headers', $this->getLastResponseHeaders()); } /** * Set an option on the context and the internal options array * * @param string $wrapper Stream wrapper name of http * @param string $name Context name * @param mixed $value Context value * @param bool $overwrite Set to true to overwrite an existing value */ protected function setContextValue($wrapper, $name, $value, $overwrite = false) { if (!isset($this->contextOptions[$wrapper])) { $this->contextOptions[$wrapper] = array($name => $value); } elseif (!$overwrite && isset($this->contextOptions[$wrapper][$name])) { return; } $this->contextOptions[$wrapper][$name] = $value; stream_context_set_option($this->context, $wrapper, $name, $value); } /** * Create a stream context * * @param array $params Parameter array */ protected function createContext(array $params) { $options = $this->contextOptions; $this->context = $this->createResource(function () use ($params, $options) { return stream_context_create($options, $params); }); } /** * Get the last response headers received by the HTTP request * * @return array */ public function getLastResponseHeaders() { return $this->lastResponseHeaders; } /** * Adds the default context options to the stream context options * * @param RequestInterface $request Request */ protected function addDefaultContextOptions(RequestInterface $request) { $this->setContextValue('http', 'method', $request->getMethod()); $this->setContextValue('http', 'header', $request->getHeaderLines()); // Force 1.0 for now until PHP fully support chunked transfer-encoding decoding $this->setContextValue('http', 'protocol_version', '1.0'); $this->setContextValue('http', 'ignore_errors', true); } /** * Set the URL to use with the factory * * @param RequestInterface $request Request that owns the URL */ protected function setUrl(RequestInterface $request) { $this->url = $request->getUrl(true); // Check for basic Auth username if ($request->getUsername()) { $this->url->setUsername($request->getUsername()); } // Check for basic Auth password if ($request->getPassword()) { $this->url->setPassword($request->getPassword()); } } /** * Add SSL options to the stream context * * @param RequestInterface $request Request */ protected function addSslOptions(RequestInterface $request) { if ($verify = $request->getCurlOptions()->get(CURLOPT_SSL_VERIFYPEER)) { $this->setContextValue('ssl', 'verify_peer', true, true); if ($cafile = $request->getCurlOptions()->get(CURLOPT_CAINFO)) { $this->setContextValue('ssl', 'cafile', $cafile, true); } } else { $this->setContextValue('ssl', 'verify_peer', false, true); } } /** * Add body (content) specific options to the context options * * @param RequestInterface $request */ protected function addBodyOptions(RequestInterface $request) { // Add the content for the request if needed if (!($request instanceof EntityEnclosingRequestInterface)) { return; } if (count($request->getPostFields())) { $this->setContextValue('http', 'content', (string) $request->getPostFields(), true); } elseif ($request->getBody()) { $this->setContextValue('http', 'content', (string) $request->getBody(), true); } // Always ensure a content-length header is sent if (isset($this->contextOptions['http']['content'])) { $headers = isset($this->contextOptions['http']['header']) ? $this->contextOptions['http']['header'] : array(); $headers[] = 'Content-Length: ' . strlen($this->contextOptions['http']['content']); $this->setContextValue('http', 'header', $headers, true); } } /** * Add proxy parameters to the context if needed * * @param RequestInterface $request Request */ protected function addProxyOptions(RequestInterface $request) { if ($proxy = $request->getCurlOptions()->get(CURLOPT_PROXY)) { $this->setContextValue('http', 'proxy', $proxy); } } /** * Create the stream for the request with the context options * * @param array $params Parameters of the stream * * @return StreamInterface */ protected function createStream(array $params) { $http_response_header = null; $url = $this->url; $context = $this->context; $fp = $this->createResource(function () use ($context, $url, &$http_response_header) { return fopen((string) $url, 'r', false, $context); }); // Track the response headers of the request if (isset($http_response_header)) { $this->lastResponseHeaders = $http_response_header; } // Determine the class to instantiate $className = isset($params['stream_class']) ? $params['stream_class'] : __NAMESPACE__ . '\\Stream'; return new $className($fp); } /** * Create a resource and check to ensure it was created successfully * * @param callable $callback Closure to invoke that must return a valid resource * * @return resource * @throws RuntimeException on error */ protected function createResource($callback) { // Turn off error reporting while we try to initiate the request $level = error_reporting(0); $resource = call_user_func($callback); error_reporting($level); // If the resource could not be created, then grab the last error and throw an exception if (false === $resource) { $message = 'Error creating resource. '; foreach (error_get_last() as $key => $value) { $message .= "[{$key}] {$value} "; } throw new RuntimeException(trim($message)); } return $resource; } } src/Guzzle/Stream/Stream.php000064400000020314151742734620012025 0ustar00 array( 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true ), 'write' => array( 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true ) ); /** * Construct a new Stream * * @param resource $stream Stream resource to wrap * @param int $size Size of the stream in bytes. Only pass if the size cannot be obtained from the stream. * * @throws InvalidArgumentException if the stream is not a stream resource */ public function __construct($stream, $size = null) { $this->setStream($stream, $size); } /** * Closes the stream when the helper is destructed */ public function __destruct() { $this->close(); } /** * {@inheritdoc} */ public function __toString() { if (!$this->isReadable() || (!$this->isSeekable() && $this->isConsumed())) { return ''; } $originalPos = $this->ftell(); $body = stream_get_contents($this->stream, -1, 0); $this->seek($originalPos); return $body; } /** * {@inheritdoc} */ public function close() { if (is_resource($this->stream)) { fclose($this->stream); } $this->cache[self::IS_READABLE] = false; $this->cache[self::IS_WRITABLE] = false; } /** * Calculate a hash of a Stream * * @param StreamInterface $stream Stream to calculate the hash for * @param string $algo Hash algorithm (e.g. md5, crc32, etc) * @param bool $rawOutput Whether or not to use raw output * * @return bool|string Returns false on failure or a hash string on success */ public static function getHash(StreamInterface $stream, $algo, $rawOutput = false) { $pos = $stream->ftell(); if (!$stream->seek(0)) { return false; } $ctx = hash_init($algo); while ($data = $stream->read(8192)) { hash_update($ctx, $data); } $out = hash_final($ctx, (bool) $rawOutput); $stream->seek($pos); return $out; } /** * {@inheritdoc} */ public function getMetaData($key = null) { $meta = stream_get_meta_data($this->stream); return !$key ? $meta : (array_key_exists($key, $meta) ? $meta[$key] : null); } /** * {@inheritdoc} */ public function getStream() { return $this->stream; } /** * {@inheritdoc} */ public function setStream($stream, $size = null) { if (!is_resource($stream)) { throw new InvalidArgumentException('Stream must be a resource'); } $this->size = $size; $this->stream = $stream; $this->rebuildCache(); return $this; } /** * {@inheritdoc} */ public function getWrapper() { return $this->cache[self::WRAPPER_TYPE]; } /** * {@inheritdoc} */ public function getWrapperData() { return $this->getMetaData('wrapper_data') ?: array(); } /** * {@inheritdoc} */ public function getStreamType() { return $this->cache[self::STREAM_TYPE]; } /** * {@inheritdoc} */ public function getUri() { return $this->cache['uri']; } /** * {@inheritdoc} */ public function getSize() { if ($this->size !== null) { return $this->size; } // If the stream is a file based stream and local, then use fstat if ($this->isLocal()) { $stats = fstat($this->stream); if (isset($stats['size'])) { return $stats['size']; } } // Only get the size based on the content if the the stream is readable and seekable if (!$this->cache[self::IS_READABLE] || !$this->cache[self::SEEKABLE]) { return false; } else { $pos = $this->ftell(); $this->size = strlen((string) $this); $this->seek($pos); return $this->size; } } /** * {@inheritdoc} */ public function isReadable() { return $this->cache[self::IS_READABLE]; } /** * {@inheritdoc} */ public function isWritable() { return $this->cache[self::IS_WRITABLE]; } /** * {@inheritdoc} */ public function isConsumed() { return feof($this->stream); } /** * {@inheritdoc} */ public function feof() { return $this->isConsumed(); } /** * {@inheritdoc} */ public function isLocal() { return $this->cache[self::IS_LOCAL]; } /** * {@inheritdoc} */ public function isSeekable() { return $this->cache[self::SEEKABLE]; } /** * {@inheritdoc} */ public function setSize($size) { $this->size = $size; return $this; } /** * {@inheritdoc} */ public function seek($offset, $whence = SEEK_SET) { return $this->cache[self::SEEKABLE] ? fseek($this->stream, $offset, $whence) === 0 : false; } /** * {@inheritdoc} */ public function read($length) { return $this->cache[self::IS_READABLE] ? fread($this->stream, $length) : false; } /** * {@inheritdoc} */ public function write($string) { if (!$this->cache[self::IS_WRITABLE]) { return 0; } $bytes = fwrite($this->stream, $string); // We can't know the size after writing if any bytes were written if ($bytes) { $this->size = null; } return $bytes; } /** * {@inheritdoc} */ public function ftell() { return ftell($this->stream); } /** * {@inheritdoc} */ public function rewind() { return $this->seek(0); } /** * {@inheritdoc} */ public function readLine($maxLength = null) { if (!$this->cache[self::IS_READABLE]) { return false; } else { return $maxLength ? fgets($this->getStream(), $maxLength) : fgets($this->getStream()); } } /** * {@inheritdoc} */ public function setCustomData($key, $value) { $this->customData[$key] = $value; return $this; } /** * {@inheritdoc} */ public function getCustomData($key) { return isset($this->customData[$key]) ? $this->customData[$key] : null; } /** * Reprocess stream metadata */ protected function rebuildCache() { $this->cache = stream_get_meta_data($this->stream); $this->cache[self::IS_LOCAL] = stream_is_local($this->stream); $this->cache[self::IS_READABLE] = isset(self::$readWriteHash['read'][$this->cache['mode']]); $this->cache[self::IS_WRITABLE] = isset(self::$readWriteHash['write'][$this->cache['mode']]); } } src/Guzzle/Stream/StreamInterface.php000064400000010505151742734620013647 0ustar00=5.3.2", "guzzle/common": "self.version" }, "suggest": { "guzzle/http": "To convert Guzzle request objects to PHP streams" }, "autoload": { "psr-0": { "Guzzle\\Stream": "" } }, "target-dir": "Guzzle/Stream", "extra": { "branch-alias": { "dev-master": "3.3-dev" } } } tests/Guzzle/Tests/Batch/AbstractBatchDecoratorTest.php000064400000002044151742734620017245 0ustar00getMock('Guzzle\Batch\BatchTransferInterface'), $this->getMock('Guzzle\Batch\BatchDivisorInterface') ); $decoratorA = $this->getMockBuilder('Guzzle\Batch\AbstractBatchDecorator') ->setConstructorArgs(array($batch)) ->getMockForAbstractClass(); $decoratorB = $this->getMockBuilder('Guzzle\Batch\AbstractBatchDecorator') ->setConstructorArgs(array($decoratorA)) ->getMockForAbstractClass(); $decoratorA->add('foo'); $this->assertFalse($decoratorB->isEmpty()); $this->assertFalse($batch->isEmpty()); $this->assertEquals(array($decoratorB, $decoratorA), $decoratorB->getDecorators()); $this->assertEquals(array(), $decoratorB->flush()); } } tests/Guzzle/Tests/Batch/BatchBuilderTest.php000064400000005041151742734620015225 0ustar00getMock('Guzzle\Batch\BatchTransferInterface'); } private function getMockDivisor() { return $this->getMock('Guzzle\Batch\BatchDivisorInterface'); } private function getMockBatchBuilder() { return BatchBuilder::factory() ->transferWith($this->getMockTransfer()) ->createBatchesWith($this->getMockDivisor()); } public function testFactoryCreatesInstance() { $builder = BatchBuilder::factory(); $this->assertInstanceOf('Guzzle\Batch\BatchBuilder', $builder); } public function testAddsAutoFlush() { $batch = $this->getMockBatchBuilder()->autoFlushAt(10)->build(); $this->assertInstanceOf('Guzzle\Batch\FlushingBatch', $batch); } public function testAddsExceptionBuffering() { $batch = $this->getMockBatchBuilder()->bufferExceptions()->build(); $this->assertInstanceOf('Guzzle\Batch\ExceptionBufferingBatch', $batch); } public function testAddHistory() { $batch = $this->getMockBatchBuilder()->keepHistory()->build(); $this->assertInstanceOf('Guzzle\Batch\HistoryBatch', $batch); } public function testAddsNotify() { $batch = $this->getMockBatchBuilder()->notify(function() {})->build(); $this->assertInstanceOf('Guzzle\Batch\NotifyingBatch', $batch); } /** * @expectedException Guzzle\Common\Exception\RuntimeException */ public function testTransferStrategyMustBeSet() { $batch = BatchBuilder::factory()->createBatchesWith($this->getMockDivisor())->build(); } /** * @expectedException Guzzle\Common\Exception\RuntimeException */ public function testDivisorStrategyMustBeSet() { $batch = BatchBuilder::factory()->transferWith($this->getMockTransfer())->build(); } public function testTransfersRequests() { $batch = BatchBuilder::factory()->transferRequests(10)->build(); $this->assertInstanceOf('Guzzle\Batch\BatchRequestTransfer', $this->readAttribute($batch, 'transferStrategy')); } public function testTransfersCommands() { $batch = BatchBuilder::factory()->transferCommands(10)->build(); $this->assertInstanceOf('Guzzle\Batch\BatchCommandTransfer', $this->readAttribute($batch, 'transferStrategy')); } } tests/Guzzle/Tests/Batch/BatchClosureDivisorTest.php000064400000001543151742734620016616 0ustar00createBatches($queue); $this->assertEquals(array(array('foo'), array('baz')), $batches); } } tests/Guzzle/Tests/Batch/BatchClosureTransferTest.php000064400000002630151742734620016761 0ustar00itemsTransferred = null; $itemsTransferred =& $this->itemsTransferred; $this->transferStrategy = new BatchClosureTransfer(function (array $batch) use (&$itemsTransferred) { $itemsTransferred = $batch; return; }); } public function testTransfersBatch() { $batchedItems = array('foo', 'bar', 'baz'); $this->transferStrategy->transfer($batchedItems); $this->assertEquals($batchedItems, $this->itemsTransferred); } public function testTransferBailsOnEmptyBatch() { $batchedItems = array(); $this->transferStrategy->transfer($batchedItems); $this->assertNull($this->itemsTransferred); } /** * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testEnsuresCallableIsCallable() { $foo = new BatchClosureTransfer('uh oh!'); } } tests/Guzzle/Tests/Batch/BatchCommandTransferTest.php000064400000004650151742734620016727 0ustar00 $command) { if ($i % 2) { $command->setClient($client1); } else { $command->setClient($client2); } $queue[] = $command; } $batch = new BatchCommandTransfer(2); $this->assertEquals(array( array($commands[0], $commands[2]), array($commands[4]), array($commands[1], $commands[3]) ), $batch->createBatches($queue)); } /** * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testEnsuresAllItemsAreCommands() { $queue = new \SplQueue(); $queue[] = 'foo'; $batch = new BatchCommandTransfer(2); $batch->createBatches($queue); } public function testTransfersBatches() { $client = $this->getMockBuilder('Guzzle\Service\Client') ->setMethods(array('send')) ->getMock(); $client->expects($this->once()) ->method('send'); $command = new Mc(); $command->setClient($client); $batch = new BatchCommandTransfer(2); $batch->transfer(array($command)); } public function testDoesNotTransfersEmptyBatches() { $batch = new BatchCommandTransfer(2); $batch->transfer(array()); } /** * @expectedException Guzzle\Service\Exception\InconsistentClientTransferException */ public function testEnsuresAllCommandsUseTheSameClient() { $batch = new BatchCommandTransfer(2); $client1 = new Client('http://www.example.com'); $client2 = new Client('http://www.example.com'); $command1 = new Mc(); $command1->setClient($client1); $command2 = new Mc(); $command2->setClient($client2); $batch->transfer(array($command1, $command2)); } } tests/Guzzle/Tests/Batch/BatchRequestTransferTest.php000064400000004562151742734620017003 0ustar00setCurlMulti(new CurlMulti()); $client2 = new Client('http://www.example.com'); $client2->setCurlMulti(new CurlMulti()); $request1 = $client1->get(); $request2 = $client2->get(); $request3 = $client1->get(); $request4 = $client2->get(); $request5 = $client1->get(); $queue = new \SplQueue(); $queue[] = $request1; $queue[] = $request2; $queue[] = $request3; $queue[] = $request4; $queue[] = $request5; $batch = new BatchRequestTransfer(2); $this->assertEquals(array( array($request1, $request3), array($request3), array($request2, $request4) ), $batch->createBatches($queue)); } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException */ public function testEnsuresAllItemsAreRequests() { $queue = new \SplQueue(); $queue[] = 'foo'; $batch = new BatchRequestTransfer(2); $batch->createBatches($queue); } public function testTransfersBatches() { $client = new Client('http://localhost:123'); $request = $client->get(); // For some reason... PHP unit clones the request, which emits a request.clone event. This causes the // 'sorted' property of the event dispatcher to contain an array in the cloned request that is not present in // the original. $request->dispatch('request.clone'); $multi = $this->getMock('Guzzle\Http\Curl\CurlMultiInterface'); $client->setCurlMulti($multi); $multi->expects($this->once()) ->method('add') ->with($request); $multi->expects($this->once()) ->method('send'); $batch = new BatchRequestTransfer(2); $batch->transfer(array($request)); } public function testDoesNotTransfersEmptyBatches() { $batch = new BatchRequestTransfer(2); $batch->transfer(array()); } } tests/Guzzle/Tests/Batch/BatchSizeDivisorTest.php000064400000001116151742734620016110 0ustar00assertEquals(3, $d->getSize()); $d->setSize(2); $batches = $d->createBatches($queue); $this->assertEquals(array(array('foo', 'baz'), array('bar')), $batches); } } tests/Guzzle/Tests/Batch/BatchTest.php000064400000005425151742734620013724 0ustar00getMock('Guzzle\Batch\BatchTransferInterface'); } private function getMockDivisor() { return $this->getMock('Guzzle\Batch\BatchDivisorInterface'); } public function testAddsItemsToQueue() { $batch = new Batch($this->getMockTransfer(), $this->getMockDivisor()); $this->assertSame($batch, $batch->add('foo')); $this->assertEquals(1, count($batch)); } public function testFlushReturnsItems() { $transfer = $this->getMockTransfer(); $transfer->expects($this->exactly(2)) ->method('transfer'); $divisor = $this->getMockDivisor(); $divisor->expects($this->once()) ->method('createBatches') ->will($this->returnValue(array(array('foo', 'baz'), array('bar')))); $batch = new Batch($transfer, $divisor); $batch->add('foo')->add('baz')->add('bar'); $items = $batch->flush(); $this->assertEquals(array('foo', 'baz', 'bar'), $items); } public function testThrowsExceptionContainingTheFailedBatch() { $called = 0; $originalException = new \Exception('Foo!'); $transfer = $this->getMockTransfer(); $transfer->expects($this->exactly(2)) ->method('transfer') ->will($this->returnCallback(function () use (&$called, $originalException) { if (++$called == 2) { throw $originalException; } })); $divisor = $this->getMockDivisor(); $batch = new Batch($transfer, $divisor); // PHPunit clones objects before passing them to a callback. // Horrible hack to get around this! $queue = $this->readAttribute($batch, 'queue'); $divisor->expects($this->once()) ->method('createBatches') ->will($this->returnCallback(function ($batch) use ($queue) { foreach ($queue as $item) { $items[] = $item; } return array_chunk($items, 2); })); $batch->add('foo')->add('baz')->add('bar')->add('bee')->add('boo'); $this->assertFalse($batch->isEmpty()); try { $items = $batch->flush(); $this->fail('Expected exception'); } catch (BatchTransferException $e) { $this->assertEquals($originalException, $e->getPrevious()); $this->assertEquals(array('bar', 'bee'), array_values($e->getBatch())); $this->assertEquals(1, count($batch)); } } } tests/Guzzle/Tests/Batch/ExceptionBufferingBatchTest.php000064400000002471151742734620017431 0ustar00getMockBuilder('Guzzle\Batch\BatchTransferInterface') ->setMethods(array('transfer')) ->getMock(); $d = new BatchSizeDivisor(1); $batch = new Batch($t, $d); $called = 0; $t->expects($this->exactly(3)) ->method('transfer') ->will($this->returnCallback(function ($batch) use (&$called) { if (++$called === 2) { throw new \Exception('Foo'); } })); $decorator = new ExceptionBufferingBatch($batch); $decorator->add('foo')->add('baz')->add('bar'); $result = $decorator->flush(); $e = $decorator->getExceptions(); $this->assertEquals(1, count($e)); $this->assertEquals(array('baz'), $e[0]->getBatch()); $decorator->clearExceptions(); $this->assertEquals(0, count($decorator->getExceptions())); $this->assertEquals(array('foo', 'bar'), $result); } } tests/Guzzle/Tests/Batch/FlushingBatchTest.php000064400000002276151742734620015425 0ustar00getMock('Guzzle\Batch\BatchTransferInterface', array('transfer')); $d = $this->getMock('Guzzle\Batch\BatchDivisorInterface', array('createBatches')); $batch = new Batch($t, $d); $queue = $this->readAttribute($batch, 'queue'); $d->expects($this->exactly(2)) ->method('createBatches') ->will($this->returnCallback(function () use ($queue) { $items = array(); foreach ($queue as $item) { $items[] = $item; } return array($items); })); $t->expects($this->exactly(2)) ->method('transfer'); $flush = new FlushingBatch($batch, 3); $this->assertEquals(3, $flush->getThreshold()); $flush->setThreshold(2); $flush->add('foo')->add('baz')->add('bar')->add('bee')->add('boo'); $this->assertEquals(1, count($flush)); } } tests/Guzzle/Tests/Batch/HistoryBatchTest.php000064400000001302151742734620015274 0ustar00getMock('Guzzle\Batch\BatchTransferInterface'), $this->getMock('Guzzle\Batch\BatchDivisorInterface') ); $history = new HistoryBatch($batch); $history->add('foo')->add('baz'); $this->assertEquals(array('foo', 'baz'), $history->getHistory()); $history->clearHistory(); $this->assertEquals(array(), $history->getHistory()); } } tests/Guzzle/Tests/Batch/NotifyingBatchTest.php000064400000002405151742734620015606 0ustar00getMock('Guzzle\Batch\Batch', array('flush'), array( $this->getMock('Guzzle\Batch\BatchTransferInterface'), $this->getMock('Guzzle\Batch\BatchDivisorInterface') )); $batch->expects($this->once()) ->method('flush') ->will($this->returnValue(array('foo', 'baz'))); $data = array(); $decorator = new NotifyingBatch($batch, function ($batch) use (&$data) { $data[] = $batch; }); $decorator->add('foo')->add('baz'); $decorator->flush(); $this->assertEquals(array(array('foo', 'baz')), $data); } /** * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testEnsuresCallableIsValid() { $batch = new Batch( $this->getMock('Guzzle\Batch\BatchTransferInterface'), $this->getMock('Guzzle\Batch\BatchDivisorInterface') ); $decorator = new NotifyingBatch($batch, 'foo'); } } tests/Guzzle/Tests/Cache/CacheAdapterFactoryTest.php000064400000007544151742734620016525 0ustar00cache = new ArrayCache(); $this->adapter = new DoctrineCacheAdapter($this->cache); } /** * @covers Guzzle\Cache\CacheAdapterFactory::factory * @expectedException InvalidArgumentException */ public function testEnsuresConfigIsArray() { CacheAdapterFactory::factory(new \stdClass()); } /** * @covers Guzzle\Cache\CacheAdapterFactory::factory * @expectedException InvalidArgumentException * @expectedExceptionMessage cache.provider is a required CacheAdapterFactory option */ public function testEnsuresRequiredProviderOption() { CacheAdapterFactory::factory(array( 'cache.adapter' => $this->adapter )); } /** * @covers Guzzle\Cache\CacheAdapterFactory::factory * @expectedException Guzzle\Common\Exception\InvalidArgumentException * @expectedExceptionMessage cache.adapter is a required CacheAdapterFactory option */ public function testEnsuresRequiredAdapterOption() { CacheAdapterFactory::factory(array( 'cache.provider' => $this->cache )); } /** * @covers Guzzle\Cache\CacheAdapterFactory::factory * @expectedException InvalidArgumentException * @expectedExceptionMessage foo is not a valid class for cache.adapter */ public function testEnsuresClassesExist() { CacheAdapterFactory::factory(array( 'cache.provider' => 'abc', 'cache.adapter' => 'foo' )); } /** * @covers Guzzle\Cache\CacheAdapterFactory::factory * @covers Guzzle\Cache\CacheAdapterFactory::createObject */ public function testCreatesProviderFromConfig() { $cache = CacheAdapterFactory::factory(array( 'cache.provider' => 'Doctrine\Common\Cache\ApcCache', 'cache.adapter' => 'Guzzle\Cache\DoctrineCacheAdapter' )); $this->assertInstanceOf('Guzzle\Cache\DoctrineCacheAdapter', $cache); $this->assertInstanceOf('Doctrine\Common\Cache\ApcCache', $cache->getCacheObject()); } /** * @covers Guzzle\Cache\CacheAdapterFactory::factory * @covers Guzzle\Cache\CacheAdapterFactory::createObject */ public function testCreatesProviderFromConfigWithArguments() { $cache = CacheAdapterFactory::factory(array( 'cache.provider' => 'Doctrine\Common\Cache\ApcCache', 'cache.provider.args' => array(), 'cache.adapter' => 'Guzzle\Cache\DoctrineCacheAdapter', 'cache.adapter.args' => array() )); $this->assertInstanceOf('Guzzle\Cache\DoctrineCacheAdapter', $cache); $this->assertInstanceOf('Doctrine\Common\Cache\ApcCache', $cache->getCacheObject()); } /** * @covers Guzzle\Cache\CacheAdapterFactory * @expectedException Guzzle\Common\Exception\RuntimeException */ public function testWrapsExceptionsOnObjectCreation() { CacheAdapterFactory::factory(array( 'cache.provider' => 'Guzzle\Tests\Mock\ExceptionMock', 'cache.adapter' => 'Guzzle\Tests\Mock\ExceptionMock' )); } /** * @covers Guzzle\Cache\CacheAdapterFactory */ public function testCreatesNullCacheAdapterByDefault() { $adapter = CacheAdapterFactory::factory(array()); $this->assertInstanceOf('Guzzle\Cache\NullCacheAdapter', $adapter); } } tests/Guzzle/Tests/Cache/CacheAdapterTest.php000064400000003771151742734620015173 0ustar00cache = new ArrayCache(); $this->adapter = new DoctrineCacheAdapter($this->cache); } /** * Cleans up the environment after running a test. */ protected function tearDown() { $this->adapter = null; $this->cache = null; parent::tearDown(); } /** * @covers \Guzzle\Cache\AbstractCacheAdapter::getCacheObject */ public function testGetCacheObject() { $this->assertEquals($this->cache, $this->adapter->getCacheObject()); } /** * @covers \Guzzle\Cache\DoctrineCacheAdapter::save */ public function testSave() { $this->assertTrue($this->adapter->save('test', 'data', 1000)); } /** * @covers \Guzzle\Cache\DoctrineCacheAdapter::fetch */ public function testFetch() { $this->assertTrue($this->adapter->save('test', 'data', 1000)); $this->assertEquals('data', $this->adapter->fetch('test')); } /** * @covers \Guzzle\Cache\DoctrineCacheAdapter::contains */ public function testContains() { $this->assertTrue($this->adapter->save('test', 'data', 1000)); $this->assertTrue($this->adapter->contains('test')); } /** * @covers \Guzzle\Cache\DoctrineCacheAdapter::delete */ public function testDelete() { $this->assertTrue($this->adapter->save('test', 'data', 1000)); $this->assertTrue($this->adapter->delete('test')); $this->assertFalse($this->adapter->contains('test')); } } tests/Guzzle/Tests/Cache/ClosureCacheAdapterTest.php000064400000006011151742734620016516 0ustar00callables = array( 'contains' => function($id, $options = array()) use ($that) { return array_key_exists($id, $that->data); }, 'delete' => function($id, $options = array()) use ($that) { unset($that->data[$id]); return true; }, 'fetch' => function($id, $options = array()) use ($that) { return array_key_exists($id, $that->data) ? $that->data[$id] : null; }, 'save' => function($id, $data, $lifeTime, $options = array()) use ($that) { $that->data[$id] = $data; return true; } ); $this->adapter = new ClosureCacheAdapter($this->callables); } /** * Cleans up the environment after running a test. */ protected function tearDown() { $this->cache = null; $this->callables = null; parent::tearDown(); } /** * @covers Guzzle\Cache\ClosureCacheAdapter::__construct * @expectedException InvalidArgumentException */ public function testEnsuresCallablesArePresent() { $callables = $this->callables; unset($callables['delete']); $cache = new ClosureCacheAdapter($callables); } /** * @covers Guzzle\Cache\ClosureCacheAdapter::__construct */ public function testAllCallablesMustBePresent() { $cache = new ClosureCacheAdapter($this->callables); } /** * @covers Guzzle\Cache\ClosureCacheAdapter::save * @covers Guzzle\Cache\ClosureCacheAdapter::fetch */ public function testCachesDataUsingCallables() { $this->assertTrue($this->adapter->save('test', 'data', 1000)); $this->assertEquals('data', $this->adapter->fetch('test')); } /** * @covers Guzzle\Cache\ClosureCacheAdapter::contains */ public function testChecksIfCacheContainsKeys() { $this->adapter->save('test', 'data', 1000); $this->assertTrue($this->adapter->contains('test')); $this->assertFalse($this->adapter->contains('foo')); } /** * @covers Guzzle\Cache\ClosureCacheAdapter::delete */ public function testDeletesFromCacheByKey() { $this->adapter->save('test', 'data', 1000); $this->assertTrue($this->adapter->contains('test')); $this->adapter->delete('test'); $this->assertFalse($this->adapter->contains('test')); } } tests/Guzzle/Tests/Cache/NullCacheAdapterTest.php000064400000001002151742734620016007 0ustar00assertEquals(false, $c->contains('foo')); $this->assertEquals(true, $c->delete('foo')); $this->assertEquals(false, $c->fetch('foo')); $this->assertEquals(true, $c->save('foo', 'bar')); } } tests/Guzzle/Tests/Cache/Zf1CacheAdapterTest.php000064400000001057151742734620015547 0ustar00assertTrue($adapter->save('id', 'data')); $this->assertTrue($adapter->delete('id')); $this->assertEquals('foo', $adapter->fetch('id')); $this->assertEquals('123456', $adapter->contains('id')); } } tests/Guzzle/Tests/Cache/Zf2CacheAdapterTest.php000064400000002715151742734620015552 0ustar00cache = StorageFactory::factory(array( 'adapter' => 'memory' )); $this->adapter = new Zf2CacheAdapter($this->cache); } /** * Cleans up the environment after running a test. */ protected function tearDown() { $this->adapter = null; $this->cache = null; parent::tearDown(); } public function testCachesDataUsingCallables() { $this->assertTrue($this->adapter->save('test', 'data', 1000)); $this->assertEquals('data', $this->adapter->fetch('test')); } public function testChecksIfCacheContainsKeys() { $this->adapter->save('test', 'data', 1000); $this->assertTrue($this->adapter->contains('test')); $this->assertFalse($this->adapter->contains('foo')); } public function testDeletesFromCacheByKey() { $this->adapter->save('test', 'data', 1000); $this->assertTrue($this->adapter->contains('test')); $this->adapter->delete('test'); $this->assertFalse($this->adapter->contains('test')); } } tests/Guzzle/Tests/Common/AbstractHasDispatcherTest.php000064400000005011151742734620017307 0ustar00assertEquals(array(), AbstractHasDispatcher::getAllEvents()); } /** * @covers Guzzle\Common\AbstractHasDispatcher::setEventDispatcher * @covers Guzzle\Common\AbstractHasDispatcher::getEventDispatcher */ public function testAllowsDispatcherToBeInjected() { $d = new EventDispatcher(); $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $this->assertSame($mock, $mock->setEventDispatcher($d)); $this->assertSame($d, $mock->getEventDispatcher()); } /** * @covers Guzzle\Common\AbstractHasDispatcher::getEventDispatcher */ public function testCreatesDefaultEventDispatcherIfNeeded() { $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $this->assertInstanceOf('Symfony\Component\EventDispatcher\EventDispatcher', $mock->getEventDispatcher()); } /** * @covers Guzzle\Common\AbstractHasDispatcher::dispatch */ public function testHelperDispatchesEvents() { $data = array(); $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $mock->getEventDispatcher()->addListener('test', function(Event $e) use (&$data) { $data = $e->getIterator()->getArrayCopy(); }); $mock->dispatch('test', array( 'param' => 'abc' )); $this->assertEquals(array( 'param' => 'abc', ), $data); } /** * @covers Guzzle\Common\AbstractHasDispatcher::addSubscriber */ public function testHelperAttachesSubscribers() { $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $subscriber = $this->getMockForAbstractClass('Symfony\Component\EventDispatcher\EventSubscriberInterface'); $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') ->setMethods(array('addSubscriber')) ->getMock(); $dispatcher->expects($this->once()) ->method('addSubscriber'); $mock->setEventDispatcher($dispatcher); $mock->addSubscriber($subscriber); } } tests/Guzzle/Tests/Common/CollectionTest.php000064400000043016151742734620015203 0ustar00coll = new Collection(); } /** * @covers Guzzle\Common\Collection::__construct */ public function testConstructorCanBeCalledWithNoParams() { $this->coll = new Collection(); $p = $this->coll->getAll(); $this->assertEmpty($p, '-> Collection must be empty when no data is passed'); } /** * @covers Guzzle\Common\Collection::__construct * @covers Guzzle\Common\Collection::getAll * @covers Guzzle\Common\Collection::toArray */ public function testConstructorCanBeCalledWithParams() { $testData = array( 'test' => 'value', 'test_2' => 'value2' ); $this->coll = new Collection($testData); $this->assertEquals($this->coll->getAll(), $testData, '-> getAll() must return the data passed in the constructor'); $this->assertEquals($this->coll->getAll(), $this->coll->toArray()); } /** * Test the IteratorAggregate implementation of theCollection object * * @covers Guzzle\Common\Collection::getIterator */ public function testImplementsIteratorAggregate() { $this->coll->set('key', 'value'); $this->assertInstanceOf('ArrayIterator', $this->coll->getIterator()); $this->assertEquals(1, count($this->coll)); $total = 0; foreach ($this->coll as $key => $value) { $this->assertEquals('key', $key); $this->assertEquals('value', $value); $total++; } $this->assertEquals(1, $total); } /** * @covers Guzzle\Common\Collection::add */ public function testCanAddValuesToExistingKeysByUsingArray() { $this->coll->add('test', 'value1'); $this->assertEquals($this->coll->getAll(), array('test' => 'value1')); $this->coll->add('test', 'value2'); $this->assertEquals($this->coll->getAll(), array('test' => array('value1', 'value2'))); $this->coll->add('test', 'value3'); $this->assertEquals($this->coll->getAll(), array('test' => array('value1', 'value2', 'value3'))); } /** * @covers Guzzle\Common\Collection::merge * @covers Guzzle\Common\Collection::getAll */ public function testHandlesMergingInDisparateDataSources() { $params = array( 'test' => 'value1', 'test2' => 'value2', 'test3' => array('value3', 'value4') ); $this->coll->merge($params); $this->assertEquals($this->coll->getAll(), $params); // Pass an invalid value and expect the same unaltered object $this->assertEquals($this->coll->merge(false), $this->coll); // Pass the same object to itself $this->assertEquals($this->coll->merge($this->coll), $this->coll); } /** * @covers Guzzle\Common\Collection::clear * @covers Guzzle\Common\Collection::remove */ public function testCanClearAllDataOrSpecificKeys() { $this->coll->merge(array( 'test' => 'value1', 'test2' => 'value2' )); // Clear a specific parameter by name $this->coll->remove('test'); $this->assertEquals($this->coll->getAll(), array( 'test2' => 'value2' )); // Clear all parameters $this->coll->clear(); $this->assertEquals($this->coll->getAll(), array()); } /** * @covers Guzzle\Common\Collection::get * @covers Guzzle\Common\Collection::getAll */ public function testGetsValuesByKey() { $this->assertNull($this->coll->get('test')); $this->coll->add('test', 'value'); $this->assertEquals('value', $this->coll->get('test')); $this->coll->set('test2', 'v2'); $this->coll->set('test3', 'v3'); $this->assertEquals(array( 'test' => 'value', 'test2' => 'v2' ), $this->coll->getAll(array('test', 'test2'))); } /** * @covers Guzzle\Common\Collection::getKeys * @covers Guzzle\Common\Collection::remove */ public function testProvidesKeys() { $this->assertEquals(array(), $this->coll->getKeys()); $this->coll->merge(array( 'test1' => 'value1', 'test2' => 'value2' )); $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys()); // Returns the cached array previously returned $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys()); $this->coll->remove('test1'); $this->assertEquals(array('test2'), $this->coll->getKeys()); $this->coll->add('test3', 'value3'); $this->assertEquals(array('test2', 'test3'), $this->coll->getKeys()); } /** * @covers Guzzle\Common\Collection::hasKey */ public function testChecksIfHasKey() { $this->assertFalse($this->coll->hasKey('test')); $this->coll->add('test', 'value'); $this->assertEquals(true, $this->coll->hasKey('test')); $this->coll->add('test2', 'value2'); $this->assertEquals(true, $this->coll->hasKey('test')); $this->assertEquals(true, $this->coll->hasKey('test2')); $this->assertFalse($this->coll->hasKey('testing')); $this->assertEquals(false, $this->coll->hasKey('AB-C', 'junk')); } /** * @covers Guzzle\Common\Collection::hasValue */ public function testChecksIfHasValue() { $this->assertFalse($this->coll->hasValue('value')); $this->coll->add('test', 'value'); $this->assertEquals('test', $this->coll->hasValue('value')); $this->coll->add('test2', 'value2'); $this->assertEquals('test', $this->coll->hasValue('value')); $this->assertEquals('test2', $this->coll->hasValue('value2')); $this->assertFalse($this->coll->hasValue('val')); } /** * @covers Guzzle\Common\Collection::getAll */ public function testCanGetAllValuesByArray() { $this->coll->add('foo', 'bar'); $this->coll->add('tEsT', 'value'); $this->coll->add('tesTing', 'v2'); $this->coll->add('key', 'v3'); $this->assertNull($this->coll->get('test')); $this->assertEquals(array( 'foo' => 'bar', 'tEsT' => 'value', 'tesTing' => 'v2' ), $this->coll->getAll(array( 'foo', 'tesTing', 'tEsT' ))); } /** * @covers Guzzle\Common\Collection::count */ public function testImplementsCount() { $data = new Collection(); $this->assertEquals(0, $data->count()); $data->add('key', 'value'); $this->assertEquals(1, count($data)); $data->add('key', 'value2'); $this->assertEquals(1, count($data)); $data->add('key_2', 'value3'); $this->assertEquals(2, count($data)); } /** * @covers Guzzle\Common\Collection::merge */ public function testAddParamsByMerging() { $params = array( 'test' => 'value1', 'test2' => 'value2', 'test3' => array('value3', 'value4') ); // Add some parameters $this->coll->merge($params); // Add more parameters by merging them in $this->coll->merge(array( 'test' => 'another', 'different_key' => 'new value' )); $this->assertEquals(array( 'test' => array('value1', 'another'), 'test2' => 'value2', 'test3' => array('value3', 'value4'), 'different_key' => 'new value' ), $this->coll->getAll()); } /** * @covers Guzzle\Common\Collection::filter */ public function testAllowsFunctionalFilter() { $this->coll->merge(array( 'fruit' => 'apple', 'number' => 'ten', 'prepositions' => array('about', 'above', 'across', 'after'), 'same_number' => 'ten' )); $filtered = $this->coll->filter(function($key, $value) { return $value == 'ten'; }); $this->assertNotEquals($filtered, $this->coll); $this->assertEquals(array( 'number' => 'ten', 'same_number' => 'ten' ), $filtered->getAll()); } /** * @covers Guzzle\Common\Collection::map */ public function testAllowsFunctionalMapping() { $this->coll->merge(array( 'number_1' => 1, 'number_2' => 2, 'number_3' => 3 )); $mapped = $this->coll->map(function($key, $value) { return $value * $value; }); $this->assertNotEquals($mapped, $this->coll); $this->assertEquals(array( 'number_1' => 1, 'number_2' => 4, 'number_3' => 9 ), $mapped->getAll()); } /** * @covers Guzzle\Common\Collection::offsetGet * @covers Guzzle\Common\Collection::offsetSet * @covers Guzzle\Common\Collection::offsetUnset * @covers Guzzle\Common\Collection::offsetExists */ public function testImplementsArrayAccess() { $this->coll->merge(array( 'k1' => 'v1', 'k2' => 'v2' )); $this->assertTrue($this->coll->offsetExists('k1')); $this->assertFalse($this->coll->offsetExists('Krull')); $this->coll->offsetSet('k3', 'v3'); $this->assertEquals('v3', $this->coll->offsetGet('k3')); $this->assertEquals('v3', $this->coll->get('k3')); $this->coll->offsetUnset('k1'); $this->assertFalse($this->coll->offsetExists('k1')); } /** * @covers Guzzle\Common\Collection::filter * @covers Guzzle\Common\Collection::map */ public function testUsesStaticWhenCreatingNew() { $qs = new QueryString(array( 'a' => 'b', 'c' => 'd' )); $this->assertInstanceOf('Guzzle\\Http\\QueryString', $qs->map(function($a, $b) {})); $this->assertInstanceOf('Guzzle\\Common\\Collection', $qs->map(function($a, $b) {}, array(), false)); $this->assertInstanceOf('Guzzle\\Http\\QueryString', $qs->filter(function($a, $b) {})); $this->assertInstanceOf('Guzzle\\Common\\Collection', $qs->filter(function($a, $b) {}, false)); } /** * @covers Guzzle\Common\Collection::replace */ public function testCanReplaceAllData() { $this->assertSame($this->coll, $this->coll->replace(array( 'a' => '123' ))); $this->assertEquals(array( 'a' => '123' ), $this->coll->getAll()); } public function dataProvider() { return array( array('this_is_a_test', '{a}_is_a_{b}', array( 'a' => 'this', 'b' => 'test' )), array('this_is_a_test', '{abc}_is_a_{0}', array( 'abc' => 'this', 0 => 'test' )), array('this_is_a_test', '{abc}_is_a_{0}', array( 'abc' => 'this', 0 => 'test' )), array('this_is_a_test', 'this_is_a_test', array( 'abc' => 'this' )), array('{abc}_is_{not_found}a_{0}', '{abc}_is_{not_found}a_{0}', array()) ); } /** * @covers Guzzle\Common\Collection::inject * @dataProvider dataProvider */ public function testInjectsConfigData($output, $input, $config) { $collection = new Collection($config); $this->assertEquals($output, $collection->inject($input)); } /** * @covers Guzzle\Common\Collection::keySearch */ public function testCanSearchByKey() { $collection = new Collection(array( 'foo' => 'bar', 'BaZ' => 'pho' )); $this->assertEquals('foo', $collection->keySearch('FOO')); $this->assertEquals('BaZ', $collection->keySearch('baz')); $this->assertEquals(false, $collection->keySearch('Bar')); } /** * @covers Guzzle\Common\Collection::fromConfig */ public function testPreparesFromConfig() { $c = Collection::fromConfig(array( 'a' => '123', 'base_url' => 'http://www.test.com/' ), array( 'a' => 'xyz', 'b' => 'lol' ), array('a')); $this->assertInstanceOf('Guzzle\Common\Collection', $c); $this->assertEquals(array( 'a' => '123', 'b' => 'lol', 'base_url' => 'http://www.test.com/' ), $c->getAll()); try { $c = Collection::fromConfig(null, null, array('a')); $this->fail('Exception not throw when missing config'); } catch (InvalidArgumentException $e) { } } function falseyDataProvider() { return array( array(false, false), array(null, null), array('', ''), array(array(), array()), array(0, 0), ); } /** * @dataProvider falseyDataProvider */ public function testReturnsCorrectData($a, $b) { $c = new Collection(array('value' => $a)); $this->assertSame($b, $c->get('value')); } /** * @covers Guzzle\Common\Collection::getPath */ public function testRetrievesNestedKeysUsingPath() { $data = array( 'foo' => 'bar', 'baz' => array( 'mesa' => array( 'jar' => 'jar' ) ) ); $collection = new Collection($data); $this->assertEquals('bar', $collection->getPath('foo')); $this->assertEquals('jar', $collection->getPath('baz/mesa/jar')); $this->assertNull($collection->getPath('wewewf')); $this->assertNull($collection->getPath('baz/mesa/jar/jar')); } /** * @covers Guzzle\Common\Collection::getPath */ public function testFalseyKeysStillDescend() { $collection = new Collection(array( '0' => array( 'a' => 'jar' ), 1 => 'other' )); $this->assertEquals('jar', $collection->getPath('0/a')); $this->assertEquals('other', $collection->getPath('1')); } public function getPathProvider() { $data = array( 'foo' => 'bar', 'baz' => array( 'mesa' => array( 'jar' => 'jar', 'array' => array('a', 'b', 'c') ), 'bar' => array( 'baz' => 'bam', 'array' => array('d', 'e', 'f') ) ), 'bam' => array( array('foo' => 1), array('foo' => 2), array('array' => array('h', 'i')) ) ); $c = new Collection($data); return array( // Simple path selectors array($c, 'foo', 'bar'), array($c, 'baz', $data['baz']), array($c, 'bam', $data['bam']), array($c, 'baz/mesa', $data['baz']['mesa']), array($c, 'baz/mesa/jar', 'jar'), // Merge everything two levels under baz array($c, 'baz/*', array( 'jar' => 'jar', 'array' => array_merge($data['baz']['mesa']['array'], $data['baz']['bar']['array']), 'baz' => 'bam' )), // Does not barf on missing keys array($c, 'fefwfw', null), // Does not barf when a wildcard does not resolve correctly array($c, '*/*/*/*/*/wefwfe', array()), // Allows custom separator array($c, '*|mesa', $data['baz']['mesa'], '|'), // Merge all 'array' keys two levels under baz (the trailing * does not hurt the results) array($c, 'baz/*/array/*', array_merge($data['baz']['mesa']['array'], $data['baz']['bar']['array'])), // Merge all 'array' keys two levels under baz array($c, 'baz/*/array', array_merge($data['baz']['mesa']['array'], $data['baz']['bar']['array'])), array($c, 'baz/mesa/array', $data['baz']['mesa']['array']), // Having a trailing * does not hurt the results array($c, 'baz/mesa/array/*', $data['baz']['mesa']['array']), // Merge of anything one level deep array($c, '*', array_merge(array('bar'), $data['baz'], $data['bam'])), // Funky merge of anything two levels deep array($c, '*/*', array( 'jar' => 'jar', 'array' => array('a', 'b', 'c', 'd', 'e', 'f', 'h', 'i'), 'baz' => 'bam', 'foo' => array(1, 2) )), // Funky merge of all 'array' keys that are two levels deep array($c, '*/*/array', array('a', 'b', 'c', 'd', 'e', 'f', 'h', 'i')) ); } /** * @dataProvider getPathProvider * @covers Guzzle\Common\Collection::getPath */ public function testGetPath(Collection $c, $path, $expected, $separator = '/') { $this->assertEquals($expected, $c->getPath($path, $separator)); } /** * @covers Guzzle\Common\Collection::overwriteWith */ public function testOverridesSettings() { $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); $c->overwriteWith(array('foo' => 10, 'bar' => 300)); $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->getAll()); } } tests/Guzzle/Tests/Common/EventTest.php000064400000003433151742734620014170 0ustar00 '123', 'other' => '456', 'event' => 'test.notify' )); } /** * @covers Guzzle\Common\Event::__construct */ public function testAllowsParameterInjection() { $event = new Event(array( 'test' => '123' )); $this->assertEquals('123', $event['test']); } /** * @covers Guzzle\Common\Event::offsetGet * @covers Guzzle\Common\Event::offsetSet * @covers Guzzle\Common\Event::offsetUnset * @covers Guzzle\Common\Event::offsetExists */ public function testImplementsArrayAccess() { $event = $this->getEvent(); $this->assertEquals('123', $event['test']); $this->assertNull($event['foobar']); $this->assertTrue($event->offsetExists('test')); $this->assertFalse($event->offsetExists('foobar')); unset($event['test']); $this->assertFalse($event->offsetExists('test')); $event['test'] = 'new'; $this->assertEquals('new', $event['test']); } /** * @covers Guzzle\Common\Event::getIterator */ public function testImplementsIteratorAggregate() { $event = $this->getEvent(); $this->assertInstanceOf('ArrayIterator', $event->getIterator()); } /** * @covers Guzzle\Common\Event::toArray */ public function testConvertsToArray() { $this->assertEquals(array( 'test' => '123', 'other' => '456', 'event' => 'test.notify' ), $this->getEvent()->toArray()); } } tests/Guzzle/Tests/Common/Exception/BatchTransferExceptionTest.php000064400000001544151742734620021453 0ustar00getMock('Guzzle\Batch\BatchTransferInterface'); $d = $this->getMock('Guzzle\Batch\BatchDivisorInterface'); $transferException = new BatchTransferException(array('foo'), array(1, 2), $e, $t, $d); $this->assertEquals(array('foo'), $transferException->getBatch()); $this->assertSame($t, $transferException->getTransferStrategy()); $this->assertSame($d, $transferException->getDivisorStrategy()); $this->assertSame($e, $transferException->getPrevious()); $this->assertEquals(array(1, 2), $transferException->getTransferredItems()); } } tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php000064400000002412151742734620021013 0ustar00getExceptions(); $e->add($exceptions[0]); $e->add($exceptions[1]); $this->assertEquals("Test\nTesting", $e->getMessage()); $this->assertSame($exceptions[0], $e->getFirst()); } public function testActsAsArray() { $e = new ExceptionCollection(); $exceptions = $this->getExceptions(); $e->add($exceptions[0]); $e->add($exceptions[1]); $this->assertEquals(2, count($e)); $this->assertEquals($exceptions, $e->getIterator()->getArrayCopy()); } public function testCanAddSelf() { $e1 = new ExceptionCollection(); $e1->add(new \Exception("Test")); $e2 = new ExceptionCollection(); $e2->add(new \Exception("Test 2")); $e1->add($e2); $this->assertEquals("Test\nTest 2", $e1->getMessage()); } } tests/Guzzle/Tests/GuzzleTestCase.php000064400000015021151742734620013727 0ustar00isRunning()) { self::$server->flush(); } else { self::$server->start(); } } catch (\Exception $e) { fwrite(STDERR, $e->getMessage()); } } return self::$server; } /** * Set the service builder to use for tests * * @param ServiceBuilderInterface $builder Service builder */ public static function setServiceBuilder(ServiceBuilderInterface $builder) { self::$serviceBuilder = $builder; } /** * Get a service builder object that can be used throughout the service tests * * @return ServiceBuilder */ public static function getServiceBuilder() { if (!self::$serviceBuilder) { throw new RuntimeException('No service builder has been set via setServiceBuilder()'); } return self::$serviceBuilder; } /** * Check if an event dispatcher has a subscriber * * @param HasDispatcherInterface $dispatcher * @param EventSubscriberInterface $subscriber * * @return bool */ protected function hasSubscriber(HasDispatcherInterface $dispatcher, EventSubscriberInterface $subscriber) { $class = get_class($subscriber); $all = array_keys(call_user_func(array($class, 'getSubscribedEvents'))); foreach ($all as $i => $event) { foreach ($dispatcher->getEventDispatcher()->getListeners($event) as $e) { if ($e[0] === $subscriber) { unset($all[$i]); break; } } } return count($all) == 0; } /** * Get a wildcard observer for an event dispatcher * * @param HasDispatcherInterface $hasEvent * * @return MockObserver */ public function getWildcardObserver(HasDispatcherInterface $hasDispatcher) { $class = get_class($hasDispatcher); $o = new MockObserver(); $events = call_user_func(array($class, 'getAllEvents')); foreach ($events as $event) { $hasDispatcher->getEventDispatcher()->addListener($event, array($o, 'update')); } return $o; } /** * Set the mock response base path * * @param string $path Path to mock response folder * * @return GuzzleTestCase */ public static function setMockBasePath($path) { self::$mockBasePath = $path; } /** * Mark a request as being mocked * * @param RequestInterface $request * * @return self */ public function addMockedRequest(RequestInterface $request) { $this->requests[] = $request; return $this; } /** * Get all of the mocked requests * * @return array */ public function getMockedRequests() { return $this->requests; } /** * Get a mock response for a client by mock file name * * @param string $path Relative path to the mock response file * * @return Response */ public function getMockResponse($path) { return $path instanceof Response ? $path : MockPlugin::getMockFile(self::$mockBasePath . DIRECTORY_SEPARATOR . $path); } /** * Set a mock response from a mock file on the next client request. * * This method assumes that mock response files are located under the * Command/Mock/ directory of the Service being tested * (e.g. Unfuddle/Command/Mock/). A mock response is added to the next * request sent by the client. * * @param Client $client Client object to modify * @param string $paths Path to files within the Mock folder of the service * * @return MockPlugin returns the created mock plugin */ public function setMockResponse(Client $client, $paths) { $this->requests = array(); $that = $this; $mock = new MockPlugin(null, true); $client->getEventDispatcher()->removeSubscriber($mock); $mock->getEventDispatcher()->addListener('mock.request', function(Event $event) use ($that) { $that->addMockedRequest($event['request']); }); foreach ((array) $paths as $path) { $mock->addResponse($this->getMockResponse($path)); } $client->getEventDispatcher()->addSubscriber($mock); return $mock; } /** * Compare HTTP headers and use special markup to filter values * A header prefixed with '!' means it must not exist * A header prefixed with '_' means it must be ignored * A header value of '*' means anything after the * will be ignored * * @param array $filteredHeaders Array of special headers * @param array $actualHeaders Array of headers to check against * * @return array|bool Returns an array of the differences or FALSE if none */ public function compareHeaders($filteredHeaders, $actualHeaders) { $comparison = new HeaderComparison(); return $comparison->compare($filteredHeaders, $actualHeaders); } /** * Case insensitive assertContains * * @param string $needle Search string * @param string $haystack Search this * @param string $message Optional failure message */ public function assertContainsIns($needle, $haystack, $message = null) { $this->assertContains(strtolower($needle), strtolower($haystack), $message); } } tests/Guzzle/Tests/Http/AbstractEntityBodyDecoratorTest.php000064400000002723151742734620020220 0ustar00getMockForAbstractClass('Guzzle\Http\AbstractEntityBodyDecorator', array($e)); $this->assertSame($e->getStream(), $mock->getStream()); $this->assertSame($e->getContentLength(), $mock->getContentLength()); $this->assertSame($e->getSize(), $mock->getSize()); $this->assertSame($e->getContentMd5(), $mock->getContentMd5()); $this->assertSame($e->getContentType(), $mock->getContentType()); $this->assertSame($e->__toString(), $mock->__toString()); $this->assertSame($e->getUri(), $mock->getUri()); $this->assertSame($e->getStreamType(), $mock->getStreamType()); $this->assertSame($e->getWrapper(), $mock->getWrapper()); $this->assertSame($e->getWrapperData(), $mock->getWrapperData()); $this->assertSame($e->isReadable(), $mock->isReadable()); $this->assertSame($e->isWritable(), $mock->isWritable()); $this->assertSame($e->isConsumed(), $mock->isConsumed()); $this->assertSame($e->isLocal(), $mock->isLocal()); $this->assertSame($e->isSeekable(), $mock->isSeekable()); $this->assertSame($e->getContentEncoding(), $mock->getContentEncoding()); } } tests/Guzzle/Tests/Http/CachingEntityBodyTest.php000064400000021462151742734620016147 0ustar00decorated = EntityBody::factory('testing'); $this->body = new CachingEntityBody($this->decorated); } public function testUsesRemoteSizeIfPossible() { $body = EntityBody::factory('test'); $caching = new CachingEntityBody($body); $this->assertEquals(4, $caching->getSize()); $this->assertEquals(4, $caching->getContentLength()); } /** * @expectedException \Guzzle\Common\Exception\RuntimeException * @expectedExceptionMessage does not support custom stream rewind */ public function testDoesNotAllowRewindFunction() { $this->body->setRewindFunction(true); } /** * @expectedException \Guzzle\Common\Exception\RuntimeException * @expectedExceptionMessage Cannot seek to byte 10 */ public function testCannotSeekPastWhatHasBeenRead() { $this->body->seek(10); } /** * @expectedException \Guzzle\Common\Exception\RuntimeException * @expectedExceptionMessage supports only SEEK_SET and SEEK_CUR */ public function testCannotUseSeekEnd() { $this->body->seek(2, SEEK_END); } public function testChangingUnderlyingStreamUpdatesSizeAndStream() { $size = filesize(__FILE__); $s = fopen(__FILE__, 'r'); $this->body->setStream($s, $size); $this->assertEquals($size, $this->body->getSize()); $this->assertEquals($size, $this->decorated->getSize()); $this->assertSame($s, $this->body->getStream()); $this->assertSame($s, $this->decorated->getStream()); } public function testRewindUsesSeek() { $a = EntityBody::factory('foo'); $d = $this->getMockBuilder('Guzzle\Http\CachingEntityBody') ->setMethods(array('seek')) ->setConstructorArgs(array($a)) ->getMock(); $d->expects($this->once()) ->method('seek') ->with(0) ->will($this->returnValue(true)); $d->rewind(); } public function testCanSeekToReadBytes() { $this->assertEquals('te', $this->body->read(2)); $this->body->seek(0); $this->assertEquals('test', $this->body->read(4)); $this->assertEquals(4, $this->body->ftell()); $this->body->seek(2); $this->assertEquals(2, $this->body->ftell()); $this->body->seek(2, SEEK_CUR); $this->assertEquals(4, $this->body->ftell()); $this->assertEquals('ing', $this->body->read(3)); } public function testWritesToBufferStream() { $this->body->read(2); $this->body->write('hi'); $this->body->rewind(); $this->assertEquals('tehiing', (string) $this->body); } public function testReadLinesFromBothStreams() { $this->body->seek($this->body->ftell()); $this->body->write("test\n123\nhello\n1234567890\n"); $this->body->rewind(); $this->assertEquals("test\n", $this->body->readLine(7)); $this->assertEquals("123\n", $this->body->readLine(7)); $this->assertEquals("hello\n", $this->body->readLine(7)); $this->assertEquals("123456", $this->body->readLine(7)); $this->assertEquals("7890\n", $this->body->readLine(7)); // We overwrote the decorated stream, so no more data $this->assertEquals('', $this->body->readLine(7)); } public function testSkipsOverwrittenBytes() { $decorated = EntityBody::factory( implode("\n", array_map(function ($n) { return str_pad($n, 4, '0', STR_PAD_LEFT); }, range(0, 25))) ); $body = new CachingEntityBody($decorated); $this->assertEquals("0000\n", $body->readLine()); $this->assertEquals("0001\n", $body->readLine()); // Write over part of the body yet to be read, so skip some bytes $this->assertEquals(5, $body->write("TEST\n")); $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); // Read, which skips bytes, then reads $this->assertEquals("0003\n", $body->readLine()); $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); $this->assertEquals("0004\n", $body->readLine()); $this->assertEquals("0005\n", $body->readLine()); // Overwrite part of the cached body (so don't skip any bytes) $body->seek(5); $this->assertEquals(5, $body->write("ABCD\n")); $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); $this->assertEquals("TEST\n", $body->readLine()); $this->assertEquals("0003\n", $body->readLine()); $this->assertEquals("0004\n", $body->readLine()); $this->assertEquals("0005\n", $body->readLine()); $this->assertEquals("0006\n", $body->readLine()); $this->assertEquals(5, $body->write("1234\n")); $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); // Seek to 0 and ensure the overwritten bit is replaced $body->rewind(); $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50)); // Ensure that casting it to a string does not include the bit that was overwritten $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body); } public function testWrapsContentType() { $a = $this->getMockBuilder('Guzzle\Http\EntityBody') ->setMethods(array('getContentType')) ->setConstructorArgs(array(fopen(__FILE__, 'r'))) ->getMock(); $a->expects($this->once()) ->method('getContentType') ->will($this->returnValue('foo')); $d = new CachingEntityBody($a); $this->assertEquals('foo', $d->getContentType()); } public function testWrapsContentEncoding() { $a = $this->getMockBuilder('Guzzle\Http\EntityBody') ->setMethods(array('getContentEncoding')) ->setConstructorArgs(array(fopen(__FILE__, 'r'))) ->getMock(); $a->expects($this->once()) ->method('getContentEncoding') ->will($this->returnValue('foo')); $d = new CachingEntityBody($a); $this->assertEquals('foo', $d->getContentEncoding()); } public function testWrapsMetadata() { $a = $this->getMockBuilder('Guzzle\Http\EntityBody') ->setMethods(array('getMetadata', 'getWrapper', 'getWrapperData', 'getStreamType', 'getUri')) ->setConstructorArgs(array(fopen(__FILE__, 'r'))) ->getMock(); $a->expects($this->once()) ->method('getMetadata') ->will($this->returnValue(array())); // Called twice for getWrapper and getWrapperData $a->expects($this->exactly(1)) ->method('getWrapper') ->will($this->returnValue('wrapper')); $a->expects($this->once()) ->method('getWrapperData') ->will($this->returnValue(array())); $a->expects($this->once()) ->method('getStreamType') ->will($this->returnValue('baz')); $a->expects($this->once()) ->method('getUri') ->will($this->returnValue('path/to/foo')); $d = new CachingEntityBody($a); $this->assertEquals(array(), $d->getMetaData()); $this->assertEquals('wrapper', $d->getWrapper()); $this->assertEquals(array(), $d->getWrapperData()); $this->assertEquals('baz', $d->getStreamType()); $this->assertEquals('path/to/foo', $d->getUri()); } public function testWrapsCustomData() { $a = $this->getMockBuilder('Guzzle\Http\EntityBody') ->setMethods(array('getCustomData', 'setCustomData')) ->setConstructorArgs(array(fopen(__FILE__, 'r'))) ->getMock(); $a->expects($this->exactly(1)) ->method('getCustomData') ->with('foo') ->will($this->returnValue('bar')); $a->expects($this->exactly(1)) ->method('setCustomData') ->with('foo', 'bar') ->will($this->returnSelf()); $d = new CachingEntityBody($a); $this->assertSame($d, $d->setCustomData('foo', 'bar')); $this->assertEquals('bar', $d->getCustomData('foo')); } public function testClosesBothStreams() { $s = fopen('php://temp', 'r'); $a = EntityBody::factory($s); $d = new CachingEntityBody($a); $d->close(); $this->assertFalse(is_resource($s)); } } tests/Guzzle/Tests/Http/ClientTest.php000064400000060133151742734620014014 0ustar00assertEquals('http://www.google.com/', $client->getBaseUrl()); $this->assertSame($client, $client->setConfig(array( 'test' => '123' ))); $this->assertEquals(array('test' => '123'), $client->getConfig()->getAll()); $this->assertEquals('123', $client->getConfig('test')); $this->assertSame($client, $client->setBaseUrl('http://www.test.com/{test}')); $this->assertEquals('http://www.test.com/123', $client->getBaseUrl()); $this->assertEquals('http://www.test.com/{test}', $client->getBaseUrl(false)); try { $client->setConfig(false); } catch (\InvalidArgumentException $e) { } } /** * @covers Guzzle\Http\Client::getAllEvents */ public function testDescribesEvents() { $this->assertEquals(array('client.create_request'), Client::getAllEvents()); } /** * @covers Guzzle\Http\Client::__construct */ public function testConstructorCanAcceptConfig() { $client = new Client('http://www.test.com/', array( 'data' => '123' )); $this->assertEquals('123', $client->getConfig('data')); } /** * @covers Guzzle\Http\Client::setConfig */ public function testCanUseCollectionAsConfig() { $client = new Client('http://www.google.com/'); $client->setConfig(new Collection(array( 'api' => 'v1', 'key' => 'value', 'base_url' => 'http://www.google.com/' ))); $this->assertEquals('v1', $client->getConfig('api')); } /** * @covers Guzzle\Http\Client */ public function testExpandsUriTemplatesUsingConfig() { $client = new Client('http://www.google.com/'); $client->setConfig(array( 'api' => 'v1', 'key' => 'value', 'foo' => 'bar' )); $this->assertEquals('Testing...api/v1/key/value', $client->expandTemplate('Testing...api/{api}/key/{key}')); // Make sure that the client properly validates and injects config $this->assertEquals('bar', $client->getConfig('foo')); } /** * @covers Guzzle\Http\Client::createRequest * @expectedException \Guzzle\Common\Exception\InvalidArgumentException */ public function testValidatesArrayForTemplateIsValid() { $client = new Client('http://www.google.com/'); $client->createRequest('GET', array('foo' => 'bar', 'baz' => 'bam')); } /** * @covers Guzzle\Http\Client::__construct * @covers Guzzle\Http\Client::createRequest */ public function testClientAttachersObserversToRequests() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $logPlugin = $this->getLogPlugin(); $client->getEventDispatcher()->addSubscriber($logPlugin); // Get a request from the client and ensure the the observer was // attached to the new request $request = $client->createRequest(); $this->assertTrue($this->hasSubscriber($request, $logPlugin)); } /** * @covers Guzzle\Http\Client::getBaseUrl * @covers Guzzle\Http\Client::setBaseUrl */ public function testClientReturnsValidBaseUrls() { $client = new Client('http://www.{foo}.{data}/', array( 'data' => '123', 'foo' => 'bar' )); $this->assertEquals('http://www.bar.123/', $client->getBaseUrl()); $client->setBaseUrl('http://www.google.com/'); $this->assertEquals('http://www.google.com/', $client->getBaseUrl()); } /** * @covers Guzzle\Http\Client::createRequest * @covers Guzzle\Http\Client::prepareRequest */ public function testClientAddsCurlOptionsToRequests() { $client = new Client('http://www.test.com/', array( 'api' => 'v1', // Adds the option using the curl values 'curl.options' => array( 'CURLOPT_HTTPAUTH' => 'CURLAUTH_DIGEST', 'abc' => 'foo', 'blacklist' => 'abc', 'debug' => true ) )); $request = $client->createRequest(); $options = $request->getCurlOptions(); $this->assertEquals(CURLAUTH_DIGEST, $options->get(CURLOPT_HTTPAUTH)); $this->assertEquals('foo', $options->get('abc')); $this->assertEquals('abc', $options->get('blacklist')); } /** * @covers Guzzle\Http\Client::setSslVerification */ public function testClientAllowsFineGrainedSslControlButIsSecureByDefault() { $client = new Client('https://www.secure.com/'); // secure by default $request = $client->createRequest(); $options = $request->getCurlOptions(); $this->assertTrue($options->get(CURLOPT_SSL_VERIFYPEER)); // set a capath if you prefer $client = new Client('https://www.secure.com/'); $client->setSslVerification(__DIR__); $request = $client->createRequest(); $options = $request->getCurlOptions(); $this->assertSame(__DIR__, $options->get(CURLOPT_CAPATH)); } /** * @covers Guzzle\Http\Client::__construct */ public function testConfigSettingsControlSslConfiguration() { // Use the default ca certs on the system $client = new Client('https://www.secure.com/', array('ssl.certificate_authority' => 'system')); $this->assertNull($client->getConfig('curl.options')); // Can set the cacert value as well $client = new Client('https://www.secure.com/', array('ssl.certificate_authority' => false)); $options = $client->getConfig('curl.options'); $this->assertArrayNotHasKey(CURLOPT_CAINFO, $options); $this->assertSame(false, $options[CURLOPT_SSL_VERIFYPEER]); $this->assertSame(2, $options[CURLOPT_SSL_VERIFYHOST]); } /** * @covers Guzzle\Http\Client::setSslVerification */ public function testClientAllowsUnsafeOperationIfRequested() { // be really unsafe if you insist $client = new Client('https://www.secure.com/', array( 'api' => 'v1' )); $client->setSslVerification(false); $request = $client->createRequest(); $options = $request->getCurlOptions(); $this->assertFalse($options->get(CURLOPT_SSL_VERIFYPEER)); $this->assertNull($options->get(CURLOPT_CAINFO)); } /** * @covers Guzzle\Http\Client::setSslVerification * @expectedException \Guzzle\Common\Exception\RuntimeException */ public function testThrowsExceptionForInvalidCertificate() { $client = new Client('https://www.secure.com/'); $client->setSslVerification('/path/to/missing/file'); } /** * @covers Guzzle\Http\Client::setSslVerification */ public function testClientAllowsSettingSpecificSslCaInfo() { // set a file other than the provided cacert.pem $client = new Client('https://www.secure.com/', array( 'api' => 'v1' )); $client->setSslVerification(__FILE__); $request = $client->createRequest(); $options = $request->getCurlOptions(); $this->assertSame(__FILE__, $options->get(CURLOPT_CAINFO)); } /** * @covers Guzzle\Http\Client::setSslVerification * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testClientPreventsInadvertentInsecureVerifyHostSetting() { // set a file other than the provided cacert.pem $client = new Client('https://www.secure.com/', array( 'api' => 'v1' )); $client->setSslVerification(__FILE__, true, true); } /** * @covers Guzzle\Http\Client::setSslVerification * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testClientPreventsInvalidVerifyPeerSetting() { // set a file other than the provided cacert.pem $client = new Client('https://www.secure.com/', array( 'api' => 'v1' )); $client->setSslVerification(__FILE__, 'yes'); } /** * @covers Guzzle\Http\Client::prepareRequest */ public function testClientAddsParamsToRequests() { $client = new Client('http://www.example.com', array( 'api' => 'v1', 'request.params' => array( 'foo' => 'bar', 'baz' => 'jar' ) )); $request = $client->createRequest(); $this->assertEquals('bar', $request->getParams()->get('foo')); $this->assertEquals('jar', $request->getParams()->get('baz')); } public function urlProvider() { $u = $this->getServer()->getUrl() . 'base/'; $u2 = $this->getServer()->getUrl() . 'base?z=1'; return array( array($u, '', $u), array($u, 'relative/path/to/resource', $u . 'relative/path/to/resource'), array($u, 'relative/path/to/resource?a=b&c=d', $u . 'relative/path/to/resource?a=b&c=d'), array($u, '/absolute/path/to/resource', $this->getServer()->getUrl() . 'absolute/path/to/resource'), array($u, '/absolute/path/to/resource?a=b&c=d', $this->getServer()->getUrl() . 'absolute/path/to/resource?a=b&c=d'), array($u2, '/absolute/path/to/resource?a=b&c=d', $this->getServer()->getUrl() . 'absolute/path/to/resource?a=b&c=d'), array($u2, 'relative/path/to/resource', $this->getServer()->getUrl() . 'base/relative/path/to/resource'), array($u2, 'relative/path/to/resource?another=query', $this->getServer()->getUrl() . 'base/relative/path/to/resource?another=query') ); } /** * @dataProvider urlProvider * @covers Guzzle\Http\Client::createRequest */ public function testBuildsRelativeUrls($baseUrl, $url, $result) { $client = new Client($baseUrl); $this->assertEquals($client->get($url)->getUrl(), $result); } /** * @covers Guzzle\Http\Client */ public function testAllowsConfigsToBeChangedAndInjectedInBaseUrl() { $client = new Client('http://{a}/{b}'); $this->assertEquals('http:///', $client->getBaseUrl()); $this->assertEquals('http://{a}/{b}', $client->getBaseUrl(false)); $client->setConfig(array( 'a' => 'test.com', 'b' => 'index.html' )); $this->assertEquals('http://test.com/index.html', $client->getBaseUrl()); } /** * @covers Guzzle\Http\Client::createRequest */ public function testCreatesRequestsWithDefaultValues() { $client = new Client($this->getServer()->getUrl() . 'base'); // Create a GET request $request = $client->createRequest(); $this->assertEquals('GET', $request->getMethod()); $this->assertEquals($client->getBaseUrl(), $request->getUrl()); // Create a DELETE request $request = $client->createRequest('DELETE'); $this->assertEquals('DELETE', $request->getMethod()); $this->assertEquals($client->getBaseUrl(), $request->getUrl()); // Create a HEAD request with custom headers $request = $client->createRequest('HEAD', 'http://www.test.com/'); $this->assertEquals('HEAD', $request->getMethod()); $this->assertEquals('http://www.test.com/', $request->getUrl()); // Create a PUT request $request = $client->createRequest('PUT'); $this->assertEquals('PUT', $request->getMethod()); // Create a PUT request with injected config $client->getConfig()->set('a', 1)->set('b', 2); $request = $client->createRequest('PUT', '/path/{a}?q={b}'); $this->assertEquals($request->getUrl(), $this->getServer()->getUrl() . 'path/1?q=2'); } /** * @covers Guzzle\Http\Client::get * @covers Guzzle\Http\Client::delete * @covers Guzzle\Http\Client::head * @covers Guzzle\Http\Client::put * @covers Guzzle\Http\Client::post * @covers Guzzle\Http\Client::options * @covers Guzzle\Http\Client::patch */ public function testClientHasHelperMethodsForCreatingRequests() { $url = $this->getServer()->getUrl(); $client = new Client($url . 'base'); $this->assertEquals('GET', $client->get()->getMethod()); $this->assertEquals('PUT', $client->put()->getMethod()); $this->assertEquals('POST', $client->post()->getMethod()); $this->assertEquals('HEAD', $client->head()->getMethod()); $this->assertEquals('DELETE', $client->delete()->getMethod()); $this->assertEquals('OPTIONS', $client->options()->getMethod()); $this->assertEquals('PATCH', $client->patch()->getMethod()); $this->assertEquals($url . 'base/abc', $client->get('abc')->getUrl()); $this->assertEquals($url . 'zxy', $client->put('/zxy')->getUrl()); $this->assertEquals($url . 'zxy?a=b', $client->post('/zxy?a=b')->getUrl()); $this->assertEquals($url . 'base?a=b', $client->head('?a=b')->getUrl()); $this->assertEquals($url . 'base?a=b', $client->delete('/base?a=b')->getUrl()); } /** * @covers Guzzle\Http\Client::createRequest */ public function testClientInjectsConfigsIntoUrls() { $client = new Client('http://www.test.com/api/v1', array( 'test' => '123' )); $request = $client->get('relative/{test}'); $this->assertEquals('http://www.test.com/api/v1/relative/123', $request->getUrl()); } /** * @covers Guzzle\Http\Client */ public function testAllowsEmptyBaseUrl() { $client = new Client(); $request = $client->get('http://www.google.com/'); $this->assertEquals('http://www.google.com/', $request->getUrl()); $request->setResponse(new Response(200), true); $request->send(); } /** * @covers Guzzle\Http\Client::send * @covers Guzzle\Http\Client::setCurlMulti * @covers Guzzle\Http\Client::getCurlMulti */ public function testAllowsCustomCurlMultiObjects() { $mock = $this->getMock('Guzzle\\Http\\Curl\\CurlMulti', array('add', 'send')); $mock->expects($this->once()) ->method('add'); $mock->expects($this->once()) ->method('send'); $client = new Client(); $client->setCurlMulti($mock); $request = $client->get(); $request->setResponse(new Response(200), true); $client->send($request); } /** * @covers Guzzle\Http\Client::send */ public function testClientSendsMultipleRequests() { $client = new Client($this->getServer()->getUrl()); $mock = new MockPlugin(); $responses = array( new Response(200), new Response(201), new Response(202) ); $mock->addResponse($responses[0]); $mock->addResponse($responses[1]); $mock->addResponse($responses[2]); $client->getEventDispatcher()->addSubscriber($mock); $requests = array( $client->get(), $client->head(), $client->put('/', null, 'test') ); $this->assertEquals(array( $responses[0], $responses[1], $responses[2] ), $client->send($requests)); } /** * @covers Guzzle\Http\Client::send */ public function testClientSendsSingleRequest() { $client = new Client($this->getServer()->getUrl()); $mock = new MockPlugin(); $response = new Response(200); $mock->addResponse($response); $client->getEventDispatcher()->addSubscriber($mock); $this->assertEquals($response, $client->send($client->get())); } /** * @covers Guzzle\Http\Client::send * @expectedException Guzzle\Http\Exception\BadResponseException */ public function testClientThrowsExceptionForSingleRequest() { $client = new Client($this->getServer()->getUrl()); $mock = new MockPlugin(); $response = new Response(404); $mock->addResponse($response); $client->getEventDispatcher()->addSubscriber($mock); $client->send($client->get()); } /** * @covers Guzzle\Http\Client::send * @expectedException Guzzle\Common\Exception\ExceptionCollection */ public function testClientThrowsExceptionForMultipleRequests() { $client = new Client($this->getServer()->getUrl()); $mock = new MockPlugin(); $mock->addResponse(new Response(200)); $mock->addResponse(new Response(404)); $client->getEventDispatcher()->addSubscriber($mock); $client->send(array($client->get(), $client->head())); } /** * @covers Guzzle\Http\Client */ public function testQueryStringsAreNotDoubleEncoded() { $client = new Client('http://test.com', array( 'path' => array('foo', 'bar'), 'query' => 'hi there', 'data' => array( 'test' => 'a&b' ) )); $request = $client->get('{/path*}{?query,data*}'); $this->assertEquals('http://test.com/foo/bar?query=hi%20there&test=a%26b', $request->getUrl()); $this->assertEquals('hi there', $request->getQuery()->get('query')); $this->assertEquals('a&b', $request->getQuery()->get('test')); } /** * @covers Guzzle\Http\Client */ public function testQueryStringsAreNotDoubleEncodedUsingAbsolutePaths() { $client = new Client('http://test.com', array( 'path' => array('foo', 'bar'), 'query' => 'hi there', )); $request = $client->get('http://test.com{?query}'); $this->assertEquals('http://test.com?query=hi%20there', $request->getUrl()); $this->assertEquals('hi there', $request->getQuery()->get('query')); } /** * @covers Guzzle\Http\Client::setUriTemplate * @covers Guzzle\Http\Client::getUriTemplate */ public function testAllowsUriTemplateInjection() { $client = new Client('http://test.com', array( 'path' => array('foo', 'bar'), 'query' => 'hi there', )); $a = $client->getUriTemplate(); $this->assertSame($a, $client->getUriTemplate()); $client->setUriTemplate(new UriTemplate()); $this->assertNotSame($a, $client->getUriTemplate()); } /** * @covers Guzzle\Http\Client::expandTemplate */ public function testAllowsCustomVariablesWhenExpandingTemplates() { $client = new Client('http://test.com', array( 'test' => 'hi', )); $uri = $client->expandTemplate('http://{test}{?query*}', array( 'query' => array( 'han' => 'solo' ) )); $this->assertEquals('http://hi?han=solo', $uri); } /** * @covers Guzzle\Http\Client::createRequest * @expectedException InvalidArgumentException */ public function testUriArrayMustContainExactlyTwoElements() { $client = new Client(); $client->createRequest('GET', array('haha!')); } /** * @covers Guzzle\Http\Client::createRequest * @expectedException InvalidArgumentException */ public function testUriArrayMustContainAnArray() { $client = new Client(); $client->createRequest('GET', array('haha!', 'test')); } /** * @covers Guzzle\Http\Client::createRequest * @covers Guzzle\Http\Client::get * @covers Guzzle\Http\Client::put * @covers Guzzle\Http\Client::post * @covers Guzzle\Http\Client::head * @covers Guzzle\Http\Client::options */ public function testUriArrayAllowsCustomTemplateVariables() { $client = new Client(); $vars = array( 'var' => 'hi' ); $this->assertEquals('/hi', (string) $client->createRequest('GET', array('/{var}', $vars))->getUrl()); $this->assertEquals('/hi', (string) $client->get(array('/{var}', $vars))->getUrl()); $this->assertEquals('/hi', (string) $client->put(array('/{var}', $vars))->getUrl()); $this->assertEquals('/hi', (string) $client->post(array('/{var}', $vars))->getUrl()); $this->assertEquals('/hi', (string) $client->head(array('/{var}', $vars))->getUrl()); $this->assertEquals('/hi', (string) $client->options(array('/{var}', $vars))->getUrl()); } /** * @covers Guzzle\Http\Client::setDefaultHeaders * @covers Guzzle\Http\Client::getDefaultHeaders * @covers Guzzle\Http\Client::createRequest */ public function testAllowsDefaultHeaders() { $default = array( 'X-Test' => 'Hi!' ); $other = array( 'X-Other' => 'Foo' ); $client = new Client(); $client->setDefaultHeaders($default); $this->assertEquals($default, $client->getDefaultHeaders()->getAll()); $client->setDefaultHeaders(new Collection($default)); $this->assertEquals($default, $client->getDefaultHeaders()->getAll()); $request = $client->createRequest('GET', null, $other); $this->assertEquals('Hi!', $request->getHeader('X-Test')); $this->assertEquals('Foo', $request->getHeader('X-Other')); $request = $client->createRequest('GET', null, new Collection($other)); $this->assertEquals('Hi!', $request->getHeader('X-Test')); $this->assertEquals('Foo', $request->getHeader('X-Other')); $request = $client->createRequest('GET'); $this->assertEquals('Hi!', $request->getHeader('X-Test')); } /** * @covers Guzzle\Http\Client::setDefaultHeaders * @expectedException InvalidArgumentException */ public function testValidatesDefaultHeaders() { $client = new Client(); $client->setDefaultHeaders('foo'); } public function testDontReuseCurlMulti() { $client1 = new Client(); $client2 = new Client(); $this->assertNotSame($client1->getCurlMulti(), $client2->getCurlMulti()); } /** * @covers Guzzle\Http\Client::getDefaultUserAgent * @covers Guzzle\Http\Client::setUserAgent */ public function testGetDefaultUserAgent() { $client = new Client(); $agent = $this->readAttribute($client, 'userAgent'); $version = curl_version(); $testAgent = sprintf('Guzzle/%s curl/%s PHP/%s', Version::VERSION, $version['version'], PHP_VERSION); $this->assertEquals($agent, $testAgent); $client->setUserAgent('foo'); $this->assertEquals('foo', $this->readAttribute($client, 'userAgent')); } /** * @covers Guzzle\Http\Client::prepareRequest */ public function testOverwritesUserAgent() { $client = new Client(); $request = $client->createRequest('GET', 'http://www.foo.com', array('User-agent' => 'foo')); $this->assertEquals('foo', (string) $request->getHeader('User-Agent')); } public function testUsesDefaultUserAgent() { $client = new Client(); $request = $client->createRequest('GET', 'http://www.foo.com'); $this->assertContains('Guzzle/', (string) $request->getHeader('User-Agent')); } } tests/Guzzle/Tests/Http/Curl/CurlHandleTest.php000064400000116362151742734620015532 0ustar00getEventDispatcher()->addListener('request.sent', function (Event $e) use ($that) { $that->requestHandle = $e['handle']; }); return $request; } public function setUp() { $this->requestHandle = null; } /** * @covers Guzzle\Http\Curl\CurlHandle * @expectedException \InvalidArgumentException */ public function testConstructorExpectsCurlResource() { $h = new CurlHandle(false, array()); } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testConstructorExpectsProperOptions() { $h = curl_init($this->getServer()->getUrl()); try { $ha = new CurlHandle($h, false); $this->fail('Expected InvalidArgumentException'); } catch (\InvalidArgumentException $e) { } $ha = new CurlHandle($h, array( CURLOPT_URL => $this->getServer()->getUrl() )); $this->assertEquals($this->getServer()->getUrl(), $ha->getOptions()->get(CURLOPT_URL)); $ha = new CurlHandle($h, new Collection(array( CURLOPT_URL => $this->getServer()->getUrl() ))); $this->assertEquals($this->getServer()->getUrl(), $ha->getOptions()->get(CURLOPT_URL)); } /** * @covers Guzzle\Http\Curl\CurlHandle::__construct * @covers Guzzle\Http\Curl\CurlHandle::getHandle * @covers Guzzle\Http\Curl\CurlHandle::getUrl * @covers Guzzle\Http\Curl\CurlHandle::getOptions */ public function testConstructorInitializesObject() { $handle = curl_init($this->getServer()->getUrl()); $h = new CurlHandle($handle, array( CURLOPT_URL => $this->getServer()->getUrl() )); $this->assertSame($handle, $h->getHandle()); $this->assertInstanceOf('Guzzle\\Http\\Url', $h->getUrl()); $this->assertEquals($this->getServer()->getUrl(), (string) $h->getUrl()); $this->assertEquals($this->getServer()->getUrl(), $h->getOptions()->get(CURLOPT_URL)); } /** * @covers Guzzle\Http\Curl\CurlHandle::getStderr */ public function testStoresStdErr() { $request = RequestFactory::getInstance()->create('GET', 'http://test.com'); $request->getCurlOptions()->set('debug', true); $h = CurlHandle::factory($request); $this->assertEquals($h->getStderr(true), $h->getOptions()->get(CURLOPT_STDERR)); $this->assertInternalType('resource', $h->getStderr(true)); $this->assertInternalType('string', $h->getStderr(false)); $r = $h->getStderr(true); fwrite($r, 'test'); $this->assertEquals('test', $h->getStderr(false)); } /** * @covers Guzzle\Http\Curl\CurlHandle::setErrorNo * @covers Guzzle\Http\Curl\CurlHandle::getErrorNo */ public function testStoresCurlErrorNumber() { $h = new CurlHandle(curl_init('http://test.com'), array(CURLOPT_URL => 'http://test.com')); $this->assertEquals(CURLE_OK, $h->getErrorNo()); $h->setErrorNo(CURLE_OPERATION_TIMEOUTED); $this->assertEquals(CURLE_OPERATION_TIMEOUTED, $h->getErrorNo()); } /** * @covers Guzzle\Http\Curl\CurlHandle::getStderr */ public function testAccountsForMissingStdErr() { $handle = curl_init('http://www.test.com/'); $h = new CurlHandle($handle, array( CURLOPT_URL => 'http://www.test.com/' )); $this->assertNull($h->getStderr(false)); } /** * @covers Guzzle\Http\Curl\CurlHandle::isAvailable */ public function testDeterminesIfResourceIsAvailable() { $handle = curl_init($this->getServer()->getUrl()); $h = new CurlHandle($handle, array()); $this->assertTrue($h->isAvailable()); // Mess it up by closing the handle curl_close($handle); $this->assertFalse($h->isAvailable()); // Mess it up by unsetting the handle $handle = null; $this->assertFalse($h->isAvailable()); } /** * @covers Guzzle\Http\Curl\CurlHandle::getError * @covers Guzzle\Http\Curl\CurlHandle::getErrorNo * @covers Guzzle\Http\Curl\CurlHandle::getInfo */ public function testWrapsErrorsAndInfo() { if (!defined('CURLOPT_TIMEOUT_MS')) { $this->markTestSkipped('Update curl'); } $settings = array( CURLOPT_PORT => 123, CURLOPT_CONNECTTIMEOUT_MS => 1, CURLOPT_TIMEOUT_MS => 1 ); $handle = curl_init($this->getServer()->getUrl()); curl_setopt_array($handle, $settings); $h = new CurlHandle($handle, $settings); @curl_exec($handle); $errors = array( "couldn't connect to host", 'timeout was reached', 'connection time-out', 'connect() timed out!' ); $this->assertTrue(in_array(strtolower($h->getError()), $errors), $h->getError() . ' was not the error'); $this->assertTrue($h->getErrorNo() > 0); $this->assertEquals($this->getServer()->getUrl(), $h->getInfo(CURLINFO_EFFECTIVE_URL)); $this->assertInternalType('array', $h->getInfo()); curl_close($handle); $this->assertEquals(null, $h->getInfo('url')); } /** * @covers Guzzle\Http\Curl\CurlHandle::getInfo */ public function testGetInfoWithoutDebugMode() { $client = new Client($this->getServer()->getUrl()); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"); $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()); $request->getCurlOptions()->set('debug', false); $request->setClient($client); $response = $request->send(); $info = $response->getInfo(); $this->assertFalse(empty($info)); $this->assertEquals($this->getServer()->getUrl(), $info['url']); } /** * @covers Guzzle\Http\Curl\CurlHandle::getOptions */ public function testWrapsCurlOptions() { $handle = curl_init($this->getServer()->getUrl()); $h = new CurlHandle($handle, array( CURLOPT_AUTOREFERER => true, CURLOPT_BUFFERSIZE => 1024 )); $this->assertEquals(true, $h->getOptions()->get(CURLOPT_AUTOREFERER)); $this->assertEquals(1024, $h->getOptions()->get(CURLOPT_BUFFERSIZE)); } /** * Data provider for factory tests * * @return array */ public function dataProvider() { $testFile = __DIR__ . '/../../../../../phpunit.xml.dist'; $postBody = new QueryString(array('file' => '@' . $testFile)); $qs = new QueryString(array( 'x' => 'y', 'z' => 'a' )); $client = new Client(); $userAgent = $client->getDefaultUserAgent(); $auth = base64_encode('michael:123'); $testFileSize = filesize($testFile); return array( // Send a regular GET array('GET', 'http://www.google.com/', null, null, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_HTTPHEADER => array('Accept:', 'Host: www.google.com', 'User-Agent: ' . $userAgent), )), // Test that custom request methods can be used array('TRACE', 'http://www.google.com/', null, null, array( CURLOPT_CUSTOMREQUEST => 'TRACE' )), // Send a GET using a port array('GET', 'http://127.0.0.1:8080', null, null, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_PORT => 8080, CURLOPT_HTTPHEADER => array('Accept:', 'Host: 127.0.0.1:8080', 'User-Agent: ' . $userAgent), )), // Send a HEAD request array('HEAD', 'http://www.google.com/', null, null, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_HTTPHEADER => array('Accept:', 'Host: www.google.com', 'User-Agent: ' . $userAgent), CURLOPT_NOBODY => 1 )), // Send a GET using basic auth array('GET', 'https://michael:123@localhost/index.html?q=2', null, null, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_HTTPHEADER => array( 'Accept:', 'Host: localhost', 'Authorization: Basic ' . $auth, 'User-Agent: ' . $userAgent ), CURLOPT_PORT => 443 )), // Send a GET request with custom headers array('GET', 'http://localhost:8124/', array( 'x-test-data' => 'Guzzle' ), null, array( CURLOPT_PORT => 8124, CURLOPT_HTTPHEADER => array( 'Accept:', 'Host: localhost:8124', 'x-test-data: Guzzle', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'x-test-data' => 'Guzzle' )), // Send a POST using a query string array('POST', 'http://localhost:8124/post.php', null, $qs, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_POSTFIELDS => 'x=y&z=a', CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'Content-Type: application/x-www-form-urlencoded', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Length' => '7', '!Expect' => null, 'Content-Type' => 'application/x-www-form-urlencoded', '!Transfer-Encoding' => null )), // Send a PUT using raw data array('PUT', 'http://localhost:8124/put.php', null, EntityBody::factory(fopen($testFile, 'r+')), array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_READFUNCTION => 'callback', CURLOPT_INFILESIZE => filesize($testFile), CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', '!Expect' => null, 'Content-Length' => $testFileSize, '!Transfer-Encoding' => null )), // Send a POST request using an array of fields array('POST', 'http://localhost:8124/post.php', null, array( 'x' => 'y', 'a' => 'b' ), array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => 'x=y&a=b', CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'Content-Type: application/x-www-form-urlencoded', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Length' => '7', '!Expect' => null, 'Content-Type' => 'application/x-www-form-urlencoded', '!Transfer-Encoding' => null )), // Send a POST request using a POST file array('POST', 'http://localhost:8124/post.php', null, $postBody, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => array( 'file' => '@' . $testFile . ';type=application/octet-stream;filename=phpunit.xml.dist' ), CURLOPT_HTTPHEADER => array ( 'Accept:', 'Host: localhost:8124', 'Content-Type: multipart/form-data', 'Expect: 100-Continue', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Length' => '*', 'Expect' => '100-Continue', 'Content-Type' => 'multipart/form-data; boundary=*', '!Transfer-Encoding' => null )), // Send a POST request with raw POST data and a custom content-type array('POST', 'http://localhost:8124/post.php', array( 'Content-Type' => 'application/json' ), '{"hi":"there"}', array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_UPLOAD => true, CURLOPT_INFILESIZE => 14, CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'Content-Type: application/json', 'User-Agent: ' . $userAgent ), ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Type' => 'application/json', '!Expect' => null, 'Content-Length' => '14', '!Transfer-Encoding' => null )), // Send a POST request with raw POST data, a custom content-type, and use chunked encoding array('POST', 'http://localhost:8124/post.php', array( 'Content-Type' => 'application/json', 'Transfer-Encoding' => 'chunked' ), '{"hi":"there"}', array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_HEADER => 0, CURLOPT_CONNECTTIMEOUT => 150, CURLOPT_WRITEFUNCTION => 'callback', CURLOPT_HEADERFUNCTION => 'callback', CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_UPLOAD => true, CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'Content-Type: application/json', 'Transfer-Encoding: chunked', 'User-Agent: ' . $userAgent ), ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Type' => 'application/json', '!Expect' => null, 'Transfer-Encoding' => 'chunked', '!Content-Length' => '' )), // Send a POST request with no body array('POST', 'http://localhost:8124/post.php', null, '', array( CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Length' => '0', '!Transfer-Encoding' => null )), // Send a POST request with empty post fields array('POST', 'http://localhost:8124/post.php', null, array(), array( CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Length' => '0', '!Transfer-Encoding' => null )), // Send a PATCH request array('PATCH', 'http://localhost:8124/patch.php', null, 'body', array( CURLOPT_INFILESIZE => 4, CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'User-Agent: ' . $userAgent ) )), // Send a DELETE request with a body array('DELETE', 'http://localhost:8124/delete.php', null, 'body', array( CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_INFILESIZE => 4, CURLOPT_HTTPHEADER => array ( 'Expect:', 'Accept:', 'Host: localhost:8124', 'User-Agent: ' . $userAgent ) ), array( 'Host' => '*', 'User-Agent' => '*', 'Content-Length' => '4', '!Expect' => null, '!Transfer-Encoding' => null )) ); } /** * @covers Guzzle\Http\Curl\CurlHandle::factory * @covers Guzzle\Http\Curl\CurlHandle::updateRequestFromTransfer * @covers Guzzle\Http\Curl\RequestMediator * @dataProvider dataProvider */ public function testFactoryCreatesCurlBasedOnRequest($method, $url, $headers, $body, $options, $expectedHeaders = null) { $client = new Client(); $request = $client->createRequest($method, $url, $headers, $body); $request->getCurlOptions()->set('debug', true); $originalRequest = clone $request; $curlTest = clone $request; $handle = CurlHandle::factory($curlTest); $this->assertInstanceOf('Guzzle\\Http\\Curl\\CurlHandle', $handle); $o = $handle->getOptions()->getAll(); // Headers are case-insensitive if (isset($o[CURLOPT_HTTPHEADER])) { $o[CURLOPT_HTTPHEADER] = array_map('strtolower', $o[CURLOPT_HTTPHEADER]); } if (isset($options[CURLOPT_HTTPHEADER])) { $options[CURLOPT_HTTPHEADER] = array_map('strtolower', $options[CURLOPT_HTTPHEADER]); } $check = 0; foreach ($options as $key => $value) { $check++; $this->assertArrayHasKey($key, $o, '-> Check number ' . $check); if ($key != CURLOPT_HTTPHEADER && $key != CURLOPT_POSTFIELDS && (is_array($o[$key])) || $o[$key] instanceof \Closure) { $this->assertEquals('callback', $value, '-> Check number ' . $check); } else { $this->assertTrue($value == $o[$key], '-> Check number ' . $check . ' - ' . var_export($value, true) . ' != ' . var_export($o[$key], true)); } } // If we are testing the actual sent headers if ($expectedHeaders) { // Send the request to the test server $client = new Client($this->getServer()->getUrl()); $request->setClient($client); $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request->send(); // Get the request that was sent and create a request that we expected $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals($method, $requests[0]->getMethod()); $test = $this->compareHeaders($expectedHeaders, $requests[0]->getHeaders()); $this->assertFalse($test, $test . "\nSent: \n" . $request . "\n\n" . $requests[0]); // Ensure only one Content-Length header is sent if ($request->getHeader('Content-Length')) { $this->assertEquals((string) $request->getHeader('Content-Length'), (string) $requests[0]->getHeader('Content-Length')); } } } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testFactoryUsesSpecifiedProtocol() { $request = RequestFactory::getInstance()->create('GET', 'http://localhost:8124/'); $request->setProtocolVersion('1.1'); $handle = CurlHandle::factory($request); $options = $handle->getOptions(); $this->assertEquals(CURL_HTTP_VERSION_1_1, $options[CURLOPT_HTTP_VERSION]); } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testUploadsPutData() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $client = new Client($this->getServer()->getUrl()); $request = $client->put('/'); $request->getCurlOptions()->set('debug', true); $request->setBody(EntityBody::factory('test'), 'text/plain', false); $request->getCurlOptions()->set('progress', true); $o = $this->getWildcardObserver($request); $request->send(); // Make sure that the events were dispatched $this->assertTrue($o->has('curl.callback.progress')); // Ensure that the request was received exactly as intended $r = $this->getServer()->getReceivedRequests(true); $this->assertEquals(strtolower($request), strtolower($r[0])); $this->assertFalse($r[0]->hasHeader('Transfer-Encoding')); $this->assertEquals(4, (string) $r[0]->getHeader('Content-Length')); } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testUploadsPutDataUsingChunkedEncodingWhenLengthCannotBeDetermined() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi" )); $client = new Client($this->getServer()->getUrl()); $request = $client->put('/'); $request->setBody(EntityBody::factory(fopen($this->getServer()->getUrl(), 'r')), 'text/plain'); $request->send(); $r = $this->getServer()->getReceivedRequests(true); $this->assertEquals('chunked', $r[1]->getHeader('Transfer-Encoding')); $this->assertFalse($r[1]->hasHeader('Content-Length')); } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testUploadsPutDataUsingChunkedEncodingWhenForced() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $client = new Client($this->getServer()->getUrl()); $request = $client->put('/'); $request->setBody(EntityBody::factory('hi!'), 'text/plain', true); $request->send(); $r = $this->getServer()->getReceivedRequests(true); $this->assertEquals('chunked', $r[0]->getHeader('Transfer-Encoding')); $this->assertFalse($r[0]->hasHeader('Content-Length')); $this->assertEquals('hi!', $r[0]->getBody(true)); } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testSendsPostRequestsWithFields() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request = RequestFactory::getInstance()->create('POST', $this->getServer()->getUrl()); $request->getCurlOptions()->set('debug', true); $request->setClient(new Client()); $request->addPostFields(array( 'a' => 'b', 'c' => 'ay! ~This is a test, isn\'t it?' )); $request->send(); // Make sure that the request was sent correctly $r = $this->getServer()->getReceivedRequests(true); $this->assertEquals('a=b&c=ay%21%20~This%20is%20a%20test%2C%20isn%27t%20it%3F', (string) $r[0]->getBody()); $this->assertEquals(strtolower($request), strtolower($r[0])); } /** * @covers Guzzle\Http\Curl\CurlHandle */ public function testSendsPostRequestsWithFiles() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request = RequestFactory::getInstance()->create('POST', $this->getServer()->getUrl()); $request->getCurlOptions()->set('debug', true); $request->setClient(new Client()); $request->addPostFiles(array( 'foo' => __FILE__, )); $request->addPostFields(array( 'bar' => 'baz', 'arr' => array('a' => 1, 'b' => 2), )); $this->updateForHandle($request); $request->send(); // Ensure the CURLOPT_POSTFIELDS option was set properly $options = $this->requestHandle->getOptions()->getAll(); $this->assertContains('@' . __FILE__ . ';type=text/x-', $options[CURLOPT_POSTFIELDS]['foo']); $this->assertEquals('baz', $options[CURLOPT_POSTFIELDS]['bar']); $this->assertEquals('1', $options[CURLOPT_POSTFIELDS]['arr[a]']); $this->assertEquals('2', $options[CURLOPT_POSTFIELDS]['arr[b]']); // Ensure that a Content-Length header was sent by cURL $this->assertTrue($request->hasHeader('Content-Length')); } /** * @covers Guzzle\Http\Curl\CurlHandle::factory */ public function testHeadersCanBeBlacklisted() { $client = new Client($this->getServer()->getUrl(), array( 'curl.options' => array( 'blacklist' => array('header.Foo', CURLOPT_FOLLOWLOCATION) ) )); $request = $client->put(); $request->setHeader('Foo', 'Bar'); $handle = CurlHandle::factory($request); $headers = $handle->getOptions()->get(CURLOPT_HTTPHEADER); $this->assertTrue(in_array('Foo:', $headers)); $this->assertFalse($handle->getOptions()->hasKey(CURLOPT_FOLLOWLOCATION)); $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request->send(); $r = $this->getServer()->getReceivedRequests(true); $this->assertFalse($r[0]->hasHeader('Foo')); } /** * @covers Guzzle\Http\Curl\CurlHandle::factory */ public function testCurlConfigurationOptionsAreSet() { $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()); $request->setClient(new Client('http://www.example.com')); $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT, 99); $request->getCurlOptions()->set('curl.fake_opt', 99); $request->getCurlOptions()->set(CURLOPT_PORT, 8181); $handle = CurlHandle::factory($request); $this->assertEquals(99, $handle->getOptions()->get(CURLOPT_CONNECTTIMEOUT)); $this->assertEquals(8181, $handle->getOptions()->get(CURLOPT_PORT)); $this->assertNull($handle->getOptions()->get('curl.fake_opt')); $this->assertNull($handle->getOptions()->get('fake_opt')); } /** * @covers Guzzle\Http\Curl\CurlHandle::factory */ public function testAllowsHeadersSetToNull() { $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()); $request->setClient(new Client()); $request->setBody('test'); $request->setHeader('Expect', null); $handle = CurlHandle::factory($request); $headers = $handle->getOptions()->get(CURLOPT_HTTPHEADER); $this->assertTrue(in_array('Expect:', $headers)); } /** * @covers Guzzle\Http\Curl\CurlHandle::updateRequestFromTransfer */ public function testEnsuresRequestsHaveResponsesWhenUpdatingFromTransfer() { $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()); $handle = CurlHandle::factory($request); $handle->updateRequestFromTransfer($request); } public function testCanSendBodyAsString() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $request = $client->put('/', null, 'foo'); $request->getCurlOptions()->set('body_as_string', true); $request->send(); $requests = $this->getServer()->getReceivedRequests(false); $this->assertContains('PUT /', $requests[0]); $this->assertContains("\nfoo", $requests[0]); $this->assertContains('content-length: 3', $requests[0]); $this->assertNotContains('content-type', $requests[0]); } public function testCanSendPostBodyAsString() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $request = $client->post('/', null, 'foo'); $request->getCurlOptions()->set('body_as_string', true); $request->send(); $requests = $this->getServer()->getReceivedRequests(false); $this->assertContains('POST /', $requests[0]); $this->assertContains("\nfoo", $requests[0]); $this->assertContains('content-length: 3', $requests[0]); $this->assertNotContains('content-type', $requests[0]); } public function testAllowsWireTransferInfoToBeEnabled() { $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()); $request->getCurlOptions()->set('debug', true); $handle = CurlHandle::factory($request); $this->assertNotNull($handle->getOptions()->get(CURLOPT_STDERR)); $this->assertNotNull($handle->getOptions()->get(CURLOPT_VERBOSE)); } public function testAddsCustomCurlOptions() { $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()); $request->getCurlOptions()->set(CURLOPT_TIMEOUT, 200); $handle = CurlHandle::factory($request); $this->assertEquals(200, $handle->getOptions()->get(CURLOPT_TIMEOUT)); } public function testSendsPostUploadsWithContentDispositionHeaders() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\n\r\nContent-Length: 0\r\n\r\n"); $fileToUpload = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'TestData' . DIRECTORY_SEPARATOR . 'test_service.json'; $client = new Client($this->getServer()->getUrl()); $request = $client->post(); $request->addPostFile('foo', $fileToUpload, 'application/json'); $request->addPostFile('foo', __FILE__); $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $body = (string) $requests[0]->getBody(); $this->assertContains('Content-Disposition: form-data; name="foo[0]"; filename="', $body); $this->assertContains('Content-Type: application/json', $body); $this->assertContains('Content-Type: text/x-', $body); $this->assertContains('Content-Disposition: form-data; name="foo[1]"; filename="', $body); } public function requestMethodProvider() { return array(array('POST'), array('PUT'), array('PATCH')); } /** * @covers Guzzle\Http\Curl\CurlHandle * @dataProvider requestMethodProvider */ public function testSendsRequestsWithNoBodyUsingContentLengthZero($method) { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $client->createRequest($method)->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertFalse($requests[0]->hasHeader('Transfer-Encoding')); $this->assertTrue($requests[0]->hasHeader('Content-Length')); $this->assertEquals('0', (string) $requests[0]->getHeader('Content-Length')); } /** * @covers Guzzle\Http\Curl\CurlHandle::parseCurlConfig * @dataProvider provideCurlConfig */ public function testParseCurlConfigConvertsStringKeysToConstantKeys($options, $expected) { $actual = CurlHandle::parseCurlConfig($options); $this->assertEquals($expected, $actual); } /** * Data provider for curl configurations * * @return array */ public function provideCurlConfig() { return array( // Conversion of option name to constant value array( array( 'CURLOPT_PORT' => 10, 'CURLOPT_TIMEOUT' => 99 ), array( CURLOPT_PORT => 10, CURLOPT_TIMEOUT => 99 ) ), // Keeps non constant options array( array('debug' => true), array('debug' => true) ), // Conversion of constant names to constant values array( array('debug' => 'CURLPROXY_HTTP'), array('debug' => CURLPROXY_HTTP) ) ); } public function testSeeksToBeginningOfStreamWhenSending() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" )); $client = new Client($this->getServer()->getUrl()); $request = $client->put('/', null, 'test'); $request->send(); $request->send(); $received = $this->getServer()->getReceivedRequests(true); $this->assertEquals(2, count($received)); $this->assertEquals('test', (string) $received[0]->getBody()); $this->assertEquals('test', (string) $received[1]->getBody()); } public function testAllowsCurloptEncodingToBeSet() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $request = $client->get('/', null); $request->getCurlOptions()->set(CURLOPT_ENCODING, ''); $this->updateForHandle($request); $request->send(); $options = $this->requestHandle->getOptions()->getAll(); $this->assertSame('', $options[CURLOPT_ENCODING]); $received = $this->getServer()->getReceivedRequests(false); $this->assertContainsIns('accept: */*', $received[0]); $this->assertContainsIns('accept-encoding: ', $received[0]); } public function testSendsExpectHeaderWhenSizeIsGreaterThanCutoff() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $request = $client->put('/', null, 'test'); // Start sending the expect header to 2 bytes $this->updateForHandle($request); $request->setExpectHeaderCutoff(2)->send(); $options = $this->requestHandle->getOptions()->getAll(); $this->assertContains('Expect: 100-Continue', $options[CURLOPT_HTTPHEADER]); $received = $this->getServer()->getReceivedRequests(false); $this->assertContainsIns('expect: 100-continue', $received[0]); } public function testSetsCurloptEncodingWhenAcceptEncodingHeaderIsSet() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"); $client = new Client($this->getServer()->getUrl()); $request = $client->get('/', array( 'Accept' => 'application/json', 'Accept-Encoding' => 'gzip, deflate', )); $this->updateForHandle($request); $request->send(); $options = $this->requestHandle->getOptions()->getAll(); $this->assertSame('gzip, deflate', $options[CURLOPT_ENCODING]); $received = $this->getServer()->getReceivedRequests(false); $this->assertContainsIns('accept: application/json', $received[0]); $this->assertContainsIns('accept-encoding: gzip, deflate', $received[0]); } public function testSendsPostFieldsForNonPostRequests() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\n\r\nContent-Length: 0\r\n\r\n"); $client = new Client(); $request = $client->put($this->getServer()->getUrl(), null, array( 'foo' => 'baz', 'baz' => 'bar' )); $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals('PUT', $requests[0]->getMethod()); $this->assertEquals('application/x-www-form-urlencoded', (string) $requests[0]->getHeader('Content-Type')); $this->assertEquals(15, (string) $requests[0]->getHeader('Content-Length')); $this->assertEquals('foo=baz&baz=bar', (string) $requests[0]->getBody()); } public function testSendsPostFilesForNonPostRequests() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\n\r\nContent-Length: 0\r\n\r\n"); $client = new Client(); $request = $client->put($this->getServer()->getUrl(), null, array( 'foo' => '@' . __FILE__ )); $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals('PUT', $requests[0]->getMethod()); $this->assertContains('multipart/form-data', (string) $requests[0]->getHeader('Content-Type')); $this->assertContains('testSendsPostFilesForNonPostRequests', (string) $requests[0]->getBody()); } } tests/Guzzle/Tests/Http/Curl/CurlMultiTest.php000064400000053525151742734620015432 0ustar00updates = new Collection(); $this->multi = new MockMulti(); $this->mock = $this->getWildcardObserver($this->multi); } /** * @covers Guzzle\Http\Curl\CurlMulti::__construct * @covers Guzzle\Http\Curl\CurlMulti::__destruct */ public function testConstructorCreateMultiHandle() { $this->assertInternalType('resource', $this->multi->getHandle()); $this->assertEquals('curl_multi', get_resource_type($this->multi->getHandle())); } /** * @covers Guzzle\Http\Curl\CurlMulti::__destruct */ public function testDestructorClosesMultiHandle() { $handle = $this->multi->getHandle(); $this->multi->__destruct(); $this->assertFalse(is_resource($handle)); } /** * @covers Guzzle\Http\Curl\curlMulti::add * @covers Guzzle\Http\Curl\curlMulti::all * @covers Guzzle\Http\Curl\curlMulti::count */ public function testRequestsCanBeAddedAndCounted() { $multi = new CurlMulti(); $mock = $this->getWildcardObserver($multi); $request1 = new Request('GET', 'http://www.google.com/'); $multi->add($request1); $this->assertEquals(array($request1), $multi->all()); $request2 = new Request('POST', 'http://www.google.com/'); $multi->add($request2); $this->assertEquals(array($request1, $request2), $multi->all()); $this->assertEquals(2, count($multi)); $this->assertTrue($mock->has(CurlMulti::ADD_REQUEST)); $this->assertFalse($mock->has(CurlMulti::REMOVE_REQUEST)); $this->assertFalse($mock->has(CurlMulti::COMPLETE)); } /** * @covers Guzzle\Http\Curl\CurlMulti::remove * @covers Guzzle\Http\Curl\CurlMulti::all */ public function testRequestsCanBeRemoved() { $request1 = new Request('GET', 'http://www.google.com/'); $this->multi->add($request1); $request2 = new Request('PUT', 'http://www.google.com/'); $this->multi->add($request2); $this->assertEquals(array($request1, $request2), $this->multi->all()); $this->assertSame($this->multi, $this->multi->remove($request1)); $this->assertEquals(array($request2), $this->multi->all()); } /** * @covers Guzzle\Http\Curl\CurlMulti::reset */ public function testsResetRemovesRequestsAndResetsState() { $request1 = new Request('GET', 'http://www.google.com/'); $this->multi->add($request1); $this->multi->reset(); $this->assertEquals(array(), $this->multi->all()); $this->assertEquals('idle', $this->multi->getState()); } /** * @covers Guzzle\Http\Curl\CurlMulti::send * @covers Guzzle\Http\Curl\CurlMulti::getState */ public function testSendsRequestsInParallel() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nBody"); $this->assertEquals('idle', $this->multi->getState()); $request = new Request('GET', $this->getServer()->getUrl()); $this->multi->add($request); $this->multi->send(); $this->assertEquals('idle', $this->multi->getState()); $this->assertTrue($this->mock->has(CurlMulti::ADD_REQUEST)); $this->assertTrue($this->mock->has(CurlMulti::COMPLETE)); $this->assertEquals('Body', $request->getResponse()->getBody()->__toString()); // Sending it again will not do anything because there are no requests $this->multi->send(); } /** * @covers Guzzle\Http\Curl\CurlMulti::send */ public function testSendsRequestsThroughCurl() { $this->getServer()->enqueue(array( "HTTP/1.1 204 No content\r\n" . "Content-Length: 0\r\n" . "Server: Jetty(6.1.3)\r\n\r\n", "HTTP/1.1 200 OK\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Length: 4\r\n" . "Server: Jetty(6.1.3)\r\n\r\n" . "data" )); $request1 = new Request('GET', $this->getServer()->getUrl()); $mock1 = $this->getWildcardObserver($request1); $request2 = new Request('GET', $this->getServer()->getUrl()); $mock2 = $this->getWildcardObserver($request2); $this->multi->add($request1); $this->multi->add($request2); $this->multi->send(); $response1 = $request1->getResponse(); $response2 = $request2->getResponse(); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response1); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response2); $this->assertTrue($response1->getBody(true) == 'data' || $response2->getBody(true) == 'data'); $this->assertTrue($response1->getBody(true) == '' || $response2->getBody(true) == ''); $this->assertTrue($response1->getStatusCode() == '204' || $response2->getStatusCode() == '204'); $this->assertNotEquals((string) $response1, (string) $response2); $this->assertTrue($mock1->has('request.before_send')); $this->assertTrue($mock2->has('request.before_send')); } /** * @covers Guzzle\Http\Curl\CurlMulti::send * @covers Guzzle\Http\Exception\MultiTransferException */ public function testSendsThroughCurlAndAggregatesRequestExceptions() { $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Length: 4\r\n" . "Server: Jetty(6.1.3)\r\n" . "\r\n" . "data", "HTTP/1.1 204 No content\r\n" . "Content-Length: 0\r\n" . "Server: Jetty(6.1.3)\r\n" . "\r\n", "HTTP/1.1 404 Not Found\r\n" . "Content-Length: 0\r\n" . "\r\n" )); $request1 = new Request('GET', $this->getServer()->getUrl()); $request2 = new Request('HEAD', $this->getServer()->getUrl()); $request3 = new Request('GET', $this->getServer()->getUrl()); $this->multi->add($request1); $this->multi->add($request2); $this->multi->add($request3); try { $this->multi->send(); $this->fail('MultiTransferException not thrown when aggregating request exceptions'); } catch (MultiTransferException $e) { $this->assertTrue($e->containsRequest($request1)); $this->assertTrue($e->containsRequest($request2)); $this->assertTrue($e->containsRequest($request3)); $this->assertInstanceOf('ArrayIterator', $e->getIterator()); $this->assertEquals(1, count($e)); $exceptions = $e->getIterator(); $response1 = $request1->getResponse(); $response2 = $request2->getResponse(); $response3 = $request3->getResponse(); $this->assertNotEquals((string) $response1, (string) $response2); $this->assertNotEquals((string) $response3, (string) $response1); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response1); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response2); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response3); $failed = $exceptions[0]->getResponse(); $this->assertEquals(404, $failed->getStatusCode()); $this->assertEquals(1, count($e)); // Test the IteratorAggregate functionality foreach ($e as $except) { $this->assertEquals($failed, $except->getResponse()); } $this->assertEquals(1, count($e->getFailedRequests())); $this->assertEquals(2, count($e->getSuccessfulRequests())); $this->assertEquals(3, count($e->getAllRequests())); } } /** * @covers Guzzle\Http\Curl\CurlMulti::send * @covers Guzzle\Http\Curl\CurlMulti::processResponse * @covers Guzzle\Http\Exception\CurlException */ public function testCurlErrorsAreCaught() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); try { $request = RequestFactory::getInstance()->create('GET', 'http://127.0.0.1:9876/'); $request->setClient(new Client()); $request->getCurlOptions()->set(CURLOPT_FRESH_CONNECT, true); $request->getCurlOptions()->set(CURLOPT_FORBID_REUSE, true); $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT_MS, 5); $request->send(); $this->fail('CurlException not thrown'); } catch (CurlException $e) { $m = $e->getMessage(); $this->assertContains('[curl] ', $m); $this->assertContains('[url] http://127.0.0.1:9876/', $m); $this->assertInternalType('array', $e->getCurlInfo()); } } /** * @covers Guzzle\Http\Curl\CurlMulti */ public function testRemovesQueuedRequests() { $request = RequestFactory::getInstance()->create('GET', 'http://127.0.0.1:9876/'); $request->setClient(new Client()); $request->setResponse(new Response(200), true); $this->multi->add($request); $this->multi->send(); $this->assertTrue($this->mock->has(CurlMulti::ADD_REQUEST)); $this->assertTrue($this->mock->has(CurlMulti::COMPLETE) !== false); } /** * @covers Guzzle\Http\Curl\CurlMulti */ public function testRemovesQueuedRequestsAddedInTransit() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" )); $client = new Client($this->getServer()->getUrl()); $r = $client->get(); $r->getEventDispatcher()->addListener('request.receive.status_line', function(Event $event) use ($client) { // Create a request using a queued response $request = $client->get()->setResponse(new Response(200), true); $request->send(); }); $r->send(); $this->assertEquals(1, count($this->getServer()->getReceivedRequests(false))); } /** * @covers Guzzle\Http\Curl\CurlMulti */ public function testProperlyBlocksBasedOnRequestsInScope() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\ntest1", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\ntest2", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\ntest3", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\ntest4", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\ntest5", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\ntest6", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" )); $client = new Client($this->getServer()->getUrl()); $requests = array( $client->get(), $client->get() ); $sendHeadFunction = function($event) use ($client) { $client->head()->send(); }; // Sends 2 new requests in the middle of a CurlMulti loop while other requests // are completing. This causes the scope of the multi handle to go up. $callback = function(Event $event) use ($client, $sendHeadFunction) { $client->getConfig()->set('called', $client->getConfig('called') + 1); if ($client->getConfig('called') <= 2) { $request = $client->get(); $request->getEventDispatcher()->addListener('request.complete', $sendHeadFunction); $request->send(); } }; $requests[0]->getEventDispatcher()->addListener('request.complete', $callback); $client->send($requests); $this->assertEquals(4, count($this->getServer()->getReceivedRequests(false))); } /** * @covers Guzzle\Http\Curl\CurlMulti * @expectedException RuntimeException * @expectedExceptionMessage Testing! */ public function testCatchesExceptionsBeforeSendingCurlMulti() { $client = new Client($this->getServer()->getUrl()); $multi = new CurlMulti(); $client->setCurlMulti($multi); $multi->getEventDispatcher()->addListener(CurlMulti::BEFORE_SEND, function() { throw new \RuntimeException('Testing!'); }); $client->get()->send(); } /** * @covers Guzzle\Http\Curl\CurlMulti * @covers Guzzle\Http\Curl\CurlMulti::removeErroredRequest * @expectedException Guzzle\Common\Exception\ExceptionCollection * @expectedExceptionMessage Thrown before sending! */ public function testCatchesExceptionsBeforeSendingRequests() { $client = new Client($this->getServer()->getUrl()); $request = $client->get(); $request->getEventDispatcher()->addListener('request.before_send', function() { throw new \RuntimeException('Thrown before sending!'); }); $client->send(array($request)); } /** * @covers Guzzle\Http\Curl\CurlMulti * @covers Guzzle\Http\Curl\CurlMulti::removeErroredRequest * @expectedException Guzzle\Http\Exception\BadResponseException */ public function testCatchesExceptionsWhenRemovingQueuedRequests() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $r = $client->get(); $r->getEventDispatcher()->addListener('request.sent', function() use ($client) { // Create a request using a queued response $client->get()->setResponse(new Response(404), true)->send(); }); $r->send(); } /** * @covers Guzzle\Http\Curl\CurlMulti * @covers Guzzle\Http\Curl\CurlMulti::removeErroredRequest * @expectedException Guzzle\Http\Exception\BadResponseException */ public function testCatchesExceptionsWhenRemovingQueuedRequestsBeforeSending() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $r = $client->get(); $r->getEventDispatcher()->addListener('request.before_send', function() use ($client) { // Create a request using a queued response $client->get()->setResponse(new Response(404), true)->send(); }); $r->send(); } /** * @covers Guzzle\Http\Curl\CurlMulti::send * @covers Guzzle\Http\Curl\CurlMulti::removeErroredRequest * @expectedException Guzzle\Common\Exception\ExceptionCollection * @expectedExceptionMessage test */ public function testCatchesRandomExceptionsThrownDuringPerform() { $client = new Client($this->getServer()->getUrl()); $multi = $this->getMock('Guzzle\\Http\\Curl\\CurlMulti', array('perform')); $multi->expects($this->once()) ->method('perform') ->will($this->throwException(new \Exception('test'))); $multi->add($client->get()); $multi->send(); } /** * @covers Guzzle\Http\Curl\CurlMulti::send */ public function testDoesNotSendRequestsDecliningToBeSent() { if (!defined('CURLOPT_TIMEOUT_MS')) { $this->markTestSkipped('Update curl'); } // Create a client that is bound to fail connecting $client = new Client('http://localhost:123', array( 'curl.CURLOPT_PORT' => 123, 'curl.CURLOPT_CONNECTTIMEOUT_MS' => 1, )); $request = $client->get(); $multi = new CurlMulti(); $multi->add($request); // Listen for request exceptions, and when they occur, first change the // state of the request back to transferring, and then just allow it to // exception out $request->getEventDispatcher()->addListener('request.exception', function(Event $event) use ($multi) { $retries = $event['request']->getParams()->get('retries'); // Allow the first failure to retry if ($retries == 0) { $event['request']->setState('transfer'); $event['request']->getParams()->set('retries', 1); // Remove the request to try again $multi->remove($event['request']); $multi->add($event['request'], true); } }); try { $multi->send(); $this->fail('Did not throw an exception at all!?!'); } catch (\Exception $e) { $this->assertEquals(1, $request->getParams()->get('retries')); } } /** * @covers Guzzle\Http\Curl\CurlMulti::send */ public function testDoesNotThrowExceptionsWhenRequestsRecoverWithRetry() { $this->getServer()->flush(); $client = new Client($this->getServer()->getUrl()); $request = $client->get(); $request->getEventDispatcher()->addListener('request.before_send', function(Event $event) { $event['request']->setResponse(new Response(200)); }); $multi = new CurlMulti(); $multi->add($request); $multi->send(); $this->assertEquals(0, count($this->getServer()->getReceivedRequests(false))); } /** * @covers Guzzle\Http\Curl\CurlMulti::send */ public function testDoesNotThrowExceptionsWhenRequestsRecoverWithSuccess() { // Attempt a port that 99.9% is not listening $client = new Client('http://localhost:123'); $request = $client->get(); // Ensure it times out quickly if needed $request->getCurlOptions()->set(CURLOPT_TIMEOUT_MS, 1)->set(CURLOPT_CONNECTTIMEOUT_MS, 1); $request->getEventDispatcher()->addListener('request.exception', function(Event $event) use (&$count) { $event['request']->setResponse(new Response(200)); }); $multi = new CurlMulti(); $multi->add($request); $multi->send(); // Ensure that the exception was caught, and the response was set manually $this->assertEquals(200, $request->getResponse()->getStatusCode()); } /** * @covers Guzzle\Http\Curl\CurlMulti::reset */ public function testHardResetReopensMultiHandle() { $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" )); $stream = fopen('php://temp', 'w+'); $client = new Client($this->getServer()->getUrl()); $client->getConfig()->set('curl.CURLOPT_VERBOSE', true)->set('curl.CURLOPT_STDERR', $stream); $request = $client->get(); $multi = new CurlMulti(); $multi->add($request); $multi->send(); $multi->reset(true); $multi->add($request); $multi->send(); rewind($stream); $this->assertNotContains('Re-using existing connection', stream_get_contents($stream)); } /** * @covers Guzzle\Http\Curl\CurlMulti::checkCurlResult */ public function testThrowsMeaningfulExceptionsForCurlMultiErrors() { $multi = new CurlMulti(); // Set the state of the multi object to sending to trigger the exception $reflector = new \ReflectionMethod('Guzzle\Http\Curl\CurlMulti', 'checkCurlResult'); $reflector->setAccessible(true); // Successful $reflector->invoke($multi, 0); // Known error try { $reflector->invoke($multi, CURLM_BAD_HANDLE); $this->fail('Expected an exception here'); } catch (CurlException $e) { $this->assertContains('The passed-in handle is not a valid CURLM handle.', $e->getMessage()); $this->assertContains('CURLM_BAD_HANDLE', $e->getMessage()); $this->assertContains(strval(CURLM_BAD_HANDLE), $e->getMessage()); } // Unknown error try { $reflector->invoke($multi, 255); $this->fail('Expected an exception here'); } catch (CurlException $e) { $this->assertEquals('Unexpected cURL error: 255', $e->getMessage()); } } /** * @covers Guzzle\Http\Curl\curlMulti::add */ public function testAddsAsyncRequestsNormallyWhenNotSending() { $multi = new CurlMulti(); $request = new Request('GET', 'http://www.google.com/'); $multi->add($request, true); // Ensure that the request was added at the correct next scope $requests = $this->readAttribute($multi, 'requests'); $this->assertEquals(array($request), $requests[0]); } /** * @covers Guzzle\Http\Curl\CurlMulti::send * @covers Guzzle\Http\Message\EntityEnclosingRequest::setState */ public function testRequestBeforeSendIncludesContentLengthHeaderIfEmptyBody() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request = new Request('PUT', $this->getServer()->getUrl()); $that = $this; $request->getEventDispatcher()->addListener('request.before_send', function ($event) use ($that) { $that->assertEquals(0, $event['request']->getHeader('Content-Length')); }); $this->multi->add($request); $this->multi->send(); } } tests/Guzzle/Tests/Http/Curl/CurlVersionTest.php000064400000002227151742734620015756 0ustar00getProperty('version'); $refProperty->setAccessible(true); $refProperty->setValue($instance, array()); $this->assertEquals($info, $instance->getAll()); $this->assertEquals($info, $instance->getAll()); $this->assertEquals($info['version'], $instance->get('version')); $this->assertFalse($instance->get('foo')); } public function testIsSingleton() { $refObject = new \ReflectionClass('Guzzle\Http\Curl\CurlVersion'); $refProperty = $refObject->getProperty('instance'); $refProperty->setAccessible(true); $refProperty->setValue(null, null); $this->assertInstanceOf('Guzzle\Http\Curl\CurlVersion', CurlVersion::getInstance()); } } tests/Guzzle/Tests/Http/Curl/RequestMediatorTest.php000064400000004560151742734620016622 0ustar00events[] = $event; } public function testEmitsEvents() { $request = new EntityEnclosingRequest('PUT', 'http://www.example.com'); $request->setBody('foo'); $request->setResponse(new Response(200)); // Ensure that IO events are emitted $request->getCurlOptions()->set('emit_io', true); // Attach listeners for each event type $request->getEventDispatcher()->addListener('curl.callback.progress', array($this, 'event')); $request->getEventDispatcher()->addListener('curl.callback.read', array($this, 'event')); $request->getEventDispatcher()->addListener('curl.callback.write', array($this, 'event')); $mediator = new RequestMediator($request, true); $mediator->progress('a', 'b', 'c', 'd'); $this->assertEquals(1, count($this->events)); $this->assertEquals('curl.callback.progress', $this->events[0]->getName()); $this->assertEquals(3, $mediator->writeResponseBody('foo', 'bar')); $this->assertEquals(2, count($this->events)); $this->assertEquals('curl.callback.write', $this->events[1]->getName()); $this->assertEquals('bar', $this->events[1]['write']); $this->assertSame($request, $this->events[1]['request']); $this->assertEquals('foo', $mediator->readRequestBody('a', 'b', 3)); $this->assertEquals(3, count($this->events)); $this->assertEquals('curl.callback.read', $this->events[2]->getName()); $this->assertEquals('foo', $this->events[2]['read']); $this->assertSame($request, $this->events[2]['request']); } public function testSetsCurlHandleParameter() { $request = new EntityEnclosingRequest('PUT', 'http://www.example.com'); $mediator = new RequestMediator($request); $handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle')->disableOriginalConstructor()->getMock(); $mediator->setCurlHandle($handle); $this->assertSame($handle, $request->getParams()->get('curl_handle')); } } tests/Guzzle/Tests/Http/EntityBodyTest.php000064400000017616151742734620014700 0ustar00assertEquals('data', (string)$body); $this->assertEquals(4, $body->getContentLength()); $this->assertEquals('PHP', $body->getWrapper()); $this->assertEquals('TEMP', $body->getStreamType()); $handle = fopen(__DIR__ . '/../../../../phpunit.xml.dist', 'r'); if (!$handle) { $this->fail('Could not open test file'); } $body = EntityBody::factory($handle); $this->assertEquals(__DIR__ . '/../../../../phpunit.xml.dist', $body->getUri()); $this->assertTrue($body->isLocal()); $this->assertEquals(__DIR__ . '/../../../../phpunit.xml.dist', $body->getUri()); $this->assertEquals(filesize(__DIR__ . '/../../../../phpunit.xml.dist'), $body->getContentLength()); // make sure that a body will return as the same object $this->assertTrue($body === EntityBody::factory($body)); } /** * @covers Guzzle\Http\EntityBody::factory */ public function testFactoryCreatesTempStreamByDefault() { $body = EntityBody::factory(''); $this->assertEquals('PHP', $body->getWrapper()); $this->assertEquals('TEMP', $body->getStreamType()); $body = EntityBody::factory(); $this->assertEquals('PHP', $body->getWrapper()); $this->assertEquals('TEMP', $body->getStreamType()); } /** * @covers Guzzle\Http\EntityBody::factory */ public function testFactoryCanCreateFromObject() { $body = EntityBody::factory(new QueryString(array('foo' => 'bar'))); $this->assertEquals('foo=bar', (string) $body); } /** * @covers Guzzle\Http\EntityBody::factory * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testFactoryEnsuresObjectsHaveToStringMethod() { EntityBody::factory(new \stdClass('a')); } /** * @covers Guzzle\Http\EntityBody::compress * @covers Guzzle\Http\EntityBody::uncompress * @covers Guzzle\Http\EntityBody::getContentEncoding * @covers Guzzle\Http\EntityBody::setStreamFilterContentEncoding * @covers Guzzle\Http\EntityBody::handleCompression * @covers Guzzle\Http\EntityBody::getContentLength */ public function testHandlesCompression() { $body = EntityBody::factory('testing 123...testing 123'); $this->assertFalse($body->getContentEncoding(), '-> getContentEncoding() must initially return FALSE'); $size = $body->getContentLength(); $body->compress(); $this->assertEquals('gzip', $body->getContentEncoding(), '-> getContentEncoding() must return the correct encoding after compressing'); $this->assertEquals(gzdeflate('testing 123...testing 123'), (string) $body); $this->assertTrue($body->getContentLength() < $size); $this->assertTrue($body->uncompress()); $this->assertEquals('testing 123...testing 123', (string) $body); $this->assertFalse($body->getContentEncoding(), '-> getContentEncoding() must reset to FALSE'); if (in_array('bzip2.*', stream_get_filters())) { $this->assertTrue($body->compress('bzip2.compress')); $this->assertEquals('compress', $body->getContentEncoding(), '-> compress() must set \'compress\' as the Content-Encoding'); } $this->assertFalse($body->compress('non-existent'), '-> compress() must return false when a non-existent stream filter is used'); // Release the body unset($body); // Use gzip compression on the initial content. This will include a // gzip header which will need to be stripped when deflating the stream $body = EntityBody::factory(gzencode('test')); $this->assertSame($body, $body->setStreamFilterContentEncoding('zlib.deflate')); $this->assertTrue($body->uncompress('zlib.inflate')); $this->assertEquals('test', (string)$body); unset($body); // Test using a very long string $largeString = ''; for ($i = 0; $i < 25000; $i++) { $largeString .= chr(rand(33, 126)); } $body = EntityBody::factory($largeString); $this->assertEquals($largeString, (string)$body); $this->assertTrue($body->compress()); $this->assertNotEquals($largeString, (string)$body); $compressed = (string)$body; $this->assertTrue($body->uncompress()); $this->assertEquals($largeString, (string)$body); $this->assertEquals($compressed, gzdeflate($largeString)); $body = EntityBody::factory(fopen(__DIR__ . '/../TestData/compress_test', 'w')); $this->assertFalse($body->compress()); unset($body); unlink(__DIR__ . '/../TestData/compress_test'); } /** * @covers Guzzle\Http\EntityBody::getContentType */ public function testDeterminesContentType() { // Test using a string/temp stream $body = EntityBody::factory('testing 123...testing 123'); $this->assertNull($body->getContentType()); // Use a local file $body = EntityBody::factory(fopen(__FILE__, 'r')); $this->assertContains('text/x-', $body->getContentType()); } /** * @covers Guzzle\Http\EntityBody::getContentMd5 * @covers Guzzle\Http\EntityBody::calculateMd5 * @covers Guzzle\Stream\Stream::getHash */ public function testCreatesMd5Checksum() { $body = EntityBody::factory('testing 123...testing 123'); $this->assertEquals(md5('testing 123...testing 123'), $body->getContentMd5()); $server = $this->getServer()->enqueue( "HTTP/1.1 200 OK" . "\r\n" . "Content-Length: 3" . "\r\n\r\n" . "abc" ); $body = EntityBody::factory(fopen($this->getServer()->getUrl(), 'r')); $this->assertFalse($body->getContentMd5()); } /** * @covers Guzzle\Http\EntityBody::getContentMd5 * @covers Guzzle\Http\EntityBody::calculateMd5 * @covers Guzzle\Stream\Stream::getHash */ public function testSeeksToOriginalPosAfterMd5() { $body = EntityBody::factory('testing 123'); $body->seek(4); $this->assertEquals(md5('testing 123'), $body->getContentMd5()); $this->assertEquals(4, $body->ftell()); $this->assertEquals('ing 123', $body->read(1000)); } /** * @covers Guzzle\Http\EntityBody::factory */ public function testGetTypeFormBodyFactoring() { $body = EntityBody::factory(array('key1' => 'val1', 'key2' => 'val2')); $this->assertEquals('key1=val1&key2=val2', (string)$body); } /** * @covers Guzzle\Http\EntityBody::setRewindFunction * @covers Guzzle\Http\EntityBody::rewind */ public function testAllowsCustomRewind() { $body = EntityBody::factory('foo'); $rewound = false; $body->setRewindFunction(function ($body) use (&$rewound) { $rewound = true; return $body->seek(0); }); $body->seek(2); $this->assertTrue($body->rewind()); $this->assertTrue($rewound); } /** * @covers Guzzle\Http\EntityBody::setRewindFunction * @expectedException \Guzzle\Common\Exception\InvalidArgumentException */ public function testCustomRewindFunctionMustBeCallable() { $body = EntityBody::factory(); $body->setRewindFunction('foo'); } } tests/Guzzle/Tests/Http/Exception/CurlExceptionTest.php000064400000001363151742734620017320 0ustar00assertNull($e->getError()); $this->assertNull($e->getErrorNo()); $this->assertSame($e, $e->setError('test', 12)); $this->assertEquals('test', $e->getError()); $this->assertEquals(12, $e->getErrorNo()); $handle = new CurlHandle(curl_init(), array()); $e->setCurlHandle($handle); $this->assertSame($handle, $e->getCurlHandle()); $handle->close(); } } tests/Guzzle/Tests/Http/Exception/ExceptionTest.php000064400000004201151742734620016464 0ustar00setRequest($request); $this->assertEquals($request, $e->getRequest()); } /** * @covers Guzzle\Http\Exception\BadResponseException */ public function testBadResponseException() { $e = new BadResponseException('Message'); $response = new Response(200); $e->setResponse($response); $this->assertEquals($response, $e->getResponse()); } /** * @covers Guzzle\Http\Exception\BadResponseException::factory */ public function testCreatesGenericErrorExceptionOnError() { $request = new Request('GET', 'http://www.example.com'); $response = new Response(307); $e = BadResponseException::factory($request, $response); $this->assertInstanceOf('Guzzle\Http\Exception\BadResponseException', $e); } /** * @covers Guzzle\Http\Exception\BadResponseException::factory */ public function testCreatesClientErrorExceptionOnClientError() { $request = new Request('GET', 'http://www.example.com'); $response = new Response(404); $e = BadResponseException::factory($request, $response); $this->assertInstanceOf('Guzzle\Http\Exception\ClientErrorResponseException', $e); } /** * @covers Guzzle\Http\Exception\BadResponseException::factory */ public function testCreatesServerErrorExceptionOnServerError() { $request = new Request('GET', 'http://www.example.com'); $response = new Response(503); $e = BadResponseException::factory($request, $response); $this->assertInstanceOf('Guzzle\Http\Exception\ServerErrorResponseException', $e); } } tests/Guzzle/Tests/Http/IoEmittingEntityBodyTest.php000064400000002542151742734620016661 0ustar00decorated = EntityBody::factory('hello'); $this->body = new IoEmittingEntityBody($this->decorated); } public function testEmitsReadEvents() { $e = null; $this->body->getEventDispatcher()->addListener('body.read', function ($event) use (&$e) { $e = $event; }); $this->assertEquals('hel', $this->body->read(3)); $this->assertEquals('hel', $e['read']); $this->assertEquals(3, $e['length']); $this->assertSame($this->body, $e['body']); } public function testEmitsWriteEvents() { $e = null; $this->body->getEventDispatcher()->addListener('body.write', function ($event) use (&$e) { $e = $event; }); $this->body->seek(0, SEEK_END); $this->assertEquals(5, $this->body->write('there')); $this->assertEquals('there', $e['write']); $this->assertEquals(5, $e['result']); $this->assertSame($this->body, $e['body']); $this->assertEquals('hellothere', (string) $this->body); } } tests/Guzzle/Tests/Http/Message/AbstractMessageTest.php000064400000025367151742734620017244 0ustar00mock = $this->getMockForAbstractClass('Guzzle\Http\Message\AbstractMessage'); } /** * @covers Guzzle\Http\Message\AbstractMessage::getParams */ public function testGetParams() { $request = new Request('GET', 'http://example.com'); $this->assertInstanceOf('Guzzle\\Common\\Collection', $request->getParams()); } /** * @covers Guzzle\Http\Message\AbstractMessage::addHeaders */ public function testAddHeaders() { $this->mock->setHeader('A', 'B'); $this->assertEquals($this->mock, $this->mock->addHeaders(array( 'X-Data' => '123' ))); $this->assertTrue($this->mock->hasHeader('X-Data') !== false); $this->assertTrue($this->mock->hasHeader('A') !== false); } /** * @covers Guzzle\Http\Message\AbstractMessage::setHeader */ public function testAllowsHeaderToSetAsHeader() { $h = new Header('A', 'B'); $this->mock->setHeader('A', $h); $this->assertSame($h, $this->mock->getHeader('A')); } /** * @covers Guzzle\Http\Message\AbstractMessage::getHeaders */ public function testGetHeader() { $this->mock->setHeader('Test', '123'); $this->assertEquals('123', $this->mock->getHeader('Test')); } /** * @covers Guzzle\Http\Message\AbstractMessage::getHeaders * @covers Guzzle\Http\Message\AbstractMessage::getHeader * @covers Guzzle\Http\Message\AbstractMessage::setHeaders */ public function testGetHeaders() { $this->assertSame($this->mock, $this->mock->setHeaders(array( 'a' => 'b', 'c' => 'd' ))); $this->assertEquals(array( 'a' => array('b'), 'c' => array('d') ), $this->mock->getHeaders()->getAll()); foreach ($this->mock->getHeaders(true) as $key => $value) { $this->assertInternalType('string', $key); $this->assertInstanceOf('Guzzle\Http\Message\Header', $value); } } /** * @covers Guzzle\Http\Message\AbstractMessage::getHeaderLines */ public function testGetHeaderLinesUsesGlue() { $this->mock->setHeaders(array('a' => 'b', 'c' => 'd')); $this->mock->addHeader('a', 'e'); $this->mock->getHeader('a')->setGlue('!'); $this->assertEquals(array( 'a: b!e', 'c: d' ), $this->mock->getHeaderLines()); } /** * @covers Guzzle\Http\Message\AbstractMessage::hasHeader */ public function testHasHeader() { $this->assertFalse($this->mock->hasHeader('Foo')); $this->mock->setHeader('Foo', 'Bar'); $this->assertEquals(true, $this->mock->hasHeader('Foo')); $this->mock->setHeader('foo', 'yoo'); $this->assertEquals(true, $this->mock->hasHeader('Foo')); $this->assertEquals(true, $this->mock->hasHeader('foo')); $this->assertEquals(false, $this->mock->hasHeader('bar')); } /** * @covers Guzzle\Http\Message\AbstractMessage::removeHeader * @covers Guzzle\Http\Message\AbstractMessage::setHeader */ public function testRemoveHeader() { $this->mock->setHeader('Foo', 'Bar'); $this->assertEquals(true, $this->mock->hasHeader('Foo')); $this->mock->removeHeader('Foo'); $this->assertFalse($this->mock->hasHeader('Foo')); } /** * @covers Guzzle\Http\Message\AbstractMessage */ public function testHoldsCacheControlDirectives() { $mock = $this->mock; // Set a directive using a header $mock->setHeader('Cache-Control', 'max-age=100'); $this->assertEquals(100, $mock->getCacheControlDirective('max-age')); // Set a header using the directive and check that the header was updated $this->assertSame($mock, $mock->addCacheControlDirective('max-age', 80)); $this->assertEquals(80, $mock->getCacheControlDirective('max-age')); $this->assertEquals('max-age=80', $mock->getHeader('Cache-Control')); // Remove the directive $this->assertEquals($mock, $mock->removeCacheControlDirective('max-age')); $this->assertEquals('', $mock->getHeader('Cache-Control')); $this->assertEquals(null, $mock->getCacheControlDirective('max-age')); // Remove a non-existent directive $this->assertEquals($mock, $mock->removeCacheControlDirective('max-age')); // Has directive $this->assertFalse($mock->hasCacheControlDirective('max-age')); $mock->addCacheControlDirective('must-revalidate'); $this->assertTrue($mock->hasCacheControlDirective('must-revalidate')); // Make sure that it works with multiple Cache-Control headers $mock->setHeader('Cache-Control', 'must-revalidate, max-age=100'); $mock->addHeaders(array( 'Cache-Control' => 'no-cache' )); $this->assertEquals(true, $mock->getCacheControlDirective('no-cache')); $this->assertEquals(true, $mock->getCacheControlDirective('must-revalidate')); $this->assertEquals(100, $mock->getCacheControlDirective('max-age')); } /** * In some rare cases. Like with the Twitter Search API: * * http://search.twitter.com/search.json?q=from:mtdowling * * There is more than once Cache-Control added. * Twice the max-age for example. * * @covers Guzzle\Http\Message\AbstractMessage */ public function testDoubleCacheControlDirectives() { $mock = $this->mock; $mock->setHeader('Cache-Control', 'max-age=15, must-revalidate, max-age=300'); $this->assertEquals(15, $mock->getCacheControlDirective('max-age')); } public function tokenizedHeaderProvider() { return array( array('ISO-8859-1,utf-8;q=0.7,*;q=0.7"', ';', array( 'ISO-8859-1,utf-8', 'q' => array('0.7,*', '0.7"') )), array('gzip,deflate', ',', array('gzip', 'deflate')), array('en-us,en;q=0.5', ';', array( 'en-us,en', 'q' => '0.5' )) ); } /** * @covers Guzzle\Http\Message\AbstractMessage::getTokenizedHeader * @dataProvider tokenizedHeaderProvider */ public function testConvertsTokenizedHeadersToArray($string, $token, $result) { $this->mock->setHeader('test', $string); $this->assertEquals($result, $this->mock->getTokenizedHeader('test', $token)->getAll()); } /** * @covers Guzzle\Http\Message\AbstractMessage::setTokenizedHeader * @dataProvider tokenizedHeaderProvider */ public function testConvertsArrayToTokenizedHeader($string, $token, $result) { $this->mock->setTokenizedHeader('test', $result, $token); $this->assertEquals($string, $this->mock->getHeader('test')); } /** * @covers Guzzle\Http\Message\AbstractMessage::setTokenizedHeader * @expectedException InvalidArgumentException */ public function testTokenizedHeaderMustBeArrayToSet() { $this->mock->setTokenizedHeader('test', false); } /** * @covers Guzzle\Http\Message\AbstractMessage::getTokenizedHeader */ public function testReturnsNullWhenTokenizedHeaderNotFound() { $this->assertNull($this->mock->getTokenizedHeader('foo')); } /** * @covers Guzzle\Http\Message\AbstractMessage::getTokenizedHeader */ public function testMultipleTokenizedHeadersAreCombined() { $this->mock->addHeader('test', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'); $this->mock->addHeader('test', 'foo;q=123,*;q=456;q=0.7'); $this->mock->addHeader('Content-Length', 0); $this->assertEquals(array( 0 => 'ISO-8859-1,utf-8', 'q' => array('0.7,*', '0.7', '123,*', '456'), 2 => 'foo', ), $this->mock->getTokenizedHeader('test')->getAll()); } /** * @covers Guzzle\Http\Message\AbstractMessage::getHeader */ public function testReturnsNullWhenHeaderIsNotFound() { $this->assertNull($this->mock->getHeader('foo')); } /** * @covers Guzzle\Http\Message\AbstractMessage::addHeaders * @covers Guzzle\Http\Message\AbstractMessage::addHeader * @covers Guzzle\Http\Message\AbstractMessage::getHeader */ public function testAddingHeadersWithMultipleValuesUsesCaseInsensitiveKey() { $this->mock->addHeaders(array( 'test' => '123', 'Test' => '456' )); $this->mock->addHeader('TEST', '789'); $headers = array( 'test' => array('123'), 'Test' => array('456'), 'TEST' => array('789'), ); $header = $this->mock->getHeader('test'); $this->assertInstanceOf('Guzzle\Http\Message\Header', $header); $this->assertSame($header, $this->mock->getHeader('TEST')); $this->assertSame($header, $this->mock->getHeader('TeSt')); $this->assertEquals($headers, $header->raw()); } /** * @covers Guzzle\Http\Message\AbstractMessage::setHeader */ public function testSettingHeadersUsesCaseInsensitiveKey() { $this->mock->setHeader('test', '123'); $this->mock->setHeader('TEST', '456'); $this->assertEquals('456', $this->mock->getHeader('test')); $this->assertEquals('456', $this->mock->getHeader('TEST')); } /** * @covers Guzzle\Http\Message\AbstractMessage::addHeaders */ public function testAddingHeadersPreservesOriginalHeaderCase() { $this->mock->addHeaders(array( 'test' => '123', 'Test' => 'abc' )); $this->mock->addHeader('test', '456'); $this->mock->addHeader('test', '789'); $header = $this->mock->getHeader('test'); $this->assertEquals(array('123', '456', '789', 'abc'), $header->toArray()); $this->mock->addHeader('Test', 'abc'); // Add a header of a different name $this->assertEquals(array( 'test' => array('123', '456', '789'), 'Test' => array('abc', 'abc') ), $this->mock->getHeader('test')->raw()); } /** * @covers Guzzle\Http\Message\AbstractMessage */ public function testCanStoreEmptyHeaders() { $this->mock->setHeader('Content-Length', 0); $this->assertTrue($this->mock->hasHeader('Content-Length')); $this->assertEquals(0, $this->mock->getHeader('Content-Length', true)); } } tests/Guzzle/Tests/Http/Message/EntityEnclosingRequestTest.php000064400000050555151742734620020660 0ustar00client = new Client(); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::__construct */ public function testConstructorConfiguresRequest() { $request = new EntityEnclosingRequest('PUT', 'http://test.com', array( 'X-Test' => '123' )); $request->setBody('Test'); $this->assertEquals('123', $request->getHeader('X-Test')); $this->assertNull($request->getHeader('Expect')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testCanSetBodyWithoutOverridingContentType() { $request = new EntityEnclosingRequest('PUT', 'http://test.com', array('Content-Type' => 'foooooo')); $request->setBody('{"a":"b"}'); $this->assertEquals('foooooo', $request->getHeader('Content-Type')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::__toString * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFields */ public function testRequestIncludesBodyInMessage() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.guzzle-project.com/', null, 'data'); $this->assertEquals("PUT / HTTP/1.1\r\n" . "Host: www.guzzle-project.com\r\n" . "Content-Length: 4\r\n\r\n" . "data", (string) $request); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::__toString */ public function testRequestIncludesPostBodyInMessageOnlyWhenNoPostFiles() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/', null, array( 'foo' => 'bar' )); $this->assertEquals("POST / HTTP/1.1\r\n" . "Host: www.guzzle-project.com\r\n" . "Content-Type: application/x-www-form-urlencoded\r\n\r\n" . "foo=bar", (string) $request); $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/', null, array( 'foo' => '@' . __FILE__ )); $this->assertEquals("POST / HTTP/1.1\r\n" . "Host: www.guzzle-project.com\r\n" . "Content-Type: multipart/form-data\r\n" . "Expect: 100-Continue\r\n\r\n", (string) $request); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::__toString * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFields */ public function testAddsPostFieldsAndSetsContentLength() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/', null, array( 'data' => '123' )); $this->assertEquals("POST / HTTP/1.1\r\n" . "Host: www.guzzle-project.com\r\n" . "Content-Type: application/x-www-form-urlencoded\r\n\r\n" . "data=123", (string) $request); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::__toString * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFields */ public function testAddsPostFilesAndSetsContentType() { $request = RequestFactory::getInstance()->create('POST', 'http://www.test.com/') ->addPostFiles(array( 'file' => __FILE__ ))->addPostFields(array( 'a' => 'b' )); $message = (string) $request; $this->assertEquals('multipart/form-data', $request->getHeader('Content-Type')); $this->assertEquals('100-Continue', $request->getHeader('Expect')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields */ public function testRequestBodyContainsPostFiles() { $request = RequestFactory::getInstance()->create('POST', 'http://www.test.com/'); $request->addPostFields(array( 'test' => '123' )); $this->assertContains("\r\n\r\ntest=123", (string) $request); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields */ public function testRequestBodyAddsContentLength() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.test.com/'); $request->setBody(EntityBody::factory('test')); $this->assertEquals(4, (string) $request->getHeader('Content-Length')); $this->assertFalse($request->hasHeader('Transfer-Encoding')); } /** * Tests using a Transfer-Encoding chunked entity body already set * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testRequestBodyDoesNotUseContentLengthWhenChunked() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.test.com/'); $request->setBody(EntityBody::factory('test'), null, true); $this->assertNull($request->getHeader('Content-Length')); $this->assertTrue($request->hasHeader('Transfer-Encoding')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::getBody * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testRequestHasMutableBody() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.guzzle-project.com/', null, 'data'); $body = $request->getBody(); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $body); $this->assertSame($body, $request->getBody()); $newBody = EntityBody::factory('foobar'); $request->setBody($newBody); $this->assertEquals('foobar', (string) $request->getBody()); $this->assertSame($newBody, $request->getBody()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFields * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFields * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFiles */ public function testSetPostFields() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/'); $this->assertInstanceOf('Guzzle\\Http\\QueryString', $request->getPostFields()); $fields = new QueryString(array( 'a' => 'b' )); $request->addPostFields($fields); $this->assertEquals($fields->getAll(), $request->getPostFields()->getAll()); $this->assertEquals(array(), $request->getPostFiles()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFiles * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles */ public function testSetPostFiles() { $request = RequestFactory::getInstance()->create('POST', $this->getServer()->getUrl()) ->setClient(new Client()) ->addPostFiles(array(__FILE__)) ->addPostFields(array( 'test' => 'abc' )); $request->getCurlOptions()->set('debug', true); $this->assertEquals(array( 'test' => 'abc' ), $request->getPostFields()->getAll()); $files = $request->getPostFiles(); $post = $files['file'][0]; $this->assertEquals('file', $post->getFieldName()); $this->assertContains('text/x-', $post->getContentType()); $this->assertEquals(__FILE__, $post->getFilename()); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request->send(); $this->assertNotNull($request->getHeader('Content-Length')); $this->assertContains('multipart/form-data; boundary=', (string) $request->getHeader('Content-Type'), '-> cURL must add the boundary'); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFile * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testSetPostFilesThrowsExceptionWhenFileIsNotFound() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/') ->addPostFiles(array( 'file' => 'filenotfound.ini' )); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFile * @expectedException Guzzle\Http\Exception\RequestException */ public function testThrowsExceptionWhenNonStringsAreAddedToPost() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/') ->addPostFile('foo', new \stdClass()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFile */ public function testAllowsContentTypeInPostUploads() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/') ->addPostFile('foo', __FILE__, 'text/plain'); $this->assertEquals(array( new PostFile('foo', __FILE__, 'text/plain') ), $request->getPostFile('foo')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFile */ public function testGuessesContentTypeOfPostUpload() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/') ->addPostFile('foo', __FILE__); $file = $request->getPostFile('foo'); $this->assertContains('text/x-', $file[0]->getContentType()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles */ public function testAllowsContentDispositionFieldsInPostUploadsWhenSettingInBulk() { $postFile = new PostFile('foo', __FILE__, 'text/x-php'); $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/') ->addPostFiles(array('foo' => $postFile)); $this->assertEquals(array($postFile), $request->getPostFile('foo')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setPostField * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields */ public function testPostRequestsUseApplicationXwwwForUrlEncodedForArrays() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/'); $request->setPostField('a', 'b'); $this->assertContains("\r\n\r\na=b", (string) $request); $this->assertEquals('application/x-www-form-urlencoded', $request->getHeader('Content-Type')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields */ public function testProcessMethodAddsContentType() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/'); $request->setPostField('a', 'b'); $this->assertEquals('application/x-www-form-urlencoded', $request->getHeader('Content-Type')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields */ public function testPostRequestsUseMultipartFormDataWithFiles() { $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/'); $request->addPostFiles(array('file' => __FILE__)); $this->assertEquals('multipart/form-data', $request->getHeader('Content-Type')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody * @covers Guzzle\Http\Message\EntityEnclosingRequest::processPostFields */ public function testCanSendMultipleRequestsUsingASingleRequestObject() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 201 Created\r\nContent-Length: 0\r\n\r\n", )); // Send the first request $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl()) ->setBody('test') ->setClient(new Client()); $request->send(); $this->assertEquals(200, $request->getResponse()->getStatusCode()); // Send the second request $request->setBody('abcdefg', 'application/json', false); $request->send(); $this->assertEquals(201, $request->getResponse()->getStatusCode()); // Ensure that the same request was sent twice with different bodies $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals(2, count($requests)); $this->assertEquals(4, $requests[0]->getHeader('Content-Length', true)); $this->assertEquals(7, $requests[1]->getHeader('Content-Length', true)); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostField * @covers Guzzle\Http\Message\EntityEnclosingRequest::removePostField */ public function testRemovingPostFieldRebuildsPostFields() { $request = new EntityEnclosingRequest('POST', 'http://test.com'); $request->setPostField('test', 'value'); $request->removePostField('test'); $this->assertNull($request->getPostField('test')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testUsesChunkedTransferWhenBodyLengthCannotBeDetermined() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request = new EntityEnclosingRequest('PUT', 'http://test.com/'); $request->setBody(fopen($this->getServer()->getUrl(), 'r')); $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding')); $this->assertFalse($request->hasHeader('Content-Length')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody * @expectedException Guzzle\Http\Exception\RequestException */ public function testThrowsExceptionWhenContentLengthCannotBeDeterminedAndUsingHttp1() { $request = new EntityEnclosingRequest('PUT', 'http://test.com/'); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request->setProtocolVersion('1.0'); $request->setBody(fopen($this->getServer()->getUrl(), 'r')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFiles */ public function testAllowsNestedPostData() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->addPostFields(array( 'a' => array('b', 'c') )); $this->assertEquals(array( 'a' => array('b', 'c') ), $request->getPostFields()->getAll()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFields */ public function testAllowsEmptyFields() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->addPostFields(array( 'a' => '' )); $this->assertEquals(array( 'a' => '' ), $request->getPostFields()->getAll()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles * @expectedException Guzzle\Http\Exception\RequestException */ public function testFailsOnInvalidFiles() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->addPostFiles(array( 'a' => new \stdClass() )); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFields * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFields */ public function testHandlesEmptyStrings() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->addPostFields(array( 'a' => '', 'b' => null, 'c' => 'Foo' )); $this->assertEquals(array( 'a' => '', 'b' => null, 'c' => 'Foo' ), $request->getPostFields()->getAll()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFiles * @covers Guzzle\Http\Message\EntityEnclosingRequest::getPostFile * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFile * @covers Guzzle\Http\Message\EntityEnclosingRequest::removePostFile */ public function testHoldsPostFiles() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->addPostFile('foo', __FILE__); $request->addPostFile(new PostFile('foo', __FILE__)); $this->assertArrayHasKey('foo', $request->getPostFiles()); $foo = $request->getPostFile('foo'); $this->assertEquals(2, count($foo)); $this->assertEquals(__FILE__, $foo[0]->getFilename()); $this->assertEquals(__FILE__, $foo[1]->getFilename()); $request->removePostFile('foo'); $this->assertEquals(array(), $request->getPostFiles()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles */ public function testAllowsAtPrefixWhenAddingPostFiles() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->addPostFiles(array( 'foo' => '@' . __FILE__ )); $foo = $request->getPostFile('foo'); $this->assertEquals(__FILE__, $foo[0]->getFilename()); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setState */ public function testSetStateToTransferWithEmptyBodySetsContentLengthToZero() { $request = new EntityEnclosingRequest('POST', 'http://test.com/'); $request->setState($request::STATE_TRANSFER); $this->assertEquals('0', (string) $request->getHeader('Content-Length')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setExpectHeaderCutoff * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testSettingExpectHeaderCutoffChangesRequest() { $request = new EntityEnclosingRequest('PUT', 'http://test.com/'); $request->setHeader('Expect', '100-Continue'); $request->setExpectHeaderCutoff(false); $this->assertNull($request->getHeader('Expect')); // There is not body, so remove the expect header $request->setHeader('Expect', '100-Continue'); $request->setExpectHeaderCutoff(10); $this->assertNull($request->getHeader('Expect')); // The size is less than the cutoff $request->setBody('foo'); $this->assertNull($request->getHeader('Expect')); // The size is greater than the cutoff $request->setBody('foobazbarbamboo'); $this->assertNotNull($request->getHeader('Expect')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::configureRedirects */ public function testStrictRedirectsCanBeSpecifiedOnEntityEnclosingRequests() { $request = new EntityEnclosingRequest('PUT', 'http://test.com/'); $request->configureRedirects(true); $this->assertTrue($request->getParams()->get(RedirectPlugin::STRICT_REDIRECTS)); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::configureRedirects */ public function testCanDisableRedirects() { $request = new EntityEnclosingRequest('PUT', 'http://test.com/'); $request->configureRedirects(false, false); $this->assertTrue($request->getParams()->get(RedirectPlugin::DISABLE)); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testSetsContentTypeWhenSettingBodyByGuessingFromPath() { $request = new EntityEnclosingRequest('PUT', 'http://test.com/foo.json'); $request->setBody('{"a":"b"}'); $this->assertEquals('application/json', (string) $request->getHeader('Content-Type')); } /** * @covers Guzzle\Http\Message\EntityEnclosingRequest::setBody */ public function testSetsContentTypeWhenSettingBodyByGuessingFromEntityBody() { $request = new EntityEnclosingRequest('PUT', 'http://test.com/foo'); $request->setBody(EntityBody::factory(fopen(__FILE__, 'r'))); $this->assertEquals('text/x-php', (string) $request->getHeader('Content-Type')); } } tests/Guzzle/Tests/Http/Message/HeaderComparisonTest.php000064400000005640151742734620017407 0ustar00 'Foo' ), array( 'Content-Length' => 'Foo' ), false), // Missing header array(array( 'X-Foo' => 'Bar' ), array(), array( '- X-Foo' => 'Bar' )), // Extra headers is present array(array( 'X-Foo' => 'Bar' ), array( 'X-Foo' => 'Bar', 'X-Baz' => 'Jar' ), array( '+ X-Baz' => 'Jar' )), // Header is present but must be absent array(array( '!X-Foo' => '*' ), array( 'X-Foo' => 'Bar' ), array( '++ X-Foo' => 'Bar' )), // Different values array(array( 'X-Foo' => 'Bar' ), array( 'X-Foo' => 'Baz' ), array( 'X-Foo' => 'Baz != Bar' )), // Wildcard search passes array(array( 'X-Foo' => '*' ), array( 'X-Foo' => 'Bar' ), false), // Wildcard search fails array(array( 'X-Foo' => '*' ), array(), array( '- X-Foo' => '*' )), // Ignore extra header if present array(array( 'X-Foo' => '*', '_X-Bar' => '*', ), array( 'X-Foo' => 'Baz', 'X-Bar' => 'Jar' ), false), // Ignore extra header if present and is not array(array( 'X-Foo' => '*', '_X-Bar' => '*', ), array( 'X-Foo' => 'Baz' ), false), // Case insensitive array(array( 'X-Foo' => '*', '_X-Bar' => '*', ), array( 'x-foo' => 'Baz', 'x-BAR' => 'baz' ), false), // Case insensitive with collection array(array( 'X-Foo' => '*', '_X-Bar' => '*', ), new Collection(array( 'x-foo' => 'Baz', 'x-BAR' => 'baz' )), false), ); } /** * @dataProvider filterProvider */ public function testComparesHeaders($filters, $headers, $result) { $compare = new HeaderComparison(); $this->assertEquals($result, $compare->compare($filters, $headers)); } } tests/Guzzle/Tests/Http/Message/HeaderTest.php000064400000007570151742734620015360 0ustar00 array('foo', 'Foo'), 'Zoo' => 'bar', ); public function testRawReturnsRawArray() { $i = new Header('Zoo', $this->test); $this->assertEquals(array( 'zoo' => array('foo', 'Foo'), 'Zoo' => array('bar') ), $i->raw()); } public function testStoresHeaderName() { $i = new Header('Zoo', $this->test); $this->assertEquals('Zoo', $i->getName()); } public function testConvertsToString() { $i = new Header('Zoo', $this->test); $this->assertEquals('foo, Foo, bar', (string) $i); $i->setGlue('; '); $this->assertEquals('foo; Foo; bar', (string) $i); } public function testNormalizesCases() { $h = new Header('Zoo', $this->test); $h->normalize(); $this->assertEquals(array( 'Zoo' => array('foo', 'Foo', 'bar') ), $h->raw()); } public function testNormalizesGluedHeaders() { $h = new Header('Zoo', array('foo, Faz', 'bar')); $result = $h->normalize(true)->toArray(); natsort($result); $this->assertEquals(array('bar', 'foo', 'Faz'), $result); } public function testCanSearchForValues() { $h = new Header('Zoo', $this->test); $this->assertTrue($h->hasValue('foo')); $this->assertTrue($h->hasValue('Foo')); $this->assertTrue($h->hasValue('bar')); $this->assertFalse($h->hasValue('moo')); $this->assertFalse($h->hasValue('FoO')); $this->assertTrue($h->hasValue('FoO', true)); } public function testIsCountable() { $h = new Header('Zoo', $this->test); $this->assertEquals(3, count($h)); } public function testCanBeIterated() { $h = new Header('Zoo', $this->test); $results = array(); foreach ($h as $key => $value) { $results[$key] = $value; } $this->assertEquals(array( 'foo', 'Foo', 'bar' ), $results); } public function testAllowsFalseyValues() { // Allows 0 $h = new Header('Foo', 0, ';'); $this->assertEquals('0', (string) $h); $this->assertEquals(1, count($h)); $this->assertEquals(';', $h->getGlue()); // Does not add a null header by default $h = new Header('Foo'); $this->assertEquals('', (string) $h); $this->assertEquals(0, count($h)); // Allows null array for a single null header $h = new Header('Foo', array(null)); $this->assertEquals('', (string) $h); $this->assertEquals(1, count($h)); // Allows empty string $h = new Header('Foo', ''); $this->assertEquals('', (string) $h); $this->assertEquals(1, count($h)); } public function testUsesHeaderNameWhenNoneIsSupplied() { $h = new Header('Foo', 'bar', ';'); $h->add('baz'); $this->assertEquals(array('Foo'), array_keys($h->raw())); } public function testCanCheckForExactHeaderValues() { $h = new Header('Foo', 'bar', ';'); $this->assertTrue($h->hasExactHeader('Foo')); $this->assertFalse($h->hasExactHeader('foo')); } public function testCanRemoveValues() { $h = new Header('Foo', array('Foo', 'baz', 'bar')); $h->removeValue('bar'); $this->assertTrue($h->hasValue('Foo')); $this->assertFalse($h->hasValue('bar')); $this->assertTrue($h->hasValue('baz')); } public function testAllowsArrayInConstructor() { $h = new Header('Foo', array('Testing', '123', 'Foo=baz')); $this->assertEquals(array('Testing', '123', 'Foo=baz'), $h->toArray()); } } tests/Guzzle/Tests/Http/Message/PostFileTest.php000064400000004141151742734620015704 0ustar00assertEquals('foo', $file->getFieldName()); $this->assertEquals(__FILE__, $file->getFilename()); $this->assertEquals('x-foo', $file->getContentType()); } public function testRemovesLeadingAtSymbolFromPath() { $file = new PostFile('foo', '@' . __FILE__); $this->assertEquals(__FILE__, $file->getFilename()); } /** * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testEnsuresFileIsReadable() { $file = new PostFile('foo', '/foo/baz/bar'); } public function testCanChangeContentType() { $file = new PostFile('foo', '@' . __FILE__); $file->setContentType('Boo'); $this->assertEquals('Boo', $file->getContentType()); } public function testCanChangeFieldName() { $file = new PostFile('foo', '@' . __FILE__); $file->setFieldName('Boo'); $this->assertEquals('Boo', $file->getFieldName()); } public function testReturnsCurlValueString() { $file = new PostFile('foo', __FILE__); $this->assertContains('@' . __FILE__ . ';type=text/x-', $file->getCurlString()); } public function testContentDispositionFilePathIsStripped() { $this->getServer()->flush(); $client = new Client($this->getServer()->getUrl()); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request = $client->post()->addPostFile('file', __FILE__); $request->send(); $requests = $this->getServer()->getReceivedRequests(false); $this->assertContains('POST / HTTP/1.1', $requests[0]); $this->assertContains('Content-Disposition: form-data; name="file"; filename="PostFileTest.php"', $requests[0]); } } tests/Guzzle/Tests/Http/Message/RequestFactoryTest.php000064400000040503151742734620017141 0ustar00assertSame($factory, RequestFactory::getInstance()); } /** * @covers Guzzle\Http\Message\RequestFactory::create * @covers Guzzle\Http\Message\RequestFactory::getInstance */ public function testCreatesNewGetRequests() { $request = RequestFactory::getInstance()->create('GET', 'http://www.google.com/'); $this->assertInstanceOf('Guzzle\\Http\\Message\\MessageInterface', $request); $this->assertInstanceOf('Guzzle\\Http\\Message\\RequestInterface', $request); $this->assertInstanceOf('Guzzle\\Http\\Message\\Request', $request); $this->assertEquals('GET', $request->getMethod()); $this->assertEquals('http', $request->getScheme()); $this->assertEquals('http://www.google.com/', $request->getUrl()); $this->assertEquals('www.google.com', $request->getHost()); $this->assertEquals('/', $request->getPath()); $this->assertEquals('/', $request->getResource()); // Create a GET request with a custom receiving body $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $b = EntityBody::factory(); $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl(), null, $b); $request->setClient(new Client()); $response = $request->send(); $this->assertSame($b, $response->getBody()); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesPutRequests() { // Test using a string $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, 'Data'); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('http', $request->getScheme()); $this->assertEquals('http://www.google.com/path?q=1&v=2', $request->getUrl()); $this->assertEquals('www.google.com', $request->getHost()); $this->assertEquals('/path', $request->getPath()); $this->assertEquals('/path?q=1&v=2', $request->getResource()); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody()); $this->assertEquals('Data', (string) $request->getBody()); unset($request); // Test using an EntityBody $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, EntityBody::factory('Data')); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('Data', (string) $request->getBody()); // Test using a resource $resource = fopen('php://temp', 'w+'); fwrite($resource, 'Data'); $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, $resource); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('Data', (string) $request->getBody()); // Test using an object that can be cast as a string $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, Url::factory('http://www.example.com/')); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('http://www.example.com/', (string) $request->getBody()); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesHeadAndDeleteRequests() { $request = RequestFactory::getInstance()->create('DELETE', 'http://www.test.com/'); $this->assertEquals('DELETE', $request->getMethod()); $request = RequestFactory::getInstance()->create('HEAD', 'http://www.test.com/'); $this->assertEquals('HEAD', $request->getMethod()); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesOptionsRequests() { $request = RequestFactory::getInstance()->create('OPTIONS', 'http://www.example.com/'); $this->assertEquals('OPTIONS', $request->getMethod()); $this->assertInstanceOf('Guzzle\\Http\\Message\\Request', $request); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesNewPutRequestWithBody() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, 'Data'); $this->assertEquals('Data', (string) $request->getBody()); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesNewPostRequestWithFields() { // Use an array $request = RequestFactory::getInstance()->create('POST', 'http://www.google.com/path?q=1&v=2', null, array( 'a' => 'b' )); $this->assertEquals(array('a' => 'b'), $request->getPostFields()->getAll()); unset($request); // Use a collection $request = RequestFactory::getInstance()->create('POST', 'http://www.google.com/path?q=1&v=2', null, new Collection(array( 'a' => 'b' ))); $this->assertEquals(array('a' => 'b'), $request->getPostFields()->getAll()); // Use a QueryString $request = RequestFactory::getInstance()->create('POST', 'http://www.google.com/path?q=1&v=2', null, new QueryString(array( 'a' => 'b' ))); $this->assertEquals(array('a' => 'b'), $request->getPostFields()->getAll()); $request = RequestFactory::getInstance()->create('POST', 'http://www.test.com/', null, array( 'a' => 'b', 'file' => '@' . __FILE__ )); $this->assertEquals(array( 'a' => 'b' ), $request->getPostFields()->getAll()); $files = $request->getPostFiles(); $this->assertInstanceOf('Guzzle\Http\Message\PostFile', $files['file'][0]); } /** * @covers Guzzle\Http\Message\RequestFactory::fromParts * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesFromParts() { $parts = parse_url('http://michael:123@www.google.com:8080/path?q=1&v=2'); $request = RequestFactory::getInstance()->fromParts('PUT', $parts, null, 'Data'); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('http', $request->getScheme()); $this->assertEquals('http://www.google.com:8080/path?q=1&v=2', $request->getUrl()); $this->assertEquals('www.google.com', $request->getHost()); $this->assertEquals('www.google.com:8080', $request->getHeader('Host')); $this->assertEquals('/path', $request->getPath()); $this->assertEquals('/path?q=1&v=2', $request->getResource()); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody()); $this->assertEquals('Data', (string)$request->getBody()); $this->assertEquals('michael', $request->getUsername()); $this->assertEquals('123', $request->getPassword()); $this->assertEquals('8080', $request->getPort()); $this->assertEquals(array( 'scheme' => 'http', 'host' => 'www.google.com', 'port' => 8080, 'path' => '/path', 'query' => 'q=1&v=2', ), parse_url($request->getUrl())); } /** * @covers Guzzle\Http\Message\RequestFactory::fromMessage * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesFromMessage() { $auth = base64_encode('michael:123'); $message = "PUT /path?q=1&v=2 HTTP/1.1\r\nHost: www.google.com:8080\r\nContent-Length: 4\r\nAuthorization: Basic {$auth}\r\n\r\nData"; $request = RequestFactory::getInstance()->fromMessage($message); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('http', $request->getScheme()); $this->assertEquals('http://www.google.com:8080/path?q=1&v=2', $request->getUrl()); $this->assertEquals('www.google.com', $request->getHost()); $this->assertEquals('www.google.com:8080', $request->getHeader('Host')); $this->assertEquals('/path', $request->getPath()); $this->assertEquals('/path?q=1&v=2', $request->getResource()); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody()); $this->assertEquals('Data', (string) $request->getBody()); $this->assertEquals('michael', $request->getUsername()); $this->assertEquals('123', $request->getPassword()); $this->assertEquals('8080', $request->getPort()); // Test passing a blank message returns false $this->assertFalse($request = RequestFactory::getInstance()->fromMessage('')); // Test passing a url with no port $message = "PUT /path?q=1&v=2 HTTP/1.1\r\nHost: www.google.com\r\nContent-Length: 4\r\nAuthorization: Basic {$auth}\r\n\r\nData"; $request = RequestFactory::getInstance()->fromMessage($message); $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('http', $request->getScheme()); $this->assertEquals('http://www.google.com/path?q=1&v=2', $request->getUrl()); $this->assertEquals('www.google.com', $request->getHost()); $this->assertEquals('/path', $request->getPath()); $this->assertEquals('/path?q=1&v=2', $request->getResource()); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody()); $this->assertEquals('Data', (string)$request->getBody()); $this->assertEquals('michael', $request->getUsername()); $this->assertEquals('123', $request->getPassword()); $this->assertEquals(80, $request->getPort()); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesNewTraceRequest() { $request = RequestFactory::getInstance()->create('TRACE', 'http://www.google.com/'); $this->assertFalse($request instanceof \Guzzle\Http\Message\EntityEnclosingRequest); $this->assertEquals('TRACE', $request->getMethod()); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesProperTransferEncodingRequests() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/', array( 'Transfer-Encoding' => 'chunked' ), 'hello'); $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding')); $this->assertFalse($request->hasHeader('Content-Length')); } /** * @covers Guzzle\Http\Message\RequestFactory::fromMessage */ public function testProperlyDealsWithDuplicateHeaders() { $parser = new MessageParser(); $message = "POST / http/1.1\r\n" . "DATE:Mon, 09 Sep 2011 23:36:00 GMT\r\n" . "host:host.foo.com\r\n" . "ZOO:abc\r\n" . "ZOO:123\r\n" . "ZOO:HI\r\n" . "zoo:456\r\n\r\n"; $parts = $parser->parseRequest($message); $this->assertEquals(array ( 'DATE' => 'Mon, 09 Sep 2011 23:36:00 GMT', 'host' => 'host.foo.com', 'ZOO' => array('abc', '123', 'HI'), 'zoo' => '456', ), $parts['headers']); $request = RequestFactory::getInstance()->fromMessage($message); $this->assertEquals(array( 'ZOO' => array('abc', '123', 'HI'), 'zoo' => array('456') ), $request->getHeader('zoo')->raw()); } /** * @covers Guzzle\Http\Message\RequestFactory::fromMessage * @covers Guzzle\Http\Message\RequestFactory::create */ public function testCreatesHttpMessagesWithBodiesAndNormalizesLineEndings() { $message = "POST / http/1.1\r\n" . "Content-Type:application/x-www-form-urlencoded; charset=utf8\r\n" . "Date:Mon, 09 Sep 2011 23:36:00 GMT\r\n" . "Host:host.foo.com\r\n\r\n" . "foo=bar"; $request = RequestFactory::getInstance()->fromMessage($message); $this->assertEquals('application/x-www-form-urlencoded; charset=utf8', (string) $request->getHeader('Content-Type')); $this->assertEquals('foo=bar', (string) $request->getBody()); $message = "POST / http/1.1\n" . "Content-Type:application/x-www-form-urlencoded; charset=utf8\n" . "Date:Mon, 09 Sep 2011 23:36:00 GMT\n" . "Host:host.foo.com\n\n" . "foo=bar"; $request = RequestFactory::getInstance()->fromMessage($message); $this->assertEquals('foo=bar', (string) $request->getBody()); $message = "PUT / HTTP/1.1\r\nContent-Length: 0\r\n\r\n"; $request = RequestFactory::getInstance()->fromMessage($message); $this->assertTrue($request->hasHeader('Content-Length')); $this->assertEquals(0, (string) $request->getHeader('Content-Length')); } /** * @covers Guzzle\Http\Message\RequestFactory::create */ public function testHandlesChunkedTransferEncoding() { $request = RequestFactory::getInstance()->create('PUT', 'http://www.foo.com/', array( 'Transfer-Encoding' => 'chunked' ), 'Test'); $this->assertFalse($request->hasHeader('Content-Length')); $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding')); $request = RequestFactory::getInstance()->create('POST', 'http://www.foo.com/', array( 'transfer-encoding' => 'chunked' ), array( 'foo' => 'bar' )); $this->assertFalse($request->hasHeader('Content-Length')); $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding')); } /** * @covers Guzzle\Http\Message\RequestFactory::cloneRequestWithMethod */ public function testClonesRequestsWithMethodWithoutClient() { $f = RequestFactory::getInstance(); $request = $f->create('GET', 'http://www.test.com', array('X-Foo' => 'Bar')); $request->getParams()->replace(array( 'curl_handle' => 'foo', 'queued_response' => 'baz', 'curl_multi' => 'bar', 'test' => '123' )); $request->getCurlOptions()->set('foo', 'bar'); $cloned = $f->cloneRequestWithMethod($request, 'PUT'); $this->assertEquals('PUT', $cloned->getMethod()); $this->assertEquals('Bar', (string) $cloned->getHeader('X-Foo')); $this->assertEquals('http://www.test.com', $cloned->getUrl()); // Ensure params are cloned and cleaned up $this->assertEquals(1, count($cloned->getParams()->getAll())); $this->assertEquals('123', $cloned->getParams()->get('test')); // Ensure curl options are cloned $this->assertEquals('bar', $cloned->getCurlOptions()->get('foo')); // Ensure event dispatcher is cloned $this->assertNotSame($request->getEventDispatcher(), $cloned->getEventDispatcher()); } /** * @covers Guzzle\Http\Message\RequestFactory::cloneRequestWithMethod */ public function testClonesRequestsWithMethodWithClient() { $f = RequestFactory::getInstance(); $client = new Client(); $request = $client->put('http://www.test.com', array('Content-Length' => 4), 'test'); $cloned = $f->cloneRequestWithMethod($request, 'GET'); $this->assertEquals('GET', $cloned->getMethod()); $this->assertNull($cloned->getHeader('Content-Length')); $this->assertEquals('http://www.test.com', $cloned->getUrl()); $this->assertSame($request->getClient(), $cloned->getClient()); } } tests/Guzzle/Tests/Http/Message/RequestTest.php000064400000107155151742734620015620 0ustar00client = new Client($this->getServer()->getUrl()); $this->request = $this->client->get(); } public function tearDown() { unset($this->request); unset($this->client); } /** * @covers Guzzle\Http\Message\Request::__construct */ public function testConstructorBuildsRequestWithArrayHeaders() { // Test passing an array of headers $request = new Request('GET', 'http://www.guzzle-project.com/', array( 'foo' => 'bar' )); $this->assertEquals('GET', $request->getMethod()); $this->assertEquals('http://www.guzzle-project.com/', $request->getUrl()); $this->assertEquals('bar', $request->getHeader('foo')); } /** * @covers Guzzle\Http\Message\Request::getAllEvents */ public function testDescribesEvents() { $this->assertInternalType('array', Request::getAllEvents()); } /** * @covers Guzzle\Http\Message\Request::__construct */ public function testConstructorBuildsRequestWithCollectionHeaders() { $request = new Request('GET', 'http://www.guzzle-project.com/', new Collection(array( 'foo' => 'bar' ))); $this->assertEquals('bar', $request->getHeader('foo')); } /** * @covers Guzzle\Http\Message\Request::__construct */ public function testConstructorBuildsRequestWithNoHeaders() { $request = new Request('GET', 'http://www.guzzle-project.com/', null); $this->assertFalse($request->hasHeader('foo')); } /** * @covers Guzzle\Http\Message\Request::__construct */ public function testConstructorHandlesBasicAuth() { $auth = base64_encode('michael:foo'); $request = new Request('GET', 'http://www.guzzle-project.com/', array( 'Authorization' => 'Basic ' . $auth )); $this->assertEquals('michael', $request->getUserName()); $this->assertEquals('foo', $request->getPassword()); $this->assertEquals('Basic ' . $auth, (string) $request->getHeader('Authorization')); } /** * @covers Guzzle\Http\Message\Request::__construct */ public function testConstructorHandlesNonBasicAuth() { $request = new Request('GET', 'http://www.guzzle-project.com/', array( 'Authorization' => 'Foo bar' )); $this->assertNull($request->getUserName()); $this->assertNull($request->getPassword()); $this->assertEquals('Foo bar', (string) $request->getHeader('Authorization')); } /** * @covers Guzzle\Http\Message\Request::__toString * @covers Guzzle\Http\Message\Request::getRawHeaders * @covers Guzzle\Http\Message\AbstractMessage::getHeaderLines */ public function testRequestsCanBeConvertedToRawMessageStrings() { $auth = base64_encode('michael:123'); $message = "PUT /path?q=1&v=2 HTTP/1.1\r\n" . "Host: www.google.com\r\n" . "Authorization: Basic {$auth}\r\n" . "Content-Length: 4\r\n\r\nData"; $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', array( 'Authorization' => 'Basic ' . $auth ), 'Data'); $this->assertEquals($message, $request->__toString()); } /** * Add authorization after the fact and see that it was put in the message * * @covers Guzzle\Http\Message\Request::__toString * @covers Guzzle\Http\Message\Request::getRawHeaders */ public function testRequestStringsIncludeAuth() { $auth = base64_encode('michael:123'); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl(), null, 'Data') ->setClient($this->client) ->setAuth('michael', '123', CURLAUTH_BASIC); $request->send(); $this->assertContains('Authorization: Basic ' . $auth, (string) $request); } /** * @covers Guzzle\Http\Message\Request::getEventDispatcher */ public function testGetEventDispatcher() { $d = $this->request->getEventDispatcher(); $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', $d); $this->assertEquals($d, $this->request->getEventDispatcher()); } /** * @covers Guzzle\Http\Message\Request::getClient * @covers Guzzle\Http\Message\Request::setClient */ public function testRequestsManageClients() { $request = new Request('GET', 'http://test.com'); $this->assertNull($request->getClient()); $request->setClient($this->client); $this->assertSame($this->client, $request->getClient()); } /** * @covers Guzzle\Http\Message\Request::send * @expectedException \RuntimeException * @expectedExceptionMessage A client must be set on the request */ public function testRequestsRequireClients() { $request = new Request('GET', 'http://test.com'); $request->send(); } /** * @covers Guzzle\Http\Message\Request::send * @covers Guzzle\Http\Message\Request::getResponse * @covers Guzzle\Http\Message\Request::setResponse * @covers Guzzle\Http\Message\Request::processResponse * @covers Guzzle\Http\Message\Request::getResponseBody */ public function testSend() { $response = new Response(200, array( 'Content-Length' => 3 ), 'abc'); $this->request->setResponse($response, true); $r = $this->request->send(); $this->assertSame($response, $r); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $this->request->getResponse()); $this->assertSame($r, $this->request->getResponse()); $this->assertEquals('complete', $this->request->getState()); } /** * @covers Guzzle\Http\Message\Request::getResponse * @covers Guzzle\Http\Message\Request::setResponse * @covers Guzzle\Http\Message\Request::processResponse * @covers Guzzle\Http\Message\Request::getResponseBody */ public function testGetResponse() { $this->assertNull($this->request->getResponse()); $response = new Response(200, array( 'Content-Length' => 3 ), 'abc'); $this->request->setResponse($response); $this->assertEquals($response, $this->request->getResponse()); $request = new Request('GET', 'http://www.google.com/'); $request->setResponse($response, true); $request->setState(RequestInterface::STATE_COMPLETE); $requestResponse = $request->getResponse(); $this->assertSame($response, $requestResponse); // Try again, making sure it's still the same response $this->assertSame($requestResponse, $request->getResponse()); $response = new Response(204); $request = new Request('GET', 'http://www.google.com/'); $request->setResponse($response, true); $request->setState('complete'); $requestResponse = $request->getResponse(); $this->assertSame($response, $requestResponse); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $response->getBody()); } /** * @covers Guzzle\Http\Message\Request::getResponse * @covers Guzzle\Http\Message\Request::processResponse * @covers Guzzle\Http\Message\Request::getResponseBody */ public function testRequestThrowsExceptionOnBadResponse() { $response = new Response(404, array( 'Content-Length' => 3 ), 'abc'); $request = new Request('GET', 'http://www.google.com/'); $request->setClient($this->client); try { $request->setResponse($response, true); $request->send(); $this->fail('Expected exception not thrown'); } catch (BadResponseException $e) { $this->assertInstanceOf('Guzzle\\Http\\Message\\RequestInterface', $e->getRequest()); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $e->getResponse()); $this->assertContains('Client error response', $e->getMessage()); } } /** * @covers Guzzle\Http\Message\Request::getQuery */ public function testManagesQuery() { $this->assertInstanceOf('Guzzle\\Http\\QueryString', $this->request->getQuery()); $this->request->getQuery()->set('test', '123'); $this->assertEquals('test=123', $this->request->getQuery(true)); } /** * @covers Guzzle\Http\Message\Request::getMethod */ public function testRequestHasMethod() { $this->assertEquals('GET', $this->request->getMethod()); } /** * @covers Guzzle\Http\Message\Request::getScheme * @covers Guzzle\Http\Message\Request::setScheme */ public function testRequestHasScheme() { $this->assertEquals('http', $this->request->getScheme()); $this->assertEquals($this->request, $this->request->setScheme('https')); $this->assertEquals('https', $this->request->getScheme()); } /** * @covers Guzzle\Http\Message\Request::getHost * @covers Guzzle\Http\Message\Request::setHost */ public function testRequestHasHost() { $this->assertEquals('127.0.0.1', $this->request->getHost()); $this->assertEquals('127.0.0.1:8124', (string) $this->request->getHeader('Host')); $this->assertSame($this->request, $this->request->setHost('www2.google.com')); $this->assertEquals('www2.google.com', $this->request->getHost()); $this->assertEquals('www2.google.com:8124', (string) $this->request->getHeader('Host')); $this->assertSame($this->request, $this->request->setHost('www.test.com:8081')); $this->assertEquals('www.test.com', $this->request->getHost()); $this->assertEquals(8081, $this->request->getPort()); } /** * @covers Guzzle\Http\Message\Request::getProtocolVersion * @covers Guzzle\Http\Message\Request::setProtocolVersion */ public function testRequestHasProtocol() { $this->assertEquals('1.1', $this->request->getProtocolVersion()); $this->assertEquals($this->request, $this->request->setProtocolVersion('1.1')); $this->assertEquals('1.1', $this->request->getProtocolVersion()); $this->assertEquals($this->request, $this->request->setProtocolVersion('1.0')); $this->assertEquals('1.0', $this->request->getProtocolVersion()); } /** * @covers Guzzle\Http\Message\Request::getPath * @covers Guzzle\Http\Message\Request::setPath */ public function testRequestHasPath() { $this->assertEquals('/', $this->request->getPath()); $this->assertEquals($this->request, $this->request->setPath('/index.html')); $this->assertEquals('/index.html', $this->request->getPath()); $this->assertEquals($this->request, $this->request->setPath('index.html')); $this->assertEquals('/index.html', $this->request->getPath()); } /** * @covers Guzzle\Http\Message\Request::getHost * @covers Guzzle\Http\Message\Request::getPath * @covers Guzzle\Http\Message\Request::getQuery */ public function testPermitsFalsyComponents() { $request = new Request('GET', 'http://0/0?0'); $this->assertSame('0', $request->getHost()); $this->assertSame('/0', $request->getPath()); $this->assertSame('0=', $request->getQuery(true)); $request = new Request('GET', '0'); $this->assertEquals('/0', $request->getPath()); } /** * @covers Guzzle\Http\Message\Request::getPort * @covers Guzzle\Http\Message\Request::setPort */ public function testRequestHasPort() { $this->assertEquals(8124, $this->request->getPort()); $this->assertEquals('127.0.0.1:8124', $this->request->getHeader('Host')); $this->assertEquals($this->request, $this->request->setPort('8080')); $this->assertEquals('8080', $this->request->getPort()); $this->assertEquals('127.0.0.1:8080', $this->request->getHeader('Host')); $this->request->setPort(80); $this->assertEquals('127.0.0.1', $this->request->getHeader('Host')); } /** * @covers Guzzle\Http\Message\Request::getUsername * @covers Guzzle\Http\Message\Request::getPassword * @covers Guzzle\Http\Message\Request::setAuth */ public function testRequestHandlesAuthorization() { // Uninitialized auth $this->assertEquals(null, $this->request->getUsername()); $this->assertEquals(null, $this->request->getPassword()); // Set an auth $this->assertSame($this->request, $this->request->setAuth('michael', '123')); $this->assertEquals('michael', $this->request->getUsername()); $this->assertEquals('123', $this->request->getPassword()); // Set an auth with blank password $this->assertSame($this->request, $this->request->setAuth('michael', '')); $this->assertEquals('michael', $this->request->getUsername()); $this->assertEquals('', $this->request->getPassword()); // Remove the auth $this->request->setAuth(false); $this->assertEquals(null, $this->request->getUsername()); $this->assertEquals(null, $this->request->getPassword()); // Make sure that the cURL based auth works too $request = new Request('GET', $this->getServer()->getUrl()); $request->setAuth('michael', 'password', CURLAUTH_DIGEST); $this->assertEquals('michael:password', $request->getCurlOptions()->get(CURLOPT_USERPWD)); $this->assertEquals(CURLAUTH_DIGEST, $request->getCurlOptions()->get(CURLOPT_HTTPAUTH)); } /** * @covers Guzzle\Http\Message\Request::getResource */ public function testGetResourceUri() { $this->assertEquals('/', $this->request->getResource()); $this->request->setPath('/index.html'); $this->assertEquals('/index.html', $this->request->getResource()); $this->request->getQuery()->add('v', '1'); $this->assertEquals('/index.html?v=1', $this->request->getResource()); } /** * @covers Guzzle\Http\Message\Request::getUrl * @covers Guzzle\Http\Message\Request::setUrl */ public function testRequestHasMutableUrl() { $url = 'http://www.test.com:8081/path?q=123#fragment'; $u = Url::factory($url); $this->assertSame($this->request, $this->request->setUrl($url)); $this->assertEquals($url, $this->request->getUrl()); $this->assertSame($this->request, $this->request->setUrl($u)); $this->assertEquals($url, $this->request->getUrl()); } /** * @covers Guzzle\Http\Message\Request::setState * @covers Guzzle\Http\Message\Request::getState */ public function testRequestHasState() { $this->assertEquals(RequestInterface::STATE_NEW, $this->request->getState()); $this->request->setState(RequestInterface::STATE_TRANSFER); $this->assertEquals(RequestInterface::STATE_TRANSFER, $this->request->getState()); } /** * @covers Guzzle\Http\Message\Request::setResponse * @covers Guzzle\Http\Message\Request::getResponse * @covers Guzzle\Http\Message\Request::getState */ public function testSetManualResponse() { $response = new Response(200, array( 'Date' => 'Sat, 16 Oct 2010 17:27:14 GMT', 'Expires' => '-1', 'Cache-Control' => 'private, max-age=0', 'Content-Type' => 'text/html; charset=ISO-8859-1', ), 'response body'); $this->assertSame($this->request, $this->request->setResponse($response), '-> setResponse() must use a fluent interface'); $this->assertEquals('complete', $this->request->getState(), '-> setResponse() must change the state of the request to complete'); $this->assertSame($response, $this->request->getResponse(), '-> setResponse() must set the exact same response that was passed in to it'); } /** * @covers Guzzle\Http\Message\Request::setResponseBody */ public function testRequestCanHaveManuallySetResponseBody() { $file = __DIR__ . '/../../TestData/temp.out'; if (file_exists($file)) { unlink($file); } $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"); $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl()); $request->setClient($this->client); $entityBody = EntityBody::factory(fopen($file, 'w+')); $request->setResponseBody($entityBody); $response = $request->send(); $this->assertSame($entityBody, $response->getBody()); $this->assertTrue(file_exists($file)); $this->assertEquals('data', file_get_contents($file)); unlink($file); $this->assertEquals('data', $response->getBody(true)); } /** * @covers Guzzle\Http\Message\Request::isResponseBodyRepeatable */ public function testDeterminesIfResponseBodyRepeatable() { // The default stream created for responses is seekable $request = RequestFactory::getInstance()->create('GET', 'http://localhost:' . $this->getServer()->getPort()); $this->assertTrue($request->isResponseBodyRepeatable()); // This should return false because an HTTP stream is not seekable $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"); $request->setResponseBody(EntityBody::factory(fopen($this->getServer()->getUrl(), true))); $this->assertFalse($request->isResponseBodyRepeatable()); } /** * @covers Guzzle\Http\Message\Request::canCache */ public function testDeterminesIfCanCacheRequest() { $this->assertTrue(RequestFactory::getInstance()->fromMessage( "GET / HTTP/1.1\r\nHost: www.test.com\r\nCache-Control: no-cache, max-age=120\r\n\r\n" )->canCache()); $this->assertTrue(RequestFactory::getInstance()->fromMessage( "HEAD / HTTP/1.1\r\nHost: www.test.com\r\nCache-Control: no-cache, max-age=120\r\n\r\n" )->canCache()); $this->assertFalse(RequestFactory::getInstance()->fromMessage( "HEAD / HTTP/1.1\r\nHost: www.test.com\r\nCache-Control: no-cache, max-age=120, no-store\r\n\r\n" )->canCache()); $this->assertFalse(RequestFactory::getInstance()->fromMessage( "POST / HTTP/1.1\r\nHost: www.test.com\r\n\r\n" )->canCache()); $this->assertFalse(RequestFactory::getInstance()->fromMessage( "PUT / HTTP/1.1\r\nHost: www.test.com\r\nCache-Control: no-cache, max-age=120\r\n\r\n" )->canCache()); } /** * @covers Guzzle\Http\Message\Request */ public function testHoldsCookies() { $this->assertNull($this->request->getCookie('test')); // Set a cookie $this->assertSame($this->request, $this->request->addCookie('test', 'abc')); $this->assertEquals('abc', $this->request->getCookie('test')); // Multiple cookies by setting the Cookie header $this->request->setHeader('Cookie', '__utma=1.638370270.1344367610.1374365610.1944450276.2; __utmz=1.1346368610.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); hl=de; PHPSESSID=ak93pqashi5uubuoq8fjv60897'); $this->assertEquals('1.638370270.1344367610.1374365610.1944450276.2', $this->request->getCookie('__utma')); $this->assertEquals('1.1346368610.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)', $this->request->getCookie('__utmz')); $this->assertEquals('de', $this->request->getCookie('hl')); $this->assertEquals('ak93pqashi5uubuoq8fjv60897', $this->request->getCookie('PHPSESSID')); // Unset the cookies by setting the Cookie header to null $this->request->setHeader('Cookie', null); $this->assertNull($this->request->getCookie('test')); $this->request->removeHeader('Cookie'); // Set and remove a cookie $this->assertSame($this->request, $this->request->addCookie('test', 'abc')); $this->assertEquals('abc', $this->request->getCookie('test')); $this->assertSame($this->request, $this->request->removeCookie('test')); $this->assertNull($this->request->getCookie('test')); // Remove the cookie header $this->assertSame($this->request, $this->request->addCookie('test', 'abc')); $this->request->removeHeader('Cookie'); $this->assertEquals('', (string) $this->request->getHeader('Cookie')); // Remove a cookie value $this->request->addCookie('foo', 'bar')->addCookie('baz', 'boo'); $this->request->removeCookie('foo'); $this->assertEquals(array( 'baz' => 'boo' ), $this->request->getCookies()); $this->request->addCookie('foo', 'bar'); $this->assertEquals('baz=boo; foo=bar', (string) $this->request->getHeader('Cookie')); } /** * @covers Guzzle\Http\Message\Request::processResponse * @expectedException Guzzle\Http\Exception\RequestException * @expectedExceptionMessage Error completing request */ public function testRequestThrowsExceptionWhenSetToCompleteWithNoResponse() { $this->request->setState(RequestInterface::STATE_COMPLETE); } /** * @covers Guzzle\Http\Message\Request::__clone */ public function testClonedRequestsUseNewInternalState() { $p = new AsyncPlugin(); $this->request->getEventDispatcher()->addSubscriber($p); $h = $this->request->getHeader('Host'); $r = clone $this->request; $this->assertEquals(RequestInterface::STATE_NEW, $r->getState()); $this->assertNotSame($r->getQuery(), $this->request->getQuery()); $this->assertNotSame($r->getCurlOptions(), $this->request->getCurlOptions()); $this->assertNotSame($r->getEventDispatcher(), $this->request->getEventDispatcher()); $this->assertEquals($r->getHeaders(), $this->request->getHeaders()); $this->assertNotSame($h, $r->getHeader('Host')); $this->assertNotSame($r->getParams(), $this->request->getParams()); $this->assertNull($r->getParams()->get('queued_response')); $this->assertTrue($this->request->getEventDispatcher()->hasListeners('request.sent')); } /** * @covers Guzzle\Http\Message\Request::changedHeader * @covers Guzzle\Http\Message\Request::setHeader */ public function testCatchesAllHostHeaderChanges() { // Tests setting using headers $this->request->setHeader('Host', 'www.abc.com'); $this->assertEquals('www.abc.com', $this->request->getHost()); $this->assertEquals('www.abc.com:8124', $this->request->getHeader('Host')); $this->assertEquals(8124, $this->request->getPort()); // Tests setting using setHost() $this->request->setHost('abc.com'); $this->assertEquals('abc.com', $this->request->getHost()); $this->assertEquals('abc.com:8124', $this->request->getHeader('Host')); $this->assertEquals(8124, $this->request->getPort()); // Tests setting with a port $this->request->setHost('abc.com:8081'); $this->assertEquals('abc.com', $this->request->getHost()); $this->assertEquals('abc.com:8081', $this->request->getHeader('Host')); $this->assertEquals(8081, $this->request->getPort()); // Tests setting with a port using the Host header $this->request->setHeader('Host', 'solr.com:8983'); $this->assertEquals('solr.com', $this->request->getHost()); $this->assertEquals('solr.com:8983', (string) $this->request->getHeader('Host')); $this->assertEquals(8983, $this->request->getPort()); // Tests setting with an inferred 443 port using the Host header $this->request->setScheme('https'); $this->request->setHeader('Host', 'solr.com'); $this->assertEquals('solr.com', $this->request->getHost()); $this->assertEquals('solr.com:8983', (string) $this->request->getHeader('Host')); $this->assertEquals(8983, $this->request->getPort()); } /** * @covers Guzzle\Http\Message\Request::setUrl */ public function testRecognizesBasicAuthCredentialsInUrls() { $this->request->setUrl('http://michael:test@test.com/'); $this->assertEquals('michael', $this->request->getUsername()); $this->assertEquals('test', $this->request->getPassword()); } /** * This test launches a dummy Guzzle\Http\Server\Server object that listens * for incoming requests. The server allows us to test how cURL sends * requests and receives responses. We can validate the request structure * and whether or not the response was interpreted correctly. * * @covers Guzzle\Http\Message\Request */ public function testRequestCanBeSentUsingCurl() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 4\r\nExpires: Thu, 01 Dec 1994 16:00:00 GMT\r\nConnection: close\r\n\r\ndata", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\nExpires: Thu, 01 Dec 1994 16:00:00 GMT\r\nConnection: close\r\n\r\ndata", "HTTP/1.1 404 Not Found\r\nContent-Encoding: application/xml\r\nContent-Length: 48\r\n\r\nFile not found" )); $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl()); $request->setClient($this->client); $response = $request->send(); $this->assertEquals('data', $response->getBody(true)); $this->assertEquals(200, (int) $response->getStatusCode()); $this->assertEquals('OK', $response->getReasonPhrase()); $this->assertEquals(4, $response->getContentLength()); $this->assertEquals('Thu, 01 Dec 1994 16:00:00 GMT', $response->getExpires()); // Test that the same handle can be sent twice without setting state to new $response2 = $request->send(); $this->assertNotSame($response, $response2); try { $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl() . 'index.html'); $request->setClient($this->client); $response = $request->send(); $this->fail('Request did not receive a 404 response'); } catch (BadResponseException $e) { } $requests = $this->getServer()->getReceivedRequests(true); $messages = $this->getServer()->getReceivedRequests(false); $port = $this->getServer()->getPort(); $userAgent = $this->client->getDefaultUserAgent(); $this->assertEquals('127.0.0.1:' . $port, $requests[0]->getHeader('Host')); $this->assertEquals('127.0.0.1:' . $port, $requests[1]->getHeader('Host')); $this->assertEquals('127.0.0.1:' . $port, $requests[2]->getHeader('Host')); $this->assertEquals('/', $requests[0]->getPath()); $this->assertEquals('/', $requests[1]->getPath()); $this->assertEquals('/index.html', $requests[2]->getPath()); $parts = explode("\r\n", $messages[0]); $this->assertEquals('GET / HTTP/1.1', $parts[0]); $parts = explode("\r\n", $messages[1]); $this->assertEquals('GET / HTTP/1.1', $parts[0]); $parts = explode("\r\n", $messages[2]); $this->assertEquals('GET /index.html HTTP/1.1', $parts[0]); } /** * @covers Guzzle\Http\Message\Request::onRequestError */ public function testThrowsExceptionsWhenUnsuccessfulResponseIsReceivedByDefault() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 404 Not found\r\nContent-Length: 0\r\n\r\n"); try { $request = $this->client->get('/index.html'); $response = $request->send(); $this->fail('Request did not receive a 404 response'); } catch (BadResponseException $e) { $this->assertContains('Client error response', $e->getMessage()); $this->assertContains('[status code] 404', $e->getMessage()); $this->assertContains('[reason phrase] Not found', $e->getMessage()); } } /** * @covers Guzzle\Http\Message\Request::onRequestError */ public function testCanShortCircuitErrorHandling() { $request = $this->request; $response = new Response(404); $request->setResponse($response, true); $out = ''; $that = $this; $request->getEventDispatcher()->addListener('request.error', function($event) use (&$out, $that) { $out .= $event['request'] . "\n" . $event['response'] . "\n"; $event->stopPropagation(); }); $request->send(); $this->assertContains((string) $request, $out); $this->assertContains((string) $request->getResponse(), $out); $this->assertSame($response, $request->getResponse()); } /** * @covers Guzzle\Http\Message\Request::processResponse * @covers Guzzle\Http\Message\Request::onRequestError */ public function testCanOverrideUnsuccessfulResponses() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 404 NOT FOUND\r\n" . "Content-Length: 0\r\n" . "\r\n", "HTTP/1.1 200 OK\r\n" . "Content-Length: 0\r\n" . "\r\n" )); $newResponse = null; $request = $this->request; $request->getEventDispatcher()->addListener('request.error', function($event) use (&$newResponse) { if ($event['response']->getStatusCode() == 404) { $newRequest = clone $event['request']; $newResponse = $newRequest->send(); // Override the original response and bypass additional response processing $event['response'] = $newResponse; // Call $event['request']->setResponse($newResponse); to re-apply events $event->stopPropagation(); } }); $request->send(); $this->assertEquals(200, $request->getResponse()->getStatusCode()); $this->assertSame($newResponse, $request->getResponse()); $this->assertEquals(2, count($this->getServer()->getReceivedRequests())); } /** * @covers Guzzle\Http\Message\Request */ public function testCanRetrieveUrlObject() { $request = new Request('GET', 'http://www.example.com/foo?abc=d'); $this->assertInstanceOf('Guzzle\Http\Url', $request->getUrl(true)); $this->assertEquals('http://www.example.com/foo?abc=d', $request->getUrl()); $this->assertEquals('http://www.example.com/foo?abc=d', (string) $request->getUrl(true)); } /** * Users sometimes want to use a custom stream when receiving a response body. * Because of the various potential for retrying failed requests, the stream * specified by the user should only be written to in the event that a * successful response was received. Otherwise, a new temp stream is created * to store the body of the failed request. * * @covers Guzzle\Http\Message\Request::receiveResponseHeader */ public function testReceivingUnsuccessfulResponseUsesOtherResponseBody() { $request = new Request('GET', $this->getServer()->getUrl()); $body = EntityBody::factory(); $request->setResponseBody($body); $request->receiveResponseHeader('HTTP/1.1 503 Service Unavailable'); $this->assertNotSame($body, $request->getResponse()->getBody()); } /** * Many RESTful frameworks omit the text status from the header. That * provides a response like "HTTP/1.1 200". Prevent an Undefined offset * by checking to see how many parts of the status line are provided * before trying to assign them. * * @covers Guzzle\Http\Message\Request::receiveResponseHeader */ public function testReceivingShortStatusLineResponse() { $request = new Request('GET', $this->getServer()->getUrl()); $request->receiveResponseHeader('HTTP/1.1 200'); $this->assertSame(200, $request->getResponse()->getStatusCode()); $this->assertSame('OK', $request->getResponse()->getReasonPhrase()); } /** * @covers Guzzle\Http\Message\Request::receiveResponseHeader */ public function testAddsPreviousResponseToResponseWhenRedirecting() { $url = $this->getServer()->getUrl(); $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 303 SEE OTHER\r\n" . "Content-Length: 0\r\n" . "Location: {$url}/foo\r\n\r\n", "HTTP/1.1 200 OK\r\n" . "Content-Length: 0\r\n\r\n" )); $request = $this->request; $request->send(); $this->assertEquals(2, count($this->getServer()->getReceivedRequests())); $this->assertEquals(200, $request->getResponse()->getStatusCode()); $this->assertEquals(303, $request->getResponse()->getPreviousResponse()->getStatusCode()); } public function testUnresolvedRedirectsReturnResponse() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 303 SEE OTHER\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Foo\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n" )); $request = $this->request; $this->assertEquals(303, $request->send()->getStatusCode()); $request->getParams()->set(RedirectPlugin::DISABLE, true); $this->assertEquals(301, $request->send()->getStatusCode()); } public function testCanSendCustomRequests() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $request = $this->client->createRequest('PROPFIND', $this->getServer()->getUrl(), array( 'Content-Type' => 'text/plain' ), 'foo'); $response = $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals('PROPFIND', $requests[0]->getMethod()); $this->assertEquals(3, (string) $requests[0]->getHeader('Content-Length')); $this->assertEquals('foo', (string) $requests[0]->getBody()); } /** * @expectedException PHPUnit_Framework_Error_Warning */ public function testEnsuresFileCanBeCreated() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"); $this->client->get('/')->setResponseBody('/wefwefefefefwewefwe/wefwefwefefwe/wefwefewfw.txt')->send(); } public function testAllowsFilenameForDownloadingContent() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"); $name = sys_get_temp_dir() . '/foo.txt'; $this->client->get('/')->setResponseBody($name)->send(); $this->assertEquals('test', file_get_contents($name)); unlink($name); } public function testHasRedirectFlag() { $request = new Request('GET', $this->getServer()->getUrl()); $this->assertFalse($request->isRedirect()); $this->assertSame($request, $request->setIsRedirect(true)); $this->assertTrue($request->isRedirect()); } } tests/Guzzle/Tests/Http/Message/ResponseTest.php000064400000071276151742734620015772 0ustar00response = new Response(200, new Collection(array( 'Accept-Ranges' => 'bytes', 'Age' => '12', 'Allow' => 'GET, HEAD', 'Cache-Control' => 'no-cache', 'Content-Encoding' => 'gzip', 'Content-Language' => 'da', 'Content-Length' => '348', 'Content-Location' => '/index.htm', 'Content-Disposition' => 'attachment; filename=fname.ext', 'Content-MD5' => 'Q2hlY2sgSW50ZWdyaXR5IQ==', 'Content-Range' => 'bytes 21010-47021/47022', 'Content-Type' => 'text/html; charset=utf-8', 'Date' => 'Tue, 15 Nov 1994 08:12:31 GMT', 'ETag' => '737060cd8c284d8af7ad3082f209582d', 'Expires' => 'Thu, 01 Dec 1994 16:00:00 GMT', 'Last-Modified' => 'Tue, 15 Nov 1994 12:45:26 GMT', 'Location' => 'http://www.w3.org/pub/WWW/People.html', 'Pragma' => 'no-cache', 'Proxy-Authenticate' => 'Basic', 'Retry-After' => '120', 'Server' => 'Apache/1.3.27 (Unix) (Red-Hat/Linux)', 'Set-Cookie' => 'UserID=JohnDoe; Max-Age=3600; Version=1', 'Trailer' => 'Max-Forwards', 'Transfer-Encoding' => 'chunked', 'Vary' => '*', 'Via' => '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'Warning' => '199 Miscellaneous warning', 'WWW-Authenticate' => 'Basic' )), 'body'); } /** * @covers Guzzle\Http\Message\Response::__construct */ public function testConstructor() { $params = new Collection(); $body = EntityBody::factory(''); $response = new Response(200, $params, $body); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals($body, $response->getBody()); $this->assertEquals('OK', $response->getReasonPhrase()); $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", $response->getRawHeaders()); // Make sure Content-Length is set automatically $response = new Response(200, $params); $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", $response->getRawHeaders()); // Pass bodies to the response $response = new Response(200, null, 'data'); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $response->getBody()); $response = new Response(200, null, EntityBody::factory('data')); $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $response->getBody()); $this->assertEquals('data', $response->getBody(true)); $response = new Response(200, null, '0'); $this->assertSame('0', $response->getBody(true), 'getBody(true) should return "0" if response body is "0".'); // Make sure the proper exception is thrown try { //$response = new Response(200, null, array('foo' => 'bar')); //$this->fail('Response did not throw exception when passing invalid body'); } catch (HttpException $e) { } // Ensure custom codes can be set $response = new Response(2); $this->assertEquals(2, $response->getStatusCode()); $this->assertEquals('', $response->getReasonPhrase()); // Make sure the proper exception is thrown when sending invalid headers try { $response = new Response(200, 'adidas'); $this->fail('Response did not throw exception when passing invalid $headers'); } catch (BadResponseException $e) { } } /** * @covers Guzzle\Http\Message\Response::__toString */ public function test__toString() { $response = new Response(200); $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", (string) $response); // Add another header $response = new Response(200, array( 'X-Test' => 'Guzzle' )); $this->assertEquals("HTTP/1.1 200 OK\r\nX-Test: Guzzle\r\n\r\n", (string) $response); $response = new Response(200, array( 'Content-Length' => 4 ), 'test'); $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest", (string) $response); } /** * @covers Guzzle\Http\Message\Response::fromMessage */ public function testFactory() { $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('OK', $response->getReasonPhrase()); $this->assertEquals(4, $response->getContentLength()); $this->assertEquals('test', $response->getBody(true)); // Make sure that automatic Content-Length works $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"); $this->assertEquals(4, $response->getContentLength()); $this->assertEquals('test', $response->getBody(true)); } /** * @covers Guzzle\Http\Message\Response::fromMessage */ public function testFactoryCanCreateHeadResponses() { $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\n"); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('OK', $response->getReasonPhrase()); $this->assertEquals(4, $response->getContentLength()); $this->assertEquals('', $response->getBody(true)); } /** * @covers Guzzle\Http\Message\Response::fromMessage */ public function testFactoryRequiresMessage() { $this->assertFalse(Response::fromMessage('')); } /** * @covers Guzzle\Http\Message\Response::getBody * @covers Guzzle\Http\Message\Response::setBody */ public function testGetBody() { $body = EntityBody::factory(''); $response = new Response(403, new Collection(), $body); $this->assertEquals($body, $response->getBody()); $response->setBody('foo'); $this->assertEquals('foo', $response->getBody(true)); } /** * @covers Guzzle\Http\Message\Response::getStatusCode */ public function testManagesStatusCode() { $response = new Response(403); $this->assertEquals(403, $response->getStatusCode()); } /** * @covers Guzzle\Http\Message\Response::getMessage */ public function testGetMessage() { $response = new Response(200, new Collection(array( 'Content-Length' => 4 )), 'body'); $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nbody", $response->getMessage()); } /** * @covers Guzzle\Http\Message\Response::getRawHeaders */ public function testGetRawHeaders() { $response = new Response(200, new Collection(array( 'Keep-Alive' => 155, 'User-Agent' => 'Guzzle', 'Content-Length' => 4 )), 'body'); $this->assertEquals("HTTP/1.1 200 OK\r\nKeep-Alive: 155\r\nUser-Agent: Guzzle\r\nContent-Length: 4\r\n\r\n", $response->getRawHeaders()); } /** * @covers Guzzle\Http\Message\Response::getRequest */ public function testGetRequest() { $response = new Response(200, new Collection(), 'body'); $this->assertNull($response->getRequest()); $request = new \Guzzle\Http\Message\Request('GET', 'http://www.guzzle-project.com/'); $response->setRequest($request); $this->assertEquals($request, $response->getRequest()); } /** * @covers Guzzle\Http\Message\Response::getReasonPhrase * @covers Guzzle\Http\Message\Response::setStatus */ public function testHandlesStatusAndStatusCodes() { $response = new Response(200, new Collection(), 'body'); $this->assertEquals('OK', $response->getReasonPhrase()); $this->assertSame($response, $response->setStatus(204)); $this->assertEquals('No Content', $response->getReasonPhrase()); $this->assertEquals(204, $response->getStatusCode()); $this->assertSame($response, $response->setStatus(204, 'Testing!')); $this->assertEquals('Testing!', $response->getReasonPhrase()); $this->assertEquals(204, $response->getStatusCode()); $response->setStatus(2000); $this->assertEquals(2000, $response->getStatusCode()); $this->assertEquals('', $response->getReasonPhrase()); $response->setStatus(200, 'Foo'); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('Foo', $response->getReasonPhrase()); } /** * @covers Guzzle\Http\Message\Response::isClientError */ public function testIsClientError() { $response = new Response(403); $this->assertTrue($response->isClientError()); $response = new Response(200); $this->assertFalse($response->isClientError()); } /** * @covers Guzzle\Http\Message\Response::isError */ public function testIsError() { $response = new Response(403); $this->assertTrue($response->isError()); $response = new Response(200); $this->assertFalse($response->isError()); $response = new Response(500); $this->assertTrue($response->isError()); } /** * @covers Guzzle\Http\Message\Response::isInformational */ public function testIsInformational() { $response = new Response(100); $this->assertTrue($response->isInformational()); $response = new Response(200); $this->assertFalse($response->isInformational()); } /** * @covers Guzzle\Http\Message\Response::isRedirect */ public function testIsRedirect() { $response = new Response(301); $this->assertTrue($response->isRedirect()); $response = new Response(200); $this->assertFalse($response->isRedirect()); } /** * @covers Guzzle\Http\Message\Response::isServerError */ public function testIsServerError() { $response = new Response(500); $this->assertTrue($response->isServerError()); $response = new Response(400); $this->assertFalse($response->isServerError()); } /** * @covers Guzzle\Http\Message\Response::isSuccessful */ public function testIsSuccessful() { $response = new Response(200); $this->assertTrue($response->isSuccessful()); $response = new Response(403); $this->assertFalse($response->isSuccessful()); } /** * @covers Guzzle\Http\Message\Response::setRequest */ public function testSetRequest() { $response = new Response(200); $this->assertNull($response->getRequest()); $r = new \Guzzle\Http\Message\Request('GET', 'http://www.guzzle-project.com/'); $response->setRequest($r); $this->assertEquals($r, $response->getRequest()); } /** * @covers Guzzle\Http\Message\Response::getAcceptRanges */ public function testGetAcceptRanges() { $this->assertEquals('bytes', $this->response->getAcceptRanges()); } /** * @covers Guzzle\Http\Message\Response::getAge */ public function testGetAge() { $this->assertEquals(12, $this->response->getAge(false)); $this->assertEquals(12, $this->response->getAge(true)); $this->response->removeHeader('Age'); $this->response->removeHeader('Date'); $this->assertNull($this->response->getAge()); $this->response->setHeader('Date', gmdate(ClientInterface::HTTP_DATE, strtotime('-1 minute'))); // If the test runs slowly, still pass with a +5 second allowance $this->assertTrue($this->response->getAge() - 60 <= 5); $this->assertNull($this->response->getAge(true)); } /** * @covers Guzzle\Http\Message\Response::getAllow */ public function testGetAllow() { $this->assertEquals('GET, HEAD', $this->response->getAllow()); } /** * @covers Guzzle\Http\Message\Response::getCacheControl */ public function testGetCacheControl() { $this->assertEquals('no-cache', $this->response->getCacheControl()); } /** * @covers Guzzle\Http\Message\Response::getContentEncoding */ public function testGetContentEncoding() { $this->assertEquals('gzip', $this->response->getContentEncoding()); } /** * @covers Guzzle\Http\Message\Response::getContentLanguage */ public function testGetContentLanguage() { $this->assertEquals('da', $this->response->getContentLanguage()); } /** * @covers Guzzle\Http\Message\Response::getContentLength */ public function testGetContentLength() { $this->assertEquals('348', $this->response->getContentLength()); } /** * @covers Guzzle\Http\Message\Response::getContentLocation */ public function testGetContentLocation() { $this->assertEquals('/index.htm', $this->response->getContentLocation()); } /** * @covers Guzzle\Http\Message\Response::getContentDisposition */ public function testGetContentDisposition() { $this->assertEquals('attachment; filename=fname.ext', $this->response->getContentDisposition()); } /** * @covers Guzzle\Http\Message\Response::getContentMd5 */ public function testGetContentMd5() { $this->assertEquals('Q2hlY2sgSW50ZWdyaXR5IQ==', $this->response->getContentMd5()); } /** * @covers Guzzle\Http\Message\Response::getContentRange */ public function testGetContentRange() { $this->assertEquals('bytes 21010-47021/47022', $this->response->getContentRange()); } /** * @covers Guzzle\Http\Message\Response::getContentType */ public function testGetContentType() { $this->assertEquals('text/html; charset=utf-8', $this->response->getContentType()); } /** * @covers Guzzle\Http\Message\Response::getDate */ public function testGetDate() { $this->assertEquals('Tue, 15 Nov 1994 08:12:31 GMT', $this->response->getDate()); } /** * @covers Guzzle\Http\Message\Response::getEtag */ public function testGetEtag() { $this->assertEquals('737060cd8c284d8af7ad3082f209582d', $this->response->getEtag()); } /** * @covers Guzzle\Http\Message\Response::getExpires */ public function testGetExpires() { $this->assertEquals('Thu, 01 Dec 1994 16:00:00 GMT', $this->response->getExpires()); } /** * @covers Guzzle\Http\Message\Response::getLastModified */ public function testGetLastModified() { $this->assertEquals('Tue, 15 Nov 1994 12:45:26 GMT', $this->response->getLastModified()); } /** * @covers Guzzle\Http\Message\Response::getLocation */ public function testGetLocation() { $this->assertEquals('http://www.w3.org/pub/WWW/People.html', $this->response->getLocation()); } /** * @covers Guzzle\Http\Message\Response::getPragma */ public function testGetPragma() { $this->assertEquals('no-cache', $this->response->getPragma()); } /** * @covers Guzzle\Http\Message\Response::getProxyAuthenticate */ public function testGetProxyAuthenticate() { $this->assertEquals('Basic', $this->response->getProxyAuthenticate()); } /** * @covers Guzzle\Http\Message\Response::getRetryAfter */ public function testGetRetryAfter() { $this->assertEquals('120', $this->response->getRetryAfter()); $t = time() + 1000; $d = $t - time(); $this->response->setHeader('Retry-After', date('r', $t)); $this->assertEquals($d, $this->response->getRetryAfter()); $this->response->removeHeader('Retry-After'); $this->assertNull($this->response->getRetryAfter()); } /** * @covers Guzzle\Http\Message\Response::getServer */ public function testGetServer() { $this->assertEquals('Apache/1.3.27 (Unix) (Red-Hat/Linux)', $this->response->getServer()); } /** * @covers Guzzle\Http\Message\Response::getSetCookie */ public function testGetSetCookie() { $this->assertEquals('UserID=JohnDoe; Max-Age=3600; Version=1', $this->response->getSetCookie()); } /** * @covers Guzzle\Http\Message\Response::getSetCookie */ public function testGetMultipleSetCookie() { $this->response->addHeader('Set-Cookie', 'UserID=Mike; Max-Age=200'); $this->assertEquals(array( 'UserID=JohnDoe; Max-Age=3600; Version=1', 'UserID=Mike; Max-Age=200', ), $this->response->getSetCookie()->toArray()); } /** * @covers Guzzle\Http\Message\Response::getSetCookie */ public function testGetSetCookieNormalizesHeaders() { $this->response->addHeaders(array( 'Set-Cooke' => 'boo', 'set-cookie' => 'foo' )); $this->assertEquals(array( 'UserID=JohnDoe; Max-Age=3600; Version=1', 'foo' ), $this->response->getSetCookie()->toArray()); $this->response->addHeaders(array( 'set-cookie' => 'fubu' )); $this->assertEquals(array('UserID=JohnDoe; Max-Age=3600; Version=1', 'foo', 'fubu'), $this->response->getSetCookie()->toArray()); } /** * @covers Guzzle\Http\Message\Response::getTrailer */ public function testGetTrailer() { $this->assertEquals('Max-Forwards', $this->response->getTrailer()); } /** * @covers Guzzle\Http\Message\Response::getTransferEncoding */ public function testGetTransferEncoding() { $this->assertEquals('chunked', $this->response->getTransferEncoding()); } /** * @covers Guzzle\Http\Message\Response::getVary */ public function testGetVary() { $this->assertEquals('*', $this->response->getVary()); } /** * @covers Guzzle\Http\Message\Response::getVia */ public function testReturnsViaHeader() { $this->assertEquals('1.0 fred, 1.1 nowhere.com (Apache/1.1)', $this->response->getVia()); } /** * @covers Guzzle\Http\Message\Response::getWarning */ public function testGetWarning() { $this->assertEquals('199 Miscellaneous warning', $this->response->getWarning()); } /** * @covers Guzzle\Http\Message\Response::getWwwAuthenticate */ public function testReturnsWwwAuthenticateHeader() { $this->assertEquals('Basic', $this->response->getWwwAuthenticate()); } /** * @covers Guzzle\Http\Message\Response::getConnection */ public function testReturnsConnectionHeader() { $this->assertEquals(null, $this->response->getConnection()); $this->response->setHeader('Connection', 'close'); $this->assertEquals('close', $this->response->getConnection()); } /** * @covers Guzzle\Http\Message\Response::getHeader */ public function testReturnsHeaders() { $this->assertEquals('Basic', $this->response->getHeader('WWW-Authenticate', null, true)); $this->assertEquals('chunked', $this->response->getHeader('Transfer-Encoding', null, false)); } /** * @covers Guzzle\Http\Message\Response::setInfo * @covers Guzzle\Http\Message\Response::getInfo */ public function testHasTransferInfo() { $stats = array ( 'url' => 'http://www.google.com/', 'content_type' => 'text/html; charset=ISO-8859-1', 'http_code' => 200, 'header_size' => 606, 'request_size' => 53, 'filetime' => -1, 'ssl_verify_result' => 0, 'redirect_count' => 0, 'total_time' => 0.093284, 'namelookup_time' => 0.001349, 'connect_time' => 0.01635, 'pretransfer_time' => 0.016358, 'size_upload' => 0, 'size_download' => 10330, 'speed_download' => 110737, 'speed_upload' => 0, 'download_content_length' => -1, 'upload_content_length' => 0, 'starttransfer_time' => 0.07066, 'redirect_time' => 0, ); // Uninitialized state $this->assertNull($this->response->getInfo('url')); $this->assertEquals(array(), $this->response->getInfo()); // Set the stats $this->response->setInfo($stats); $this->assertEquals($stats, $this->response->getInfo()); $this->assertEquals(606, $this->response->getInfo('header_size')); $this->assertNull($this->response->getInfo('does_not_exist')); } /** * @return Response */ private function getResponse($code, array $headers = null, EntityBody $body = null) { return new Response($code, $headers, $body); } /** * @covers Guzzle\Http\Message\Response::canCache */ public function testDeterminesIfItCanBeCached() { $this->assertTrue($this->getResponse(200)->canCache()); $this->assertTrue($this->getResponse(410)->canCache()); $this->assertFalse($this->getResponse(404)->canCache()); $this->assertTrue($this->getResponse(200, array( 'Cache-Control' => 'public' ))->canCache()); // This has the no-store directive $this->assertFalse($this->getResponse(200, array( 'Cache-Control' => 'private, no-store' ))->canCache()); // The body cannot be read, so it cannot be cached $tmp = tempnam('/tmp', 'not-readable'); $resource = fopen($tmp, 'w'); $this->assertFalse($this->getResponse(200, array( 'Transfer-Encoding' => 'chunked' ), EntityBody::factory($resource, 10))->canCache()); unlink($tmp); // The body is 0 length, cannot be read, so it can be cached $tmp = tempnam('/tmp', 'not-readable'); $resource = fopen($tmp, 'w'); $this->assertTrue($this->getResponse(200, array(array( 'Content-Length' => 0 )), EntityBody::factory($resource, 0))->canCache()); unlink($tmp); } /** * @covers Guzzle\Http\Message\Response::getMaxAge */ public function testDeterminesResponseMaxAge() { $this->assertEquals(null, $this->getResponse(200)->getMaxAge()); // Uses the response's s-maxage $this->assertEquals(140, $this->getResponse(200, array( 'Cache-Control' => 's-maxage=140' ))->getMaxAge()); // Uses the response's max-age $this->assertEquals(120, $this->getResponse(200, array( 'Cache-Control' => 'max-age=120' ))->getMaxAge()); // Uses the response's max-age $this->assertEquals(120, $this->getResponse(200, array( 'Cache-Control' => 'max-age=120', 'Expires' => gmdate(ClientInterface::HTTP_DATE, strtotime('+1 day')) ))->getMaxAge()); // Uses the Expires date $this->assertGreaterThanOrEqual(82400, $this->getResponse(200, array( 'Expires' => gmdate(ClientInterface::HTTP_DATE, strtotime('+1 day')) ))->getMaxAge()); // Uses the Expires date $this->assertGreaterThanOrEqual(82400, $this->getResponse(200, array( 'Expires' => gmdate(ClientInterface::HTTP_DATE, strtotime('+1 day')) ))->getMaxAge()); } /** * @covers Guzzle\Http\Message\Response::canValidate */ public function testDeterminesIfItCanValidate() { $response = new Response(200); $this->assertFalse($response->canValidate()); $response->setHeader('ETag', '123'); $this->assertTrue($response->canValidate()); $response->removeHeader('ETag'); $this->assertFalse($response->canValidate()); $response->setHeader('Last-Modified', '123'); $this->assertTrue($response->canValidate()); } /** * @covers Guzzle\Http\Message\Response::getFreshness * @covers Guzzle\Http\Message\Response::isFresh */ public function testCalculatesFreshness() { $response = new Response(200); $this->assertNull($response->isFresh()); $this->assertNull($response->getFreshness()); $response->addCacheControlDirective('max-age', 120); $response->setHeader('Age', 100); $this->assertEquals(20, $response->getFreshness()); $this->assertTrue($response->isFresh()); $response->setHeader('Age', 120); $this->assertEquals(0, $response->getFreshness()); $this->assertTrue($response->isFresh()); $response->setHeader('Age', 150); $this->assertEquals(-30, $response->getFreshness()); $this->assertFalse($response->isFresh()); } /** * @covers Guzzle\Http\Message\Response::setProtocol * @covers Guzzle\Http\Message\Response::getProtocol * @covers Guzzle\Http\Message\Response::getProtocolVersion */ public function testHandlesProtocols() { $this->assertSame($this->response, $this->response->setProtocol('HTTP', '1.0')); $this->assertEquals('HTTP', $this->response->getProtocol()); $this->assertEquals('1.0', $this->response->getProtocolVersion()); } /** * @covers Guzzle\Http\Message\Response::isContentType */ public function testComparesContentType() { $response = new Response(200, array( 'Content-Type' => 'text/html; charset=ISO-8859-4' )); $this->assertTrue($response->isContentType('text/html')); $this->assertTrue($response->isContentType('TExT/html')); $this->assertTrue($response->isContentType('charset=ISO-8859-4')); $this->assertFalse($response->isContentType('application/xml')); } /** * @covers Guzzle\Http\Message\Response::isMethodAllowed */ public function testResponseDeterminesIfMethodIsAllowedBaseOnAllowHeader() { $response = new Response(200, array( 'Allow' => 'OPTIONS, POST, deletE,GET' )); $this->assertTrue($response->isMethodAllowed('get')); $this->assertTrue($response->isMethodAllowed('GET')); $this->assertTrue($response->isMethodAllowed('options')); $this->assertTrue($response->isMethodAllowed('post')); $this->assertTrue($response->isMethodAllowed('Delete')); $this->assertFalse($response->isMethodAllowed('put')); $this->assertFalse($response->isMethodAllowed('PUT')); $response = new Response(200); $this->assertFalse($response->isMethodAllowed('get')); } /** * @covers Guzzle\Http\Message\Response::getPreviousResponse * @covers Guzzle\Http\Message\Response::setPreviousResponse */ public function testHasPreviousResponse() { $response = new Response(200); $previous = new Response(302); $response->setPreviousResponse($previous); $this->assertSame($previous, $response->getPreviousResponse()); $this->assertNull($previous->getPreviousResponse()); } /** * @covers Guzzle\Http\Message\Response::json */ public function testParsesJsonResponses() { $response = new Response(200, array(), '{"foo": "bar"}'); $this->assertEquals(array('foo' => 'bar'), $response->json()); // Return array when null is a service response $response = new Response(200); $this->assertEquals(array(), $response->json()); } /** * @covers Guzzle\Http\Message\Response::json * @expectedException \Guzzle\Common\Exception\RuntimeException * @expectedExceptionMessage Unable to parse response body into JSON: 4 */ public function testThrowsExceptionWhenFailsToParseJsonResponse() { $response = new Response(200, array(), '{"foo": "'); $response->json(); } /** * @covers Guzzle\Http\Message\Response::xml */ public function testParsesXmlResponses() { $response = new Response(200, array(), 'bar'); $this->assertEquals('bar', (string) $response->xml()->foo); // Always return a SimpleXMLElement from the xml method $response = new Response(200); $this->assertEmpty((string) $response->xml()->foo); } /** * @covers Guzzle\Http\Message\Response::xml * @expectedException \Guzzle\Common\Exception\RuntimeException * @expectedExceptionMessage Unable to parse response body into XML: String could not be parsed as XML */ public function testThrowsExceptionWhenFailsToParseXmlResponse() { $response = new Response(200, array(), 'xml(); } } tests/Guzzle/Tests/Http/MimetypesTest.php000064400000001140151742734620014543 0ustar00assertEquals('text/x-php', Mimetypes::getInstance()->fromExtension('php')); } public function testGetsFromFilename() { $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(__FILE__)); } public function testReturnsNullWhenNoMatchFound() { $this->assertNull(Mimetypes::getInstance()->fromExtension('foobar')); } } tests/Guzzle/Tests/Http/QueryAggregator/CommaAggregatorTest.php000064400000001540151742734620020742 0ustar00aggregate($key, $value, $query); $this->assertEquals(array('test%20123' => 'foo%20123,baz,bar'), $result); } public function testEncodes() { $query = new QueryString(); $query->useUrlEncoding(false); $a = new Ag(); $key = 'test 123'; $value = array('foo 123', 'baz', 'bar'); $result = $a->aggregate($key, $value, $query); $this->assertEquals(array('test 123' => 'foo 123,baz,bar'), $result); } } tests/Guzzle/Tests/Http/QueryAggregator/DuplicateAggregatorTest.php000064400000001560151742734620021622 0ustar00aggregate($key, $value, $query); $this->assertEquals(array('facet%201' => array('size%20a', 'width%20b')), $result); } public function testEncodes() { $query = new QueryString(); $query->useUrlEncoding(false); $a = new Ag(); $key = 'facet 1'; $value = array('size a', 'width b'); $result = $a->aggregate($key, $value, $query); $this->assertEquals(array('facet 1' => array('size a', 'width b')), $result); } } tests/Guzzle/Tests/Http/QueryAggregator/PhpAggregatorTest.php000064400000001374151742734620020442 0ustar00useUrlEncoding(false); $a = new Ag(); $key = 't'; $value = array( 'v1' => 'a', 'v2' => 'b', 'v3' => array( 'v4' => 'c', 'v5' => 'd', ) ); $result = $a->aggregate($key, $value, $query); $this->assertEquals(array( 't[v1]' => 'a', 't[v2]' => 'b', 't[v3][v4]' => 'c', 't[v3][v5]' => 'd', ), $result); } } tests/Guzzle/Tests/Http/QueryStringTest.php000064400000016656151742734620015105 0ustar00q = new QueryString(); } public function testGetFieldSeparator() { $this->assertEquals('&', $this->q->getFieldSeparator()); } public function testGetValueSeparator() { $this->assertEquals('=', $this->q->getValueSeparator()); } public function testIsUrlEncoding() { $this->assertEquals('RFC 3986', $this->q->getUrlEncoding()); $this->assertTrue($this->q->isUrlEncoding()); $this->assertEquals('foo%20bar', $this->q->encodeValue('foo bar')); $this->q->useUrlEncoding(QueryString::FORM_URLENCODED); $this->assertTrue($this->q->isUrlEncoding()); $this->assertEquals(QueryString::FORM_URLENCODED, $this->q->getUrlEncoding()); $this->assertEquals('foo+bar', $this->q->encodeValue('foo bar')); $this->assertSame($this->q, $this->q->useUrlEncoding(false)); $this->assertFalse($this->q->isUrlEncoding()); $this->assertFalse($this->q->isUrlEncoding()); } public function testSetFieldSeparator() { $this->assertEquals($this->q, $this->q->setFieldSeparator('/')); $this->assertEquals('/', $this->q->getFieldSeparator()); } public function testSetValueSeparator() { $this->assertEquals($this->q, $this->q->setValueSeparator('/')); $this->assertEquals('/', $this->q->getValueSeparator()); } public function testUrlEncode() { $params = array( 'test' => 'value', 'test 2' => 'this is a test?', 'test3' => array('v1', 'v2', 'v3'), 'ሴ' => 'bar' ); $encoded = array( 'test' => 'value', 'test%202' => rawurlencode('this is a test?'), 'test3%5B0%5D' => 'v1', 'test3%5B1%5D' => 'v2', 'test3%5B2%5D' => 'v3', '%E1%88%B4' => 'bar' ); $this->q->replace($params); $this->assertEquals($encoded, $this->q->urlEncode()); // Disable encoding $testData = array('test 2' => 'this is a test'); $this->q->replace($testData); $this->q->useUrlEncoding(false); $this->assertEquals($testData, $this->q->urlEncode()); } public function testToString() { // Check with no parameters $this->assertEquals('', $this->q->__toString()); $params = array( 'test' => 'value', 'test 2' => 'this is a test?', 'test3' => array('v1', 'v2', 'v3'), 'test4' => null, ); $this->q->replace($params); $this->assertEquals('test=value&test%202=this%20is%20a%20test%3F&test3%5B0%5D=v1&test3%5B1%5D=v2&test3%5B2%5D=v3&test4=', $this->q->__toString()); $this->q->useUrlEncoding(false); $this->assertEquals('test=value&test 2=this is a test?&test3[0]=v1&test3[1]=v2&test3[2]=v3&test4=', $this->q->__toString()); // Use an alternative aggregator $this->q->setAggregator(new CommaAggregator()); $this->assertEquals('test=value&test 2=this is a test?&test3=v1,v2,v3&test4=', $this->q->__toString()); } public function testAllowsMultipleValuesPerKey() { $q = new QueryString(); $q->add('facet', 'size'); $q->add('facet', 'width'); $q->add('facet.field', 'foo'); // Use the duplicate aggregator $q->setAggregator(new DuplicateAggregator()); $this->assertEquals('facet=size&facet=width&facet.field=foo', $q->__toString()); } public function testAllowsNestedQueryData() { $this->q->replace(array( 'test' => 'value', 't' => array( 'v1' => 'a', 'v2' => 'b', 'v3' => array( 'v4' => 'c', 'v5' => 'd', ) ) )); $this->q->useUrlEncoding(false); $this->assertEquals('test=value&t[v1]=a&t[v2]=b&t[v3][v4]=c&t[v3][v5]=d', $this->q->__toString()); } public function parseQueryProvider() { return array( // Ensure that multiple query string values are allowed per value array('q=a&q=b', array( 'q' => array('a', 'b') )), // Ensure that PHP array style query string values are parsed array('q[]=a&q[]=b', array( 'q' => array('a', 'b') )), // Ensure that a single PHP array style query string value is parsed into an array array('q[]=a', array( 'q' => array('a') )), // Ensure that decimals are allowed in query strings array('q.a=a&q.b=b', array( 'q.a' => 'a', 'q.b' => 'b' )), // Ensure that query string values are percent decoded array('q%20a=a%20b', array( 'q a' => 'a b' )), // Ensure that values can be set without have a value array('q', array( 'q' => null )), ); } /** * @dataProvider parseQueryProvider */ public function testParsesQueryStrings($query, $data) { $query = QueryString::fromString($query); $this->assertEquals($data, $query->getAll()); } public function testProperlyDealsWithDuplicateQueryStringValues() { $query = QueryString::fromString('foo=a&foo=b&?µ=c'); $this->assertEquals(array('a', 'b'), $query->get('foo')); $this->assertEquals('c', $query->get('?µ')); } public function testAllowsBlankQueryStringValues() { $query = QueryString::fromString('foo'); $this->assertEquals('foo=', (string) $query); $query->set('foo', QueryString::BLANK); $this->assertEquals('foo', (string) $query); } public function testAllowsFalsyQueryStringValues() { $query = QueryString::fromString('0'); $this->assertEquals('0=', (string) $query); $query->set('0', QueryString::BLANK); $this->assertSame('0', (string) $query); } public function testFromStringIgnoresQuestionMark() { $query = QueryString::fromString('foo=baz&bar=boo'); $this->assertEquals('foo=baz&bar=boo', (string) $query); } public function testConvertsPlusSymbolsToSpaces() { $query = QueryString::fromString('var=foo+bar'); $this->assertEquals('foo bar', $query->get('var')); } public function testFromStringDoesntMangleZeroes() { $query = QueryString::fromString('var=0'); $this->assertSame('0', $query->get('var')); } public function testAllowsZeroValues() { $query = new QueryString(array( 'foo' => 0, 'baz' => '0', 'bar' => null, 'boo' => false )); $this->assertEquals('foo=0&baz=0&bar=&boo=', (string) $query); } public function testFromStringDoesntStripTrailingEquals() { $query = QueryString::fromString('data=mF0b3IiLCJUZWFtIERldiJdfX0='); $this->assertEquals('mF0b3IiLCJUZWFtIERldiJdfX0=', $query->get('data')); } } tests/Guzzle/Tests/Http/ReadLimitEntityBodyTest.php000064400000004406151742734620016464 0ustar00decorated = EntityBody::factory(fopen(__FILE__, 'r')); $this->body = new ReadLimitEntityBody($this->decorated, 10, 3); } public function testReturnsSubsetWhenCastToString() { $body = EntityBody::factory('foo_baz_bar'); $limited = new ReadLimitEntityBody($body, 3, 4); $this->assertEquals('baz', (string) $limited); } public function testReturnsSubsetOfEmptyBodyWhenCastToString() { $body = EntityBody::factory(''); $limited = new ReadLimitEntityBody($body, 0, 10); $this->assertEquals('', (string) $limited); } public function testSeeksWhenConstructed() { $this->assertEquals(3, $this->body->ftell()); } public function testAllowsBoundedSeek() { $this->body->seek(100); $this->assertEquals(13, $this->body->ftell()); $this->body->seek(0); $this->assertEquals(3, $this->body->ftell()); $this->assertEquals(false, $this->body->seek(1000, SEEK_END)); } public function testReadsOnlySubsetOfData() { $data = $this->body->read(100); $this->assertEquals(10, strlen($data)); $this->assertFalse($this->body->read(1000)); $this->body->setOffset(10); $newData = $this->body->read(100); $this->assertEquals(10, strlen($newData)); $this->assertNotSame($data, $newData); } public function testClaimsConsumedWhenReadLimitIsReached() { $this->assertFalse($this->body->isConsumed()); $this->body->read(1000); $this->assertTrue($this->body->isConsumed()); } public function testContentLengthIsBounded() { $this->assertEquals(10, $this->body->getContentLength()); } public function testContentMd5IsBasedOnSubsection() { $this->assertNotSame($this->body->getContentMd5(), $this->decorated->getContentMd5()); } } tests/Guzzle/Tests/Http/RedirectPluginTest.php000064400000021251151742734620015514 0ustar00getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", )); // Create a client that uses the default redirect behavior $client = new Client($this->getServer()->getUrl()); $request = $client->get('/foo'); $response = $request->send(); $this->assertEquals(200, $response->getStatusCode()); $requests = $this->getServer()->getReceivedRequests(true); // Ensure that two requests were sent $this->assertEquals('/foo', $requests[0]->getResource()); $this->assertEquals('GET', $requests[0]->getMethod()); $this->assertEquals('/redirect1', $requests[1]->getResource()); $this->assertEquals('GET', $requests[1]->getMethod()); $this->assertEquals('/redirect2', $requests[2]->getResource()); $this->assertEquals('GET', $requests[2]->getMethod()); // Ensure that the previous response was set correctly $this->assertEquals(301, $response->getPreviousResponse()->getStatusCode()); $this->assertEquals('/redirect2', (string) $response->getPreviousResponse()->getHeader('Location')); // Ensure that the redirect count was incremented $this->assertEquals(2, $request->getParams()->get(RedirectPlugin::REDIRECT_COUNT)); $c = 0; $r = $response->getPreviousResponse(); while ($r) { if ($c == 0) { $this->assertEquals('/redirect2', $r->getLocation()); } else { $this->assertEquals('/redirect1', $r->getLocation()); } $c++; $r = $r->getPreviousResponse(); } $this->assertEquals(2, $c); } public function testCanLimitNumberOfRedirects() { // Flush the server and queue up a redirect followed by a successful response $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect3\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect4\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect5\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect6\r\nContent-Length: 0\r\n\r\n" )); try { $client = new Client($this->getServer()->getUrl()); $client->get('/foo')->send(); $this->fail('Did not throw expected exception'); } catch (TooManyRedirectsException $e) { // Ensure that the exception message is correct $message = $e->getMessage(); $parts = explode("\n* Sending redirect request\n", $message); $this->assertContains('> GET /foo', $parts[0]); $this->assertContains('> GET /redirect1', $parts[1]); $this->assertContains('> GET /redirect2', $parts[2]); $this->assertContains('> GET /redirect3', $parts[3]); $this->assertContains('> GET /redirect4', $parts[4]); $this->assertContains('> GET /redirect5', $parts[5]); } } public function testDefaultBehaviorIsToRedirectWithGetForEntityEnclosingRequests() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", )); $client = new Client($this->getServer()->getUrl()); $client->post('/foo', array('X-Baz' => 'bar'), 'testing')->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals('POST', $requests[0]->getMethod()); $this->assertEquals('GET', $requests[1]->getMethod()); $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz')); $this->assertEquals('GET', $requests[2]->getMethod()); } public function testCanRedirectWithStrictRfcCompliance() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", )); $client = new Client($this->getServer()->getUrl()); $request = $client->post('/foo', array('X-Baz' => 'bar'), 'testing'); $request->getParams()->set(RedirectPlugin::STRICT_REDIRECTS, true); $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals('POST', $requests[0]->getMethod()); $this->assertEquals('POST', $requests[1]->getMethod()); $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz')); $this->assertEquals('POST', $requests[2]->getMethod()); } public function testRewindsStreamWhenRedirectingIfNeeded() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", )); $client = new Client($this->getServer()->getUrl()); $request = $client->put(); $request->configureRedirects(true); $body = EntityBody::factory('foo'); $body->read(1); $request->setBody($body); $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals('foo', (string) $requests[0]->getBody()); } /** * @expectedException \Guzzle\Http\Exception\CouldNotRewindStreamException */ public function testThrowsExceptionWhenStreamCannotBeRewound() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi", "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n" )); $client = new Client($this->getServer()->getUrl()); $request = $client->put(); $request->configureRedirects(true); $body = EntityBody::factory(fopen($this->getServer()->getUrl(), 'r')); $body->read(1); $request->setBody($body)->send(); } public function testRedirectsCanBeDisabledPerRequest() { $this->getServer()->flush(); $this->getServer()->enqueue(array("HTTP/1.1 301 Foo\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n")); $client = new Client($this->getServer()->getUrl()); $request = $client->put(); $request->configureRedirects(false, 0); $this->assertEquals(301, $request->send()->getStatusCode()); } public function testCanRedirectWithNoLeadingSlashAndQuery() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 301 Moved Permanently\r\nLocation: redirect?foo=bar\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", )); $client = new Client($this->getServer()->getUrl()); $request = $client->get('?foo=bar'); $request->send(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals($this->getServer()->getUrl() . '?foo=bar', $requests[0]->getUrl()); $this->assertEquals($this->getServer()->getUrl() . 'redirect?foo=bar', $requests[1]->getUrl()); // Ensure that the history on the actual request is correct $this->assertEquals($this->getServer()->getUrl() . '?foo=bar', $request->getUrl()); $this->assertEquals( $this->getServer()->getUrl() . 'redirect?foo=bar', $request->getResponse()->getRequest()->getUrl() ); } } tests/Guzzle/Tests/Http/Server.php000064400000014777151742734620013221 0ustar00port = $port ?: self::DEFAULT_PORT; $this->client = new Client($this->getUrl()); } /** * Destructor to safely shutdown the node.js server if it is still running */ public function __destruct() { // Disabled for now if (false && $this->running) { try { $this->stop(); } catch (\Exception $e) {} } } /** * Flush the received requests from the server * * @return bool Returns TRUE on success or FALSE on failure * @throws RuntimeException */ public function flush() { if (!$this->isRunning()) { return false; } return $this->client->delete('guzzle-server/requests') ->send()->getStatusCode() == 200; } /** * Queue an array of responses or a single response on the server. * * Any currently queued responses will be overwritten. Subsequent requests * on the server will return queued responses in FIFO order. * * @param array|Response $responses A single or array of Responses to queue * * @return bool Returns TRUE on success or FALSE on failure * @throws BadResponseException */ public function enqueue($responses) { $data = array(); foreach ((array) $responses as $response) { // Create the response object from a string if (is_string($response)) { $response = Response::fromMessage($response); } elseif (!($response instanceof Response)) { throw new BadResponseException( 'Responses must be strings or implement Response' ); } $data[] = array( 'statusCode' => $response->getStatusCode(), 'reasonPhrase' => $response->getReasonPhrase(), 'headers' => $response->getHeaders()->getAll(), 'body' => $response->getBody(true) ); } $request = $this->client->put('guzzle-server/responses', null, json_encode($data)); $request->removeHeader('Expect'); $response = $request->send(); return $response->getStatusCode() == 200; } /** * Check if the server is running * * @return bool */ public function isRunning() { if ($this->running) { return true; } else { $fp = @fsockopen('127.0.0.1', $this->port, $errno, $errstr, 1); if (!$fp) { return false; } else { fclose($fp); return true; } } } /** * Get the URL to the server * * @return string */ public function getUrl() { return 'http://127.0.0.1:' . $this->getPort() . '/'; } /** * Get the port that the server is listening on * * @return int */ public function getPort() { return $this->port; } /** * Get all of the received requests * * @param bool $hydrate Set to TRUE to turn the messages into * actual {@see RequestInterface} objects. If $hydrate is FALSE, * requests will be returned as strings. * * @return array * @throws RuntimeException */ public function getReceivedRequests($hydrate = false) { $data = array(); if ($this->isRunning()) { $response = $this->client->get('guzzle-server/requests')->send(); $data = array_filter(explode(self::REQUEST_DELIMITER, $response->getBody(true))); if ($hydrate) { $data = array_map(function($message) { return RequestFactory::getInstance()->fromMessage($message); }, $data); } } return $data; } /** * Start running the node.js server in the background */ public function start() { if (!$this->isRunning()) { exec('node ' . __DIR__ . \DIRECTORY_SEPARATOR . 'server.js ' . $this->port . ' >> /tmp/server.log 2>&1 &'); // Wait at most 5 seconds for the server the setup before proceeding $start = time(); while (!$this->isRunning() && time() - $start < 5); if (!$this->isRunning()) { throw new RuntimeException( 'Unable to contact server.js. Have you installed node.js ' . 'v0.5.0+? The node.js executable, node, must also be in ' . 'your path.' ); } } $this->running = true; } /** * Stop running the node.js server * * @return bool Returns TRUE on success or FALSE on failure * @throws RuntimeException */ public function stop() { if (!$this->isRunning()) { return false; } $this->running = false; return $this->client->delete('guzzle-server')->send() ->getStatusCode() == 200; } } tests/Guzzle/Tests/Http/UrlTest.php000064400000021127151742734620013340 0ustar00assertEquals('', (string) $url); } public function testPortIsDeterminedFromScheme() { $this->assertEquals(80, Url::factory('http://www.test.com/')->getPort()); $this->assertEquals(443, Url::factory('https://www.test.com/')->getPort()); $this->assertEquals(null, Url::factory('ftp://www.test.com/')->getPort()); $this->assertEquals(8192, Url::factory('http://www.test.com:8192/')->getPort()); } public function testCloneCreatesNewInternalObjects() { $u1 = Url::factory('http://www.test.com/'); $u2 = clone $u1; $this->assertNotSame($u1->getQuery(), $u2->getQuery()); } public function testValidatesUrlPartsInFactory() { $url = Url::factory('/index.php'); $this->assertEquals('/index.php', (string) $url); $this->assertFalse($url->isAbsolute()); $url = 'http://michael:test@test.com:80/path/123?q=abc#test'; $u = Url::factory($url); $this->assertEquals('http://michael:test@test.com/path/123?q=abc#test', (string) $u); $this->assertTrue($u->isAbsolute()); } public function testAllowsFalsyUrlParts() { $url = Url::factory('http://0:50/0?0#0'); $this->assertSame('0', $url->getHost()); $this->assertEquals(50, $url->getPort()); $this->assertSame('/0', $url->getPath()); $this->assertEquals('0=', (string) $url->getQuery()); $this->assertSame('0', $url->getFragment()); $this->assertEquals('http://0:50/0?0=#0', (string) $url); $url = Url::factory(''); $this->assertSame('', (string) $url); $url = Url::factory('0'); $this->assertSame('0', (string) $url); } public function testBuildsRelativeUrlsWithFalsyParts() { $url = Url::buildUrl(array( 'host' => '0', 'path' => '0', )); $this->assertSame('//0/0', $url); $url = Url::buildUrl(array( 'path' => '0', )); $this->assertSame('0', $url); } public function testUrlStoresParts() { $url = Url::factory('http://test:pass@www.test.com:8081/path/path2/?a=1&b=2#fragment'); $this->assertEquals('http', $url->getScheme()); $this->assertEquals('test', $url->getUsername()); $this->assertEquals('pass', $url->getPassword()); $this->assertEquals('www.test.com', $url->getHost()); $this->assertEquals(8081, $url->getPort()); $this->assertEquals('/path/path2/', $url->getPath()); $this->assertEquals('fragment', $url->getFragment()); $this->assertEquals('a=1&b=2', (string) $url->getQuery()); $this->assertEquals(array( 'fragment' => 'fragment', 'host' => 'www.test.com', 'pass' => 'pass', 'path' => '/path/path2/', 'port' => 8081, 'query' => 'a=1&b=2', 'scheme' => 'http', 'user' => 'test' ), $url->getParts()); } public function testHandlesPathsCorrectly() { $url = Url::factory('http://www.test.com'); $this->assertEquals('', $url->getPath()); $url->setPath('test'); $this->assertEquals('test', $url->getPath()); $url->setPath('/test/123/abc'); $this->assertEquals(array('test', '123', 'abc'), $url->getPathSegments()); $parts = parse_url('http://www.test.com/test'); $parts['path'] = ''; $this->assertEquals('http://www.test.com', Url::buildUrl($parts)); $parts['path'] = 'test'; $this->assertEquals('http://www.test.com/test', Url::buildUrl($parts)); } public function testAddsQueryStringIfPresent() { $this->assertEquals('?foo=bar', Url::buildUrl(array( 'query' => 'foo=bar' ))); } public function testAddsToPath() { // Does nothing here $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath(false)); $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('')); $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('/')); $this->assertEquals('http://e.com/base/relative?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('relative')); $this->assertEquals('http://e.com/base/relative?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('/relative')); } /** * URL combination data provider * * @return array */ public function urlCombineDataProvider() { return array( array('http://www.example.com/', 'http://www.example.com/', 'http://www.example.com/'), array('http://www.example.com/path', '/absolute', 'http://www.example.com/absolute'), array('http://www.example.com/path', '/absolute?q=2', 'http://www.example.com/absolute?q=2'), array('http://www.example.com/path', 'more', 'http://www.example.com/path/more'), array('http://www.example.com/path', 'more?q=1', 'http://www.example.com/path/more?q=1'), array('http://www.example.com/', '?q=1', 'http://www.example.com/?q=1'), array('http://www.example.com/path', 'http://test.com', 'http://test.com'), array('http://www.example.com:8080/path', 'http://test.com', 'http://test.com'), array('http://www.example.com:8080/path', '?q=2#abc', 'http://www.example.com:8080/path?q=2#abc'), array('http://u:a@www.example.com/path', 'test', 'http://u:a@www.example.com/path/test'), array('http://www.example.com/path', 'http://u:a@www.example.com/', 'http://u:a@www.example.com/'), array('/path?q=2', 'http://www.test.com/', 'http://www.test.com/path?q=2'), array('http://api.flickr.com/services/', 'http://www.flickr.com/services/oauth/access_token', 'http://www.flickr.com/services/oauth/access_token') ); } /** * @dataProvider urlCombineDataProvider */ public function testCombinesUrls($a, $b, $c) { $this->assertEquals($c, (string) Url::factory($a)->combine($b)); } public function testHasGettersAndSetters() { $url = Url::factory('http://www.test.com/'); $this->assertEquals('example.com', $url->setHost('example.com')->getHost()); $this->assertEquals('8080', $url->setPort(8080)->getPort()); $this->assertEquals('/foo/bar', $url->setPath(array('foo', 'bar'))->getPath()); $this->assertEquals('a', $url->setPassword('a')->getPassword()); $this->assertEquals('b', $url->setUsername('b')->getUsername()); $this->assertEquals('abc', $url->setFragment('abc')->getFragment()); $this->assertEquals('https', $url->setScheme('https')->getScheme()); $this->assertEquals('a=123', (string) $url->setQuery('a=123')->getQuery()); $this->assertEquals('https://b:a@example.com:8080/foo/bar?a=123#abc', (string)$url); $this->assertEquals('b=boo', (string) $url->setQuery(new QueryString(array( 'b' => 'boo' )))->getQuery()); $this->assertEquals('https://b:a@example.com:8080/foo/bar?b=boo#abc', (string)$url); } public function testSetQueryAcceptsArray() { $url = Url::factory('http://www.test.com'); $url->setQuery(array('a' => 'b')); $this->assertEquals('http://www.test.com?a=b', (string) $url); } public function urlProvider() { return array( array('/foo/..', ''), array('//foo//..', ''), array('/foo/../..', ''), array('/foo/../.', ''), array('/./foo/..', ''), array('/./foo', '/foo'), array('/./foo/', '/foo/'), array('/./foo/bar/baz/pho/../..', 'foo/bar'), array('*', '*'), array('/foo', '/foo') ); } /** * @dataProvider urlProvider */ public function testNormalizesPaths($path, $result) { $url = Url::factory('http://www.example.com/'); $url->setPath($path)->normalizePath(); $this->assertEquals($result, $url->getPath()); } public function testSettingHostWithPortModifiesPort() { $url = Url::factory('http://www.example.com'); $url->setHost('foo:8983'); $this->assertEquals('foo', $url->getHost()); $this->assertEquals(8983, $url->getPort()); } } tests/Guzzle/Tests/Http/server.js000064400000012671151742734620013075 0ustar00/** * Guzzle node.js test server to return queued responses to HTTP requests and * expose a RESTful API for enqueueing responses and retrieving the requests * that have been received. * * - Delete all requests that have been received: * DELETE /guzzle-server/requests * Host: 127.0.0.1:8124 * * - Enqueue responses * PUT /guzzle-server/responses * Host: 127.0.0.1:8124 * * [{ "statusCode": 200, "reasonPhrase": "OK", "headers": {}, "body": "" }] * * - Get the received requests * GET /guzzle-server/requests * Host: 127.0.0.1:8124 * * - Shutdown the server * DELETE /guzzle-server * Host: 127.0.0.1:8124 * * @package Guzzle PHP * @license See the LICENSE file that was distributed with this source code. */ var http = require("http"); /** * Guzzle node.js server * @class */ var GuzzleServer = function(port) { this.port = port; this.log = log; this.responses = []; this.requests = []; var that = this; /** * Handle a Guzzle Server control request * @param (String) request HTTP request as a string * @param (ServerRequest) req Received server request * @param (ServerResponse) res Outgoing server response */ var controlRequest = function(request, req, res) { if (req.method == "DELETE") { if (req.url == "/guzzle-server/requests") { // Clear the received requests that.requests = []; res.writeHead(200, "OK", { "Content-Length": 0 }); res.end(); if (this.log) { console.log("Flushing requests"); } } else if (req.url == "/guzzle-server") { // Shutdown the server res.writeHead(200, "OK", { "Content-Length": 0, "Connection": "close" }); res.end(); if (this.log) { console.log("Shutting down"); } that.server.close(); } } else if (req.method == "GET") { if (req.url === "/guzzle-server/requests") { // Get received requests var data = that.requests.join("\n----[request]\n"); res.writeHead(200, "OK", { "Content-Length": data.length }); res.end(data); if (that.log) { console.log("Sending receiving requests"); } } } else if (req.method == "PUT") { if (req.url == "/guzzle-server/responses") { if (that.log) { console.log("Adding responses..."); } // Received response to queue var data = request.split("\r\n\r\n")[1]; if (!data) { if (that.log) { console.log("No response data was provided"); } res.writeHead(500, "NO RESPONSES IN REQUEST", { "Content-Length": 0 }); } else { that.responses = eval("(" + data + ")"); if (that.log) { console.log(that.responses); } res.writeHead(200, "OK", { "Content-Length": 0 }); } res.end(); } } }; /** * Received a complete request * @param (String) request HTTP request as a string * @param (ServerRequest) req Received server request * @param (ServerResponse) res Outgoing server response */ var receivedRequest = function(request, req, res) { if (req.url.indexOf("/guzzle-server") === 0) { controlRequest(request, req, res); } else { var response = that.responses.shift(); res.writeHead(response.statusCode, response.reasonPhrase, response.headers); res.end(response.body); that.requests.push(request); } }; /** * Start the node.js Guzzle server */ this.start = function() { that.server = http.createServer(function(req, res) { // If this is not a control request and no responses are in queue, return 500 response if (req.url.indexOf("/guzzle-server") == -1 && !that.responses.length) { res.writeHead(500); res.end("No responses in queue"); return; } // Begin building the request message as a string var request = req.method + " " + req.url + " HTTP/" + req.httpVersion + "\r\n"; // Add the request headers for (var i in req.headers) { request += i + ": " + req.headers[i] + "\r\n"; } request += "\r\n"; // Receive each chunk of the request body req.addListener("data", function(chunk) { request += chunk; }); // Called when the request completes req.addListener("end", function() { receivedRequest(request, req, res); }); }); that.server.listen(port, "127.0.0.1"); if (this.log) { console.log("Server running at http://127.0.0.1:8124/"); } }; }; // Get the port from the arguments port = process.argv.length >= 3 ? process.argv[2] : 8124; log = process.argv.length >= 4 ? process.argv[3] : false; // Start the server server = new GuzzleServer(port, log); server.start(); tests/Guzzle/Tests/Inflection/InflectorTest.php000064400000002775151742734620015706 0ustar00assertSame(Inflector::getDefault(), Inflector::getDefault()); } public function testSnake() { $this->assertEquals('camel_case', Inflector::getDefault()->snake('camelCase')); $this->assertEquals('camel_case', Inflector::getDefault()->snake('CamelCase')); $this->assertEquals('camel_case_words', Inflector::getDefault()->snake('CamelCaseWords')); $this->assertEquals('camel_case_words', Inflector::getDefault()->snake('CamelCase_words')); $this->assertEquals('test', Inflector::getDefault()->snake('test')); $this->assertEquals('test', Inflector::getDefault()->snake('test')); $this->assertEquals('expect100_continue', Inflector::getDefault()->snake('Expect100Continue')); } public function testCamel() { $this->assertEquals('CamelCase', Inflector::getDefault()->camel('camel_case')); $this->assertEquals('CamelCaseWords', Inflector::getDefault()->camel('camel_case_words')); $this->assertEquals('Test', Inflector::getDefault()->camel('test')); $this->assertEquals('Expect100Continue', ucfirst(Inflector::getDefault()->camel('expect100_continue'))); // Get from cache $this->assertEquals('Test', Inflector::getDefault()->camel('test', false)); } } tests/Guzzle/Tests/Inflection/MemoizingInflectorTest.php000064400000003204151742734620017551 0ustar00getMock('Guzzle\Inflection\Inflector', array('snake', 'camel')); $mock->expects($this->once())->method('snake')->will($this->returnValue('foo_bar')); $mock->expects($this->once())->method('camel')->will($this->returnValue('FooBar')); $inflector = new MemoizingInflector($mock); $this->assertEquals('foo_bar', $inflector->snake('FooBar')); $this->assertEquals('foo_bar', $inflector->snake('FooBar')); $this->assertEquals('FooBar', $inflector->camel('foo_bar')); $this->assertEquals('FooBar', $inflector->camel('foo_bar')); } public function testProtectsAgainstCacheOverflow() { $inflector = new MemoizingInflector(new Inflector(), 10); for ($i = 1; $i < 11; $i++) { $inflector->camel('foo_' . $i); $inflector->snake('Foo' . $i); } $cache = $this->readAttribute($inflector, 'cache'); $this->assertEquals(10, count($cache['snake'])); $this->assertEquals(10, count($cache['camel'])); $inflector->camel('baz!'); $inflector->snake('baz!'); // Now ensure that 20% of the cache was removed (2), then the item was added $cache = $this->readAttribute($inflector, 'cache'); $this->assertEquals(9, count($cache['snake'])); $this->assertEquals(9, count($cache['camel'])); } } tests/Guzzle/Tests/Inflection/PreComputedInflectorTest.php000064400000004033151742734620020043 0ustar00getMock('Guzzle\Inflection\Inflector', array('snake', 'camel')); $mock->expects($this->once())->method('snake')->with('Test')->will($this->returnValue('test')); $mock->expects($this->once())->method('camel')->with('Test')->will($this->returnValue('Test')); $inflector = new PreComputedInflector($mock, array('FooBar' => 'foo_bar'), array('foo_bar' => 'FooBar')); $this->assertEquals('FooBar', $inflector->camel('foo_bar')); $this->assertEquals('foo_bar', $inflector->snake('FooBar')); $this->assertEquals('Test', $inflector->camel('Test')); $this->assertEquals('test', $inflector->snake('Test')); } public function testMirrorsPrecomputedValues() { $mock = $this->getMock('Guzzle\Inflection\Inflector', array('snake', 'camel')); $mock->expects($this->never())->method('snake'); $mock->expects($this->never())->method('camel'); $inflector = new PreComputedInflector($mock, array('Zeep' => 'zeep'), array(), true); $this->assertEquals('Zeep', $inflector->camel('zeep')); $this->assertEquals('zeep', $inflector->snake('Zeep')); } public function testMirrorsPrecomputedValuesByMerging() { $mock = $this->getMock('Guzzle\Inflection\Inflector', array('snake', 'camel')); $mock->expects($this->never())->method('snake'); $mock->expects($this->never())->method('camel'); $inflector = new PreComputedInflector($mock, array('Zeep' => 'zeep'), array('foo' => 'Foo'), true); $this->assertEquals('Zeep', $inflector->camel('zeep')); $this->assertEquals('zeep', $inflector->snake('Zeep')); $this->assertEquals('Foo', $inflector->camel('foo')); $this->assertEquals('foo', $inflector->snake('Foo')); } } tests/Guzzle/Tests/Iterator/AppendIteratorTest.php000064400000001240151742734620016363 0ustar00 1, 'b' => 2 )); $b = new \ArrayIterator(array()); $c = new \ArrayIterator(array( 'c' => 3, 'd' => 4 )); $i = new AppendIterator(); $i->append($a); $i->append($b); $i->append($c); $this->assertEquals(array(1, 2, 3, 4), iterator_to_array($i, false)); } } tests/Guzzle/Tests/Iterator/ChunkedIteratorTest.php000064400000001722151742734620016542 0ustar00assertEquals(11, count($chunks)); foreach ($chunks as $j => $chunk) { $this->assertEquals(range($j * 10, min(100, $j * 10 + 9)), $chunk); } } public function testChunksIteratorWithOddValues() { $chunked = new ChunkedIterator(new \ArrayIterator(array(1, 2, 3, 4, 5)), 2); $chunks = iterator_to_array($chunked, false); $this->assertEquals(3, count($chunks)); $this->assertEquals(array(1, 2), $chunks[0]); $this->assertEquals(array(3, 4), $chunks[1]); $this->assertEquals(array(5), $chunks[2]); } } tests/Guzzle/Tests/Iterator/FilterIteratorTest.php000064400000001211151742734620016377 0ustar00assertEquals(range(1, 99, 2), iterator_to_array($i, false)); } /** * @expectedException \InvalidArgumentException */ public function testValidatesCallable() { $i = new FilterIterator(new \ArrayIterator(), new \stdClass()); } } tests/Guzzle/Tests/Iterator/MapIteratorTest.php000064400000001176151742734620015701 0ustar00assertEquals(range(0, 1000, 10), iterator_to_array($i, false)); } /** * @expectedException \InvalidArgumentException */ public function testValidatesCallable() { $i = new MapIterator(new \ArrayIterator(), new \stdClass()); } } tests/Guzzle/Tests/Iterator/MethodProxyIteratorTest.php000064400000001553151742734620017445 0ustar00append('a'); $proxy->append('b'); $this->assertEquals(array('a', 'b'), $i->getArrayCopy()); $this->assertEquals(array('a', 'b'), $proxy->getArrayCopy()); } public function testUsesInnerIterator() { $i = new MethodProxyIterator(new ChunkedIterator(new \ArrayIterator(array(1, 2, 3, 4, 5)), 2)); $this->assertEquals(3, count(iterator_to_array($i, false))); } } tests/Guzzle/Tests/Log/ArrayLogAdapterTest.php000064400000001213151742734620015413 0ustar00log('test', \LOG_NOTICE, 'localhost'); $this->assertEquals(array(array('message' => 'test', 'priority' => \LOG_NOTICE, 'extras' => 'localhost')), $adapter->getLogs()); } public function testClearLog() { $adapter = new ArrayLogAdapter(); $adapter->log('test', \LOG_NOTICE, 'localhost'); $adapter->clearLogs(); $this->assertEquals(array(), $adapter->getLogs()); } } tests/Guzzle/Tests/Log/ClosureLogAdapterTest.php000064400000001447151742734620015762 0ustar00adapter = new ClosureLogAdapter(function($message, $priority, $extras = null) use ($that, &$modified) { $modified = array($message, $priority, $extras); }); $this->adapter->log('test', LOG_NOTICE, 'localhost'); $this->assertEquals(array('test', LOG_NOTICE, 'localhost'), $modified); } /** * @expectedException InvalidArgumentException */ public function testThrowsExceptionWhenNotCallable() { $this->adapter = new ClosureLogAdapter(123); } } tests/Guzzle/Tests/Log/MessageFormatterTest.php000064400000010004151742734620015640 0ustar00request = new EntityEnclosingRequest('POST', 'http://foo.com?q=test', array( 'X-Foo' => 'bar', 'Authorization' => 'Baz' )); $this->request->setBody(EntityBody::factory('Hello')); $this->response = new Response(200, array( 'X-Test' => 'Abc' ), 'Foo'); $this->handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle') ->disableOriginalConstructor() ->setMethods(array('getError', 'getErrorNo', 'getStderr', 'getInfo')) ->getMock(); $this->handle->expects($this->any()) ->method('getError') ->will($this->returnValue('e')); $this->handle->expects($this->any()) ->method('getErrorNo') ->will($this->returnValue('123')); $this->handle->expects($this->any()) ->method('getStderr') ->will($this->returnValue('testing')); $this->handle->expects($this->any()) ->method('getInfo') ->will($this->returnValueMap(array( array(CURLINFO_CONNECT_TIME, '123'), array(CURLINFO_TOTAL_TIME, '456') ))); } public function logProvider() { return array( // Uses the cache for the second time array('{method} - {method}', 'POST - POST'), array('{url}', 'http://foo.com?q=test'), array('{port}', '80'), array('{resource}', '/?q=test'), array('{host}', 'foo.com'), array('{hostname}', gethostname()), array('{protocol}/{version}', 'HTTP/1.1'), array('{code} {phrase}', '200 OK'), array('{req_header_Foo}', ''), array('{req_header_X-Foo}', 'bar'), array('{req_header_Authorization}', 'Baz'), array('{res_header_foo}', ''), array('{res_header_X-Test}', 'Abc'), array('{req_body}', 'Hello'), array('{res_body}', 'Foo'), array('{curl_stderr}', 'testing'), array('{curl_error}', 'e'), array('{curl_code}', '123'), array('{connect_time}', '123'), array('{total_time}', '456') ); } /** * @dataProvider logProvider */ public function testFormatsMessages($template, $output) { $formatter = new MessageFormatter($template); $this->assertEquals($output, $formatter->format($this->request, $this->response, $this->handle)); } public function testFormatsRequestsAndResponses() { $formatter = new MessageFormatter(); $formatter->setTemplate('{request}{response}'); $this->assertEquals($this->request . $this->response, $formatter->format($this->request, $this->response)); } public function testAddsTimestamp() { $formatter = new MessageFormatter('{ts}'); $this->assertNotEmpty($formatter->format($this->request, $this->response)); } public function testUsesResponseWhenNoHandleAndGettingCurlInformation() { $formatter = new MessageFormatter('{connect_time}/{total_time}'); $response = $this->getMockBuilder('Guzzle\Http\Message\Response') ->disableOriginalConstructor() ->setMethods(array('getInfo')) ->getMock(); $response->expects($this->exactly(2)) ->method('getInfo') ->will($this->returnValueMap(array( array('connect_time', '1'), array('total_time', '2'), ))); $this->assertEquals('1/2', $formatter->format($this->request, $response)); } } tests/Guzzle/Tests/Log/MonologLogAdapterTest.php000064400000001062151742734620015751 0ustar00pushHandler($handler); $adapter = new MonologLogAdapter($log); $adapter->log('test!', LOG_INFO); $this->assertTrue($handler->hasInfoRecords()); } } tests/Guzzle/Tests/Log/PsrLogAdapterTest.php000064400000001052151742734620015102 0ustar00pushHandler($handler); $adapter = new MonologLogAdapter($log); $adapter->log('test!', LOG_INFO); $this->assertTrue($handler->hasInfoRecords()); } } tests/Guzzle/Tests/Log/Zend_Log.php000064400000047034151742734620013246 0ustar00_priorities = array_flip($r->getConstants()); if ($writer !== null) { $this->addWriter($writer); } } /** * Factory to construct the logger and one or more writers * based on the configuration array * * @param array|Zend_Config Array or instance of Zend_Config * @return Zend_Log * @throws Zend_Log_Exception */ static public function factory($config = array()) { if ($config instanceof Zend_Config) { $config = $config->toArray(); } if (!is_array($config) || empty($config)) { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Configuration must be an array or instance of Zend_Config'); } $log = new self; if (array_key_exists('timestampFormat', $config)) { if (null != $config['timestampFormat'] && '' != $config['timestampFormat']) { $log->setTimestampFormat($config['timestampFormat']); } unset($config['timestampFormat']); } if (!is_array(current($config))) { $log->addWriter(current($config)); } else { foreach($config as $writer) { $log->addWriter($writer); } } return $log; } /** * Construct a writer object based on a configuration array * * @param array $spec config array with writer spec * @return Zend_Log_Writer_Abstract * @throws Zend_Log_Exception */ protected function _constructWriterFromConfig($config) { $writer = $this->_constructFromConfig('writer', $config, $this->_defaultWriterNamespace); if (!$writer instanceof Zend_Log_Writer_Abstract) { $writerName = is_object($writer) ? get_class($writer) : 'The specified writer'; /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception("{$writerName} does not extend Zend_Log_Writer_Abstract!"); } if (isset($config['filterName'])) { $filter = $this->_constructFilterFromConfig($config); $writer->addFilter($filter); } if (isset($config['formatterName'])) { $formatter = $this->_constructFormatterFromConfig($config); $writer->setFormatter($formatter); } return $writer; } /** * Construct filter object from configuration array or Zend_Config object * * @param array|Zend_Config $config Zend_Config or Array * @return Zend_Log_Filter_Interface * @throws Zend_Log_Exception */ protected function _constructFilterFromConfig($config) { $filter = $this->_constructFromConfig('filter', $config, $this->_defaultFilterNamespace); if (!$filter instanceof Zend_Log_Filter_Interface) { $filterName = is_object($filter) ? get_class($filter) : 'The specified filter'; /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception("{$filterName} does not implement Zend_Log_Filter_Interface"); } return $filter; } /** * Construct formatter object from configuration array or Zend_Config object * * @param array|Zend_Config $config Zend_Config or Array * @return Zend_Log_Formatter_Interface * @throws Zend_Log_Exception */ protected function _constructFormatterFromConfig($config) { $formatter = $this->_constructFromConfig('formatter', $config, $this->_defaultFormatterNamespace); if (!$formatter instanceof Zend_Log_Formatter_Interface) { $formatterName = is_object($formatter) ? get_class($formatter) : 'The specified formatter'; /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception($formatterName . ' does not implement Zend_Log_Formatter_Interface'); } return $formatter; } /** * Construct a filter or writer from config * * @param string $type 'writer' of 'filter' * @param mixed $config Zend_Config or Array * @param string $namespace * @return object * @throws Zend_Log_Exception */ protected function _constructFromConfig($type, $config, $namespace) { if ($config instanceof Zend_Config) { $config = $config->toArray(); } if (!is_array($config) || empty($config)) { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception( 'Configuration must be an array or instance of Zend_Config' ); } $params = isset($config[ $type .'Params' ]) ? $config[ $type .'Params' ] : array(); $className = $this->getClassName($config, $type, $namespace); if (!class_exists($className)) { require_once 'Zend/Loader.php'; Zend_Loader::loadClass($className); } $reflection = new ReflectionClass($className); if (!$reflection->implementsInterface('Zend_Log_FactoryInterface')) { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception( $className . ' does not implement Zend_Log_FactoryInterface and can not be constructed from config.' ); } return call_user_func(array($className, 'factory'), $params); } /** * Get the writer or filter full classname * * @param array $config * @param string $type filter|writer * @param string $defaultNamespace * @return string full classname * @throws Zend_Log_Exception */ protected function getClassName($config, $type, $defaultNamespace) { if (!isset($config[$type . 'Name'])) { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception("Specify {$type}Name in the configuration array"); } $className = $config[$type . 'Name']; $namespace = $defaultNamespace; if (isset($config[$type . 'Namespace'])) { $namespace = $config[$type . 'Namespace']; } // PHP >= 5.3.0 namespace given? if (substr($namespace, -1) == '\\') { return $namespace . $className; } // empty namespace given? if (strlen($namespace) === 0) { return $className; } return $namespace . '_' . $className; } /** * Packs message and priority into Event array * * @param string $message Message to log * @param integer $priority Priority of message * @return array Event array */ protected function _packEvent($message, $priority) { return array_merge(array( 'timestamp' => date($this->_timestampFormat), 'message' => $message, 'priority' => $priority, 'priorityName' => $this->_priorities[$priority] ), $this->_extras ); } /** * Class destructor. Shutdown log writers * * @return void */ public function __destruct() { foreach($this->_writers as $writer) { $writer->shutdown(); } } /** * Undefined method handler allows a shortcut: * $log->priorityName('message') * instead of * $log->log('message', Zend_Log::PRIORITY_NAME) * * @param string $method priority name * @param string $params message to log * @return void * @throws Zend_Log_Exception */ public function __call($method, $params) { $priority = strtoupper($method); if (($priority = array_search($priority, $this->_priorities)) !== false) { switch (count($params)) { case 0: /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Missing log message'); case 1: $message = array_shift($params); $extras = null; break; default: $message = array_shift($params); $extras = array_shift($params); break; } $this->log($message, $priority, $extras); } else { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Bad log priority'); } } /** * Log a message at a priority * * @param string $message Message to log * @param integer $priority Priority of message * @param mixed $extras Extra information to log in event * @return void * @throws Zend_Log_Exception */ public function log($message, $priority, $extras = null) { // sanity checks if (empty($this->_writers)) { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('No writers were added'); } if (! isset($this->_priorities[$priority])) { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Bad log priority'); } // pack into event required by filters and writers $event = $this->_packEvent($message, $priority); // Check to see if any extra information was passed if (!empty($extras)) { $info = array(); if (is_array($extras)) { foreach ($extras as $key => $value) { if (is_string($key)) { $event[$key] = $value; } else { $info[] = $value; } } } else { $info = $extras; } if (!empty($info)) { $event['info'] = $info; } } // abort if rejected by the global filters foreach ($this->_filters as $filter) { if (! $filter->accept($event)) { return; } } // send to each writer foreach ($this->_writers as $writer) { $writer->write($event); } } /** * Add a custom priority * * @param string $name Name of priority * @param integer $priority Numeric priority * @throws Zend_Log_Exception */ public function addPriority($name, $priority) { // Priority names must be uppercase for predictability. $name = strtoupper($name); if (isset($this->_priorities[$priority]) || false !== array_search($name, $this->_priorities)) { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Existing priorities cannot be overwritten'); } $this->_priorities[$priority] = $name; return $this; } /** * Add a filter that will be applied before all log writers. * Before a message will be received by any of the writers, it * must be accepted by all filters added with this method. * * @param int|Zend_Config|array|Zend_Log_Filter_Interface $filter * @return Zend_Log * @throws Zend_Log_Exception */ public function addFilter($filter) { if (is_int($filter)) { /** @see Zend_Log_Filter_Priority */ require_once 'Zend/Log/Filter/Priority.php'; $filter = new Zend_Log_Filter_Priority($filter); } elseif ($filter instanceof Zend_Config || is_array($filter)) { $filter = $this->_constructFilterFromConfig($filter); } elseif(! $filter instanceof Zend_Log_Filter_Interface) { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Invalid filter provided'); } $this->_filters[] = $filter; return $this; } /** * Add a writer. A writer is responsible for taking a log * message and writing it out to jar. * * @param mixed $writer Zend_Log_Writer_Abstract or Config array * @return Zend_Log */ public function addWriter($writer) { if (is_array($writer) || $writer instanceof Zend_Config) { $writer = $this->_constructWriterFromConfig($writer); } if (!$writer instanceof Zend_Log_Writer_Abstract) { /** @see Zend_Log_Exception */ require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception( 'Writer must be an instance of Zend_Log_Writer_Abstract' . ' or you should pass a configuration array' ); } $this->_writers[] = $writer; return $this; } /** * Set an extra item to pass to the log writers. * * @param string $name Name of the field * @param string $value Value of the field * @return Zend_Log */ public function setEventItem($name, $value) { $this->_extras = array_merge($this->_extras, array($name => $value)); return $this; } /** * Register Logging system as an error handler to log php errors * Note: it still calls the original error handler if set_error_handler is able to return it. * * Errors will be mapped as: * E_NOTICE, E_USER_NOTICE => NOTICE * E_WARNING, E_CORE_WARNING, E_USER_WARNING => WARN * E_ERROR, E_USER_ERROR, E_CORE_ERROR, E_RECOVERABLE_ERROR => ERR * E_DEPRECATED, E_STRICT, E_USER_DEPRECATED => DEBUG * (unknown/other) => INFO * * @link http://www.php.net/manual/en/function.set-error-handler.php Custom error handler * * @return Zend_Log */ public function registerErrorHandler() { // Only register once. Avoids loop issues if it gets registered twice. if ($this->_registeredErrorHandler) { return $this; } $this->_origErrorHandler = set_error_handler(array($this, 'errorHandler')); // Construct a default map of phpErrors to Zend_Log priorities. // Some of the errors are uncatchable, but are included for completeness $this->_errorHandlerMap = array( E_NOTICE => Zend_Log::NOTICE, E_USER_NOTICE => Zend_Log::NOTICE, E_WARNING => Zend_Log::WARN, E_CORE_WARNING => Zend_Log::WARN, E_USER_WARNING => Zend_Log::WARN, E_ERROR => Zend_Log::ERR, E_USER_ERROR => Zend_Log::ERR, E_CORE_ERROR => Zend_Log::ERR, E_RECOVERABLE_ERROR => Zend_Log::ERR, E_STRICT => Zend_Log::DEBUG, ); // PHP 5.3.0+ if (defined('E_DEPRECATED')) { $this->_errorHandlerMap['E_DEPRECATED'] = Zend_Log::DEBUG; } if (defined('E_USER_DEPRECATED')) { $this->_errorHandlerMap['E_USER_DEPRECATED'] = Zend_Log::DEBUG; } $this->_registeredErrorHandler = true; return $this; } /** * Error Handler will convert error into log message, and then call the original error handler * * @link http://www.php.net/manual/en/function.set-error-handler.php Custom error handler * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline * @param array $errcontext * @return boolean */ public function errorHandler($errno, $errstr, $errfile, $errline, $errcontext) { $errorLevel = error_reporting(); if ($errorLevel && $errno) { if (isset($this->_errorHandlerMap[$errno])) { $priority = $this->_errorHandlerMap[$errno]; } else { $priority = Zend_Log::INFO; } $this->log($errstr, $priority, array('errno'=>$errno, 'file'=>$errfile, 'line'=>$errline, 'context'=>$errcontext)); } if ($this->_origErrorHandler !== null) { return call_user_func($this->_origErrorHandler, $errno, $errstr, $errfile, $errline, $errcontext); } return false; } /** * Set timestamp format for log entries. * * @param string $format * @return Zend_Log */ public function setTimestampFormat($format) { $this->_timestampFormat = $format; return $this; } /** * Get timestamp format used for log entries. * * @return string */ public function getTimestampFormat() { return $this->_timestampFormat; } } tests/Guzzle/Tests/Log/Zf1LogAdapterTest.php000064400000003107151742734620015001 0ustar00stream = fopen('php://temp', 'r+'); $this->log = new \Zend_Log(new \Zend_Log_Writer_Stream($this->stream)); $this->adapter = new Zf1LogAdapter($this->log); } public function testLogsMessagesToAdaptedObject() { // Test without a priority $this->adapter->log('test', \LOG_NOTICE, 'guzzle.common.log.adapter.zend_log_adapter', 'localhost'); rewind($this->stream); $this->assertEquals(1, substr_count(stream_get_contents($this->stream), 'test')); // Test with a priority $this->adapter->log('test', \LOG_ALERT); rewind($this->stream); $this->assertEquals(2, substr_count(stream_get_contents($this->stream), 'test')); } public function testExposesAdaptedLogObject() { $this->assertEquals($this->log, $this->adapter->getLogObject()); } } tests/Guzzle/Tests/Log/Zf2LogAdapterTest.php000064400000002724151742734620015006 0ustar00stream = fopen('php://temp', 'r+'); $this->log = new Logger(); $this->log->addWriter(new Stream($this->stream)); $this->adapter = new Zf2LogAdapter($this->log); } public function testLogsMessagesToAdaptedObject() { // Test without a priority $this->adapter->log('Zend_Test!', \LOG_NOTICE); rewind($this->stream); $contents = stream_get_contents($this->stream); $this->assertEquals(1, substr_count($contents, 'Zend_Test!')); // Test with a priority $this->adapter->log('Zend_Test!', \LOG_ALERT); rewind($this->stream); $contents = stream_get_contents($this->stream); $this->assertEquals(2, substr_count($contents, 'Zend_Test!')); } public function testExposesAdaptedLogObject() { $this->assertEquals($this->log, $this->adapter->getLogObject()); } } tests/Guzzle/Tests/Mock/CustomResponseModel.php000064400000000647151742734620015666 0ustar00command = $command; } } tests/Guzzle/Tests/Mock/ErrorResponseMock.php000064400000001212151742734620015323 0ustar00command = $command; $this->response = $response; $this->message = 'Error from ' . $response; } } tests/Guzzle/Tests/Mock/ExceptionMock.php000064400000000223151742734620014452 0ustar00multiHandle; } } tests/Guzzle/Tests/Mock/MockObserver.php000064400000002550151742734620014310 0ustar00events as $event) { if ($event->getName() == $eventName) { return true; } } return false; } public function getLastEvent() { return end($this->events); } public function count() { return count($this->events); } public function getGrouped() { $events = array(); foreach ($this->events as $event) { if (!isset($events[$event->getName()])) { $events[$event->getName()] = array(); } $events[$event->getName()][] = $event; } return $events; } public function getData($event, $key, $occurrence = 0) { $grouped = $this->getGrouped(); if (isset($grouped[$event])) { return $grouped[$event][$occurrence][$key]; } return null; } /** * {@inheritdoc} */ public function update(Event $event) { $this->events[] = $event; } } tests/Guzzle/Tests/Mock/MockSubject.php000064400000000150151742734620014112 0ustar00 'allseeing-i.com', 'path' => '/', 'data' => array( 'PHPSESSID' => '6c951590e7a9359bcedde25cda73e43c' ), 'max_age' => NULL, 'expires' => 'Sat, 26-Jul-2008 17:00:42 GMT', 'version' => NULL, 'secure' => NULL, 'discard' => NULL, 'port' => NULL, 'cookies' => array( 'ASIHTTPRequestTestCookie' => 'This+is+the+value' ), 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), array('', false), array('foo', false), // Test setting a blank value for a cookie array(array( 'foo=', 'foo =', 'foo =;', 'foo= ;', 'foo =', 'foo= '), array( 'cookies' => array( 'foo' => '' ), 'data' => array(), 'discard' => null, 'domain' => null, 'expires' => null, 'max_age' => null, 'path' => '/', 'port' => null, 'secure' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), // Test setting a value and removing quotes array(array( 'foo=1', 'foo =1', 'foo =1;', 'foo=1 ;', 'foo =1', 'foo= 1', 'foo = 1 ;', 'foo="1"', 'foo="1";', 'foo= "1";'), array( 'cookies' => array( 'foo' => '1' ), 'data' => array(), 'discard' => null, 'domain' => null, 'expires' => null, 'max_age' => null, 'path' => '/', 'port' => null, 'secure' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), // Test setting multiple values array(array( 'foo=1; bar=2;', 'foo =1; bar = "2"', 'foo=1; bar=2'), array( 'cookies' => array( 'foo' => '1', 'bar' => '2', ), 'data' => array(), 'discard' => null, 'domain' => null, 'expires' => null, 'max_age' => null, 'path' => '/', 'port' => null, 'secure' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), // Tests getting the domain and path from a reference request array(array( 'foo=1; port="80,8081"; httponly', 'foo=1; port="80,8081"; domain=www.test.com; HttpOnly;', 'foo=1; ; domain=www.test.com; path=/path/; port="80,8081"; HttpOnly;'), array( 'cookies' => array( 'foo' => 1 ), 'data' => array(), 'discard' => null, 'domain' => 'www.test.com', 'expires' => null, 'max_age' => null, 'path' => '/path/', 'port' => array('80', '8081'), 'secure' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => true ), 'http://www.test.com/path/' ), // Some of the following tests are based on http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/Http/CookieTest.php array( 'justacookie=foo; domain=example.com', array( 'cookies' => array( 'justacookie' => 'foo' ), 'domain' => 'example.com', 'path' => '', 'data' => array(), 'discard' => null, 'expires' => null, 'max_age' => null, 'path' => '/', 'port' => null, 'secure' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), array( 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com', array( 'cookies' => array( 'expires' => 'tomorrow' ), 'domain' => '.example.com', 'path' => '/Space Out/', 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', 'data' => array(), 'discard' => null, 'port' => null, 'secure' => true, 'version' => null, 'max_age' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), array( 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/', array( 'cookies' => array( 'domain' => 'unittests' ), 'domain' => 'example.com', 'path' => '/some value/', 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', 'secure' => false, 'data' => array(), 'discard' => null, 'max_age' => null, 'port' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), array( 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT', array( 'cookies' => array( 'path' => 'indexAction' ), 'domain' => '.foo.com', 'path' => '/', 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', 'secure' => false, 'data' => array(), 'discard' => null, 'max_age' => null, 'port' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), array( 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400', array( 'cookies' => array( 'secure' => 'sha1' ), 'domain' => 'some.really.deep.domain.com', 'path' => '/', 'secure' => true, 'data' => array(), 'discard' => null, 'expires' => time() + 86400, 'max_age' => 86400, 'port' => null, 'version' => 1, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), array( 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;', array( 'cookies' => array( 'PHPSESSID' => '123456789+abcd%2Cef' ), 'domain' => '.localdomain', 'path' => '/foo/baz', 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', 'secure' => true, 'data' => array(), 'discard' => true, 'max_age' => null, 'port' => null, 'version' => null, 'comment' => null, 'comment_url' => null, 'http_only' => false ) ), ); } /** * @dataProvider cookieParserDataProvider * @covers Guzzle\Parser\Cookie\CookieParser */ public function testParseCookie($cookie, $parsed, $url = null) { $c = $this->cookieParserClass; $parser = new $c(); $request = null; if ($url) { $url = Url::factory($url); $host = $url->getHost(); $path = $url->getPath(); } else { $host = ''; $path = ''; } foreach ((array) $cookie as $c) { $p = $parser->parseCookie($c, $host, $path); // Remove expires values from the assertion if they are relatively equal if ($p['expires'] != $parsed['expires']) { if (abs($p['expires'] - $parsed['expires']) < 20) { unset($p['expires']); unset($parsed['expires']); } } if (is_array($parsed)) { foreach ($parsed as $key => $value) { $this->assertEquals($parsed[$key], $p[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); } foreach ($p as $key => $value) { $this->assertEquals($p[$key], $parsed[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); } } else { $this->assertEquals($parsed, $p); } } } } tests/Guzzle/Tests/Parser/Cookie/CookieParserTest.php000064400000001025151742734620016705 0ustar00parseCookie('foo=baz+bar', null, null, true); $this->assertEquals(array( 'foo' => 'baz bar' ), $result['cookies']); } } tests/Guzzle/Tests/Parser/Message/MessageParserProvider.php000064400000020102151742734620020103 0ustar00 'GET', 'protocol' => 'HTTP', 'version' => '1.1', 'request_url' => array( 'scheme' => 'http', 'host' => '', 'port' => '', 'path' => '/', 'query' => '' ), 'headers' => array(), 'body' => '' )), // Path and query string, multiple header values per header and case sensitive storage array("HEAD /path?query=foo HTTP/1.0\r\nHost: example.com\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\nX-Foo: Baz\r\n\r\n", array( 'method' => 'HEAD', 'protocol' => 'HTTP', 'version' => '1.0', 'request_url' => array( 'scheme' => 'http', 'host' => 'example.com', 'port' => '', 'path' => '/path', 'query' => 'query=foo' ), 'headers' => array( 'Host' => 'example.com', 'X-Foo' => array('foo', 'foo', 'Baz'), 'x-foo' => 'Bar' ), 'body' => '' )), // Includes a body array("PUT / HTTP/1.0\r\nhost: example.com:443\r\nContent-Length: 4\r\n\r\ntest", array( 'method' => 'PUT', 'protocol' => 'HTTP', 'version' => '1.0', 'request_url' => array( 'scheme' => 'https', 'host' => 'example.com', 'port' => '443', 'path' => '/', 'query' => '' ), 'headers' => array( 'host' => 'example.com:443', 'Content-Length' => '4' ), 'body' => 'test' )), // Includes Authorization headers array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nAuthorization: Basic {$auth}\r\n\r\n", array( 'method' => 'GET', 'protocol' => 'HTTP', 'version' => '1.1', 'request_url' => array( 'scheme' => 'http', 'host' => 'example.com', 'port' => '8080', 'path' => '/', 'query' => '' ), 'headers' => array( 'Host' => 'example.com:8080', 'Authorization' => "Basic {$auth}" ), 'body' => '' )), // Include authorization header array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nauthorization: Basic {$auth}\r\n\r\n", array( 'method' => 'GET', 'protocol' => 'HTTP', 'version' => '1.1', 'request_url' => array( 'scheme' => 'http', 'host' => 'example.com', 'port' => '8080', 'path' => '/', 'query' => '' ), 'headers' => array( 'Host' => 'example.com:8080', 'authorization' => "Basic {$auth}" ), 'body' => '' )), ); } public function responseProvider() { return array( // Empty request array('', false), array("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", array( 'protocol' => 'HTTP', 'version' => '1.1', 'code' => '200', 'reason_phrase' => 'OK', 'headers' => array( 'Content-Length' => 0 ), 'body' => '' )), array("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n", array( 'protocol' => 'HTTP', 'version' => '1.0', 'code' => '400', 'reason_phrase' => 'Bad Request', 'headers' => array( 'Content-Length' => 0 ), 'body' => '' )), array("HTTP/1.0 100 Continue\r\n\r\n", array( 'protocol' => 'HTTP', 'version' => '1.0', 'code' => '100', 'reason_phrase' => 'Continue', 'headers' => array(), 'body' => '' )), array("HTTP/1.1 204 No Content\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\n\r\n", array( 'protocol' => 'HTTP', 'version' => '1.1', 'code' => '204', 'reason_phrase' => 'No Content', 'headers' => array( 'X-Foo' => array('foo', 'foo'), 'x-foo' => 'Bar' ), 'body' => '' )), array("HTTP/1.1 200 Ok that is great!\r\nContent-Length: 4\r\n\r\nTest", array( 'protocol' => 'HTTP', 'version' => '1.1', 'code' => '200', 'reason_phrase' => 'Ok that is great!', 'headers' => array( 'Content-Length' => 4 ), 'body' => 'Test' )), ); } public function compareRequestResults($result, $expected) { if (!$result) { $this->assertFalse($expected); return; } $this->assertEquals($result['method'], $expected['method']); $this->assertEquals($result['protocol'], $expected['protocol']); $this->assertEquals($result['version'], $expected['version']); $this->assertEquals($result['request_url'], $expected['request_url']); $this->assertEquals($result['body'], $expected['body']); $this->compareHttpHeaders($result['headers'], $expected['headers']); } public function compareResponseResults($result, $expected) { if (!$result) { $this->assertFalse($expected); return; } $this->assertEquals($result['protocol'], $expected['protocol']); $this->assertEquals($result['version'], $expected['version']); $this->assertEquals($result['code'], $expected['code']); $this->assertEquals($result['reason_phrase'], $expected['reason_phrase']); $this->assertEquals($result['body'], $expected['body']); $this->compareHttpHeaders($result['headers'], $expected['headers']); } protected function normalizeHeaders($headers) { $normalized = array(); foreach ($headers as $key => $value) { $key = strtolower($key); if (!isset($normalized[$key])) { $normalized[$key] = $value; } elseif (!is_array($normalized[$key])) { $normalized[$key] = array($value); } else { $normalized[$key][] = $value; } } foreach ($normalized as $key => &$value) { if (is_array($value)) { sort($value); } } return $normalized; } public function compareHttpHeaders($result, $expected) { // Aggregate all headers case-insensitively $result = $this->normalizeHeaders($result); $expected = $this->normalizeHeaders($expected); $this->assertEquals($result, $expected); } } tests/Guzzle/Tests/Parser/Message/MessageParserTest.php000064400000004434151742734620017242 0ustar00compareRequestResults($parts, $parser->parseRequest($message)); } /** * @covers Guzzle\Parser\Message\MessageParser::parseMessage * @covers Guzzle\Parser\Message\MessageParser::parseResponse * @dataProvider responseProvider */ public function testParsesResponses($message, $parts) { $parser = new MessageParser(); $this->compareResponseResults($parts, $parser->parseResponse($message)); } /** * @covers Guzzle\Parser\Message\MessageParser::parseRequest */ public function testParsesRequestsWithMissingProtocol() { $parser = new MessageParser(); $parts = $parser->parseRequest("GET /\r\nHost: Foo.com\r\n\r\n"); $this->assertEquals('GET', $parts['method']); $this->assertEquals('HTTP', $parts['protocol']); $this->assertEquals('1.1', $parts['version']); } /** * @covers Guzzle\Parser\Message\MessageParser::parseRequest */ public function testParsesRequestsWithMissingVersion() { $parser = new MessageParser(); $parts = $parser->parseRequest("GET / HTTP\r\nHost: Foo.com\r\n\r\n"); $this->assertEquals('GET', $parts['method']); $this->assertEquals('HTTP', $parts['protocol']); $this->assertEquals('1.1', $parts['version']); } /** * @covers Guzzle\Parser\Message\MessageParser::parseResponse */ public function testParsesResponsesWithMissingReasonPhrase() { $parser = new MessageParser(); $parts = $parser->parseResponse("HTTP/1.1 200\r\n\r\n"); $this->assertEquals('200', $parts['code']); $this->assertEquals('', $parts['reason_phrase']); $this->assertEquals('HTTP', $parts['protocol']); $this->assertEquals('1.1', $parts['version']); } } tests/Guzzle/Tests/Parser/Message/PeclHttpMessageParserTest.php000064400000001732151742734620020704 0ustar00markTestSkipped('pecl_http is not available.'); } } /** * @covers Guzzle\Parser\Message\PeclHttpMessageParser::parseRequest * @dataProvider requestProvider */ public function testParsesRequests($message, $parts) { $parser = new PeclHttpMessageParser(); $this->compareRequestResults($parts, $parser->parseRequest($message)); } /** * @covers Guzzle\Parser\Message\PeclHttpMessageParser::parseResponse * @dataProvider responseProvider */ public function testParsesResponses($message, $parts) { $parser = new PeclHttpMessageParser(); $this->compareResponseResults($parts, $parser->parseResponse($message)); } } tests/Guzzle/Tests/Parser/ParserRegistryTest.php000064400000001443151742734620016077 0ustar00registerParser('foo', $c); $this->assertSame($c, $r->getParser('foo')); } public function testReturnsNullWhenNotFound() { $r = new ParserRegistry(); $this->assertNull($r->getParser('FOO')); } public function testReturnsLazyLoadedDefault() { $r = new ParserRegistry(); $c = $r->getParser('cookie'); $this->assertInstanceOf('Guzzle\Parser\Cookie\CookieParser', $c); $this->assertSame($c, $r->getParser('cookie')); } } tests/Guzzle/Tests/Parser/UriTemplate/AbstractUriTemplateTest.php000064400000013132151742734620021262 0ustar00 'value', 'hello' => 'Hello World!', 'empty' => '', 'path' => '/foo/bar', 'x' => '1024', 'y' => '768', 'null' => null, 'list' => array('red', 'green', 'blue'), 'keys' => array( "semi" => ';', "dot" => '.', "comma" => ',' ), 'empty_keys' => array(), ); return array_map(function($t) use ($params) { $t[] = $params; return $t; }, array( array('foo', 'foo'), array('{var}', 'value'), array('{hello}', 'Hello%20World%21'), array('{+var}', 'value'), array('{+hello}', 'Hello%20World!'), array('{+path}/here', '/foo/bar/here'), array('here?ref={+path}', 'here?ref=/foo/bar'), array('X{#var}', 'X#value'), array('X{#hello}', 'X#Hello%20World!'), array('map?{x,y}', 'map?1024,768'), array('{x,hello,y}', '1024,Hello%20World%21,768'), array('{+x,hello,y}', '1024,Hello%20World!,768'), array('{+path,x}/here', '/foo/bar,1024/here'), array('{#x,hello,y}', '#1024,Hello%20World!,768'), array('{#path,x}/here', '#/foo/bar,1024/here'), array('X{.var}', 'X.value'), array('X{.x,y}', 'X.1024.768'), array('{/var}', '/value'), array('{/var,x}/here', '/value/1024/here'), array('{;x,y}', ';x=1024;y=768'), array('{;x,y,empty}', ';x=1024;y=768;empty'), array('{?x,y}', '?x=1024&y=768'), array('{?x,y,empty}', '?x=1024&y=768&empty='), array('?fixed=yes{&x}', '?fixed=yes&x=1024'), array('{&x,y,empty}', '&x=1024&y=768&empty='), array('{var:3}', 'val'), array('{var:30}', 'value'), array('{list}', 'red,green,blue'), array('{list*}', 'red,green,blue'), array('{keys}', 'semi,%3B,dot,.,comma,%2C'), array('{keys*}', 'semi=%3B,dot=.,comma=%2C'), array('{+path:6}/here', '/foo/b/here'), array('{+list}', 'red,green,blue'), array('{+list*}', 'red,green,blue'), array('{+keys}', 'semi,;,dot,.,comma,,'), array('{+keys*}', 'semi=;,dot=.,comma=,'), array('{#path:6}/here', '#/foo/b/here'), array('{#list}', '#red,green,blue'), array('{#list*}', '#red,green,blue'), array('{#keys}', '#semi,;,dot,.,comma,,'), array('{#keys*}', '#semi=;,dot=.,comma=,'), array('X{.var:3}', 'X.val'), array('X{.list}', 'X.red,green,blue'), array('X{.list*}', 'X.red.green.blue'), array('X{.keys}', 'X.semi,%3B,dot,.,comma,%2C'), array('X{.keys*}', 'X.semi=%3B.dot=..comma=%2C'), array('{/var:1,var}', '/v/value'), array('{/list}', '/red,green,blue'), array('{/list*}', '/red/green/blue'), array('{/list*,path:4}', '/red/green/blue/%2Ffoo'), array('{/keys}', '/semi,%3B,dot,.,comma,%2C'), array('{/keys*}', '/semi=%3B/dot=./comma=%2C'), array('{;hello:5}', ';hello=Hello'), array('{;list}', ';list=red,green,blue'), array('{;list*}', ';list=red;list=green;list=blue'), array('{;keys}', ';keys=semi,%3B,dot,.,comma,%2C'), array('{;keys*}', ';semi=%3B;dot=.;comma=%2C'), array('{?var:3}', '?var=val'), array('{?list}', '?list=red,green,blue'), array('{?list*}', '?list=red&list=green&list=blue'), array('{?keys}', '?keys=semi,%3B,dot,.,comma,%2C'), array('{?keys*}', '?semi=%3B&dot=.&comma=%2C'), array('{&var:3}', '&var=val'), array('{&list}', '&list=red,green,blue'), array('{&list*}', '&list=red&list=green&list=blue'), array('{&keys}', '&keys=semi,%3B,dot,.,comma,%2C'), array('{&keys*}', '&semi=%3B&dot=.&comma=%2C'), array('{.null}', ''), array('{.null,var}', '.value'), array('X{.empty_keys*}', 'X'), array('X{.empty_keys}', 'X'), // Test that missing expansions are skipped array('test{&missing*}', 'test'), // Test that multiple expansions can be set array('http://{var}/{var:2}{?keys*}', 'http://value/va?semi=%3B&dot=.&comma=%2C'), // Test more complex query string stuff array('http://www.test.com{+path}{?var,keys*}', 'http://www.test.com/foo/bar?var=value&semi=%3B&dot=.&comma=%2C') )); } } tests/Guzzle/Tests/Parser/UriTemplate/PeclUriTemplateTest.php000064400000001273151742734620020405 0ustar00markTestSkipped('uri_template PECL extension must be installed to test PeclUriTemplate'); } } /** * @dataProvider templateProvider */ public function testExpandsUriTemplates($template, $expansion, $params) { $uri = new PeclUriTemplate($template); $this->assertEquals($expansion, $uri->expand($template, $params)); } } tests/Guzzle/Tests/Parser/UriTemplate/UriTemplateTest.php000064400000005611151742734620017601 0ustar00assertEquals($expansion, $uri->expand($template, $params)); } public function expressionProvider() { return array( array( '{+var*}', array( 'operator' => '+', 'values' => array( array('value' => 'var', 'modifier' => '*') ) ), ), array( '{?keys,var,val}', array( 'operator' => '?', 'values' => array( array('value' => 'keys', 'modifier' => ''), array('value' => 'var', 'modifier' => ''), array('value' => 'val', 'modifier' => '') ) ), ), array( '{+x,hello,y}', array( 'operator' => '+', 'values' => array( array('value' => 'x', 'modifier' => ''), array('value' => 'hello', 'modifier' => ''), array('value' => 'y', 'modifier' => '') ) ) ) ); } /** * @dataProvider expressionProvider */ public function testParsesExpressions($exp, $data) { $template = new UriTemplate($exp); // Access the config object $class = new \ReflectionClass($template); $method = $class->getMethod('parseExpression'); $method->setAccessible(true); $exp = substr($exp, 1, -1); $this->assertEquals($data, $method->invokeArgs($template, array($exp))); } /** * @ticket https://github.com/guzzle/guzzle/issues/90 */ public function testAllowsNestedArrayExpansion() { $template = new UriTemplate(); $result = $template->expand('http://example.com{+path}{/segments}{?query,data*,foo*}', array( 'path' => '/foo/bar', 'segments' => array('one', 'two'), 'query' => 'test', 'data' => array( 'more' => array('fun', 'ice cream') ), 'foo' => array( 'baz' => array( 'bar' => 'fizz', 'test' => 'buzz' ), 'bam' => 'boo' ) )); $this->assertEquals('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result); } } tests/Guzzle/Tests/Parser/Url/UrlParserProvider.php000064400000001474151742734620016452 0ustar00assertEquals($url, Url::buildUrl($parts)); } public function testCanUseUtf8Query() { $url = Url::factory('http://www.example.com?µ=a'); $this->assertEquals('a', $url->getQuery()->get('µ')); } public function testParsesUtf8UrlQueryStringsWithFragment() { $parser = new UrlParser(); $parser->setUtf8Support(true); $parts = $parser->parseUrl('http://www.example.com?ሴ=a#fragmentishere'); $this->assertEquals('ሴ=a', $parts['query']); $this->assertEquals('fragmentishere', $parts['fragment']); $parts = $parser->parseUrl('http://www.example.com?ሴ=a'); $this->assertEquals('ሴ=a', $parts['query']); $this->assertEquals('', $parts['fragment']); } } tests/Guzzle/Tests/Plugin/Async/AsyncPluginTest.php000064400000006156151742734620016433 0ustar00assertArrayHasKey('request.before_send', $events); $this->assertArrayHasKey('request.exception', $events); $this->assertArrayHasKey('curl.callback.progress', $events); } public function testEnablesProgressCallbacks() { $p = new AsyncPlugin(); $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com'); $event = new Event(array( 'request' => $request )); $p->onBeforeSend($event); $this->assertEquals(true, $request->getCurlOptions()->get('progress')); } public function testAddsTimesOutAfterSending() { $p = new AsyncPlugin(); $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com'); $handle = CurlHandle::factory($request); $event = new Event(array( 'request' => $request, 'handle' => $handle, 'uploaded' => 10, 'upload_size' => 10, 'downloaded' => 0 )); $p->onCurlProgress($event); $this->assertEquals(1, $handle->getOptions()->get(CURLOPT_TIMEOUT_MS)); $this->assertEquals(true, $handle->getOptions()->get(CURLOPT_NOBODY)); } public function testEnsuresRequestIsSet() { $p = new AsyncPlugin(); $event = new Event(array( 'uploaded' => 10, 'upload_size' => 10, 'downloaded' => 0 )); $p->onCurlProgress($event); } public function testMasksCurlExceptions() { $p = new AsyncPlugin(); $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com'); $e = new CurlException('Error'); $event = new Event(array( 'request' => $request, 'exception' => $e )); $p->onRequestTimeout($event); $this->assertEquals(RequestInterface::STATE_COMPLETE, $request->getState()); $this->assertEquals(200, $request->getResponse()->getStatusCode()); $this->assertTrue($request->getResponse()->hasHeader('X-Guzzle-Async')); } public function testEnsuresIntegration() { $this->getServer()->enqueue("HTTP/1.1 204 FOO\r\nContent-Length: 4\r\n\r\ntest"); $client = new Client($this->getServer()->getUrl()); $request = $client->post('/', null, array( 'foo' => 'bar' )); $request->getEventDispatcher()->addSubscriber(new AsyncPlugin()); $request->send(); $this->assertEquals('', $request->getResponse()->getBody(true)); $this->assertTrue($request->getResponse()->hasHeader('X-Guzzle-Async')); } } tests/Guzzle/Tests/Plugin/Backoff/AbstractBackoffStrategyTest.php000064400000006442151742734620021215 0ustar00getMockBuilder('Guzzle\Plugin\Backoff\AbstractBackoffStrategy') ->setMethods(array('getDelay', 'makesDecision')) ->getMockForAbstractClass(); } public function testReturnsZeroWhenNoNextAndGotNull() { $request = new Request('GET', 'http://www.foo.com'); $mock = $this->getMockStrategy(); $mock->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(null)); $this->assertEquals(0, $mock->getBackoffPeriod(0, $request)); } public function testReturnsFalse() { $request = new Request('GET', 'http://www.foo.com'); $mock = $this->getMockStrategy(); $mock->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(false)); $this->assertEquals(false, $mock->getBackoffPeriod(0, $request)); } public function testReturnsNextValueWhenNullOrTrue() { $request = new Request('GET', 'http://www.foo.com'); $mock = $this->getMockStrategy(); $mock->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(null)); $mock->expects($this->any())->method('makesDecision')->will($this->returnValue(false)); $mock2 = $this->getMockStrategy(); $mock2->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(10)); $mock2->expects($this->atLeastOnce())->method('makesDecision')->will($this->returnValue(true)); $mock->setNext($mock2); $this->assertEquals(10, $mock->getBackoffPeriod(0, $request)); } public function testReturnsFalseWhenNullAndNoNext() { $request = new Request('GET', 'http://www.foo.com'); $s = new TruncatedBackoffStrategy(2); $this->assertFalse($s->getBackoffPeriod(0, $request)); } public function testHasNext() { $a = new TruncatedBackoffStrategy(2); $b = new TruncatedBackoffStrategy(2); $a->setNext($b); $this->assertSame($b, $a->getNext()); } public function testSkipsOtherDecisionsInChainWhenOneReturnsTrue() { $a = new CallbackBackoffStrategy(function () { return null; }, true); $b = new CallbackBackoffStrategy(function () { return true; }, true); $c = new CallbackBackoffStrategy(function () { return null; }, true); $d = new CallbackBackoffStrategy(function () { return 10; }, false); $a->setNext($b); $b->setNext($c); $c->setNext($d); $this->assertEquals(10, $a->getBackoffPeriod(2, new Request('GET', 'http://www.foo.com'))); } public function testReturnsZeroWhenDecisionMakerReturnsTrueButNoFurtherStrategiesAreInTheChain() { $a = new CallbackBackoffStrategy(function () { return null; }, true); $b = new CallbackBackoffStrategy(function () { return true; }, true); $a->setNext($b); $this->assertSame(0, $a->getBackoffPeriod(2, new Request('GET', 'http://www.foo.com'))); } } tests/Guzzle/Tests/Plugin/Backoff/BackoffLoggerTest.php000064400000005735151742734620017152 0ustar00message = ''; } public function testHasEventList() { $this->assertEquals(1, count(BackoffLogger::getSubscribedEvents())); } public function testLogsEvents() { list($logPlugin, $request, $response) = $this->getMocks(); $response = $this->getMockBuilder('Guzzle\Http\Message\Response') ->setConstructorArgs(array(503)) ->setMethods(array('getInfo')) ->getMock(); $response->expects($this->any()) ->method('getInfo') ->will($this->returnValue(2)); $handle = $this->getMockHandle(); $event = new Event(array( 'request' => $request, 'response' => $response, 'retries' => 1, 'delay' => 3, 'handle' => $handle )); $logPlugin->onRequestRetry($event); $this->assertContains( '] PUT http://www.example.com - 503 Service Unavailable - Retries: 1, Delay: 3, Time: 2, 2, cURL: 30 Foo', $this->message ); } public function testCanSetTemplate() { $l = new BackoffLogger(new ClosureLogAdapter(function () {})); $l->setTemplate('foo'); $t = $this->readAttribute($l, 'formatter'); $this->assertEquals('foo', $this->readAttribute($t, 'template')); } /** * @return array */ protected function getMocks() { $that = $this; $logger = new ClosureLogAdapter(function ($message) use ($that) { $that->message .= $message . "\n"; }); $logPlugin = new BackoffLogger($logger); $response = new Response(503); $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com', array( 'Content-Length' => 3, 'Foo' => 'Bar' )); return array($logPlugin, $request, $response); } /** * @return CurlHandle */ protected function getMockHandle() { $handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle') ->disableOriginalConstructor() ->setMethods(array('getError', 'getErrorNo', 'getInfo')) ->getMock(); $handle->expects($this->once()) ->method('getError') ->will($this->returnValue('Foo')); $handle->expects($this->once()) ->method('getErrorNo') ->will($this->returnValue(30)); $handle->expects($this->any()) ->method('getInfo') ->will($this->returnValue(2)); return $handle; } } tests/Guzzle/Tests/Plugin/Backoff/BackoffPluginTest.php000064400000026700151742734620017164 0ustar00retried = false; } public static function getSubscribedEvents() { return array(BackoffPlugin::RETRY_EVENT => 'onRequestRetry'); } public function onRequestRetry(Event $event) { $this->retried = $event; } public function testHasEventList() { $this->assertEquals(1, count(BackoffPlugin::getAllEvents())); } public function testCreatesDefaultExponentialBackoffPlugin() { $plugin = BackoffPlugin::getExponentialBackoff(3, array(204), array(10)); $this->assertInstanceOf('Guzzle\Plugin\Backoff\BackoffPlugin', $plugin); $strategy = $this->readAttribute($plugin, 'strategy'); $this->assertInstanceOf('Guzzle\Plugin\Backoff\TruncatedBackoffStrategy', $strategy); $this->assertEquals(3, $this->readAttribute($strategy, 'max')); $strategy = $this->readAttribute($strategy, 'next'); $this->assertInstanceOf('Guzzle\Plugin\Backoff\HttpBackoffStrategy', $strategy); $this->assertEquals(array(204 => true), $this->readAttribute($strategy, 'errorCodes')); $strategy = $this->readAttribute($strategy, 'next'); $this->assertInstanceOf('Guzzle\Plugin\Backoff\CurlBackoffStrategy', $strategy); $this->assertEquals(array(10 => true), $this->readAttribute($strategy, 'errorCodes')); $strategy = $this->readAttribute($strategy, 'next'); $this->assertInstanceOf('Guzzle\Plugin\Backoff\ExponentialBackoffStrategy', $strategy); } public function testDoesNotRetryUnlessStrategyReturnsNumber() { $request = new Request('GET', 'http://www.example.com'); $request->setState('transfer'); $mock = $this->getMockBuilder('Guzzle\Plugin\Backoff\BackoffStrategyInterface') ->setMethods(array('getBackoffPeriod')) ->getMockForAbstractClass(); $mock->expects($this->once()) ->method('getBackoffPeriod') ->will($this->returnValue(false)); $plugin = new BackoffPlugin($mock); $plugin->addSubscriber($this); $plugin->onRequestSent(new Event(array('request' => $request))); $this->assertFalse($this->retried); } public function testUpdatesRequestForRetry() { $request = new Request('GET', 'http://www.example.com'); $request->setState('transfer'); $response = new Response(500); $handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle')->disableOriginalConstructor()->getMock(); $e = new CurlException(); $e->setCurlHandle($handle); $plugin = new BackoffPlugin(new ConstantBackoffStrategy(10)); $plugin->addSubscriber($this); $event = new Event(array( 'request' => $request, 'response' => $response, 'exception' => $e )); $plugin->onRequestSent($event); $this->assertEquals(array( 'request' => $request, 'response' => $response, 'handle' => $handle, 'retries' => 1, 'delay' => 10 ), $this->readAttribute($this->retried, 'context')); $plugin->onRequestSent($event); $this->assertEquals(array( 'request' => $request, 'response' => $response, 'handle' => $handle, 'retries' => 2, 'delay' => 10 ), $this->readAttribute($this->retried, 'context')); } public function testDoesNothingWhenNotRetryingAndPollingRequest() { $request = new Request('GET', 'http://www.foo.com'); $plugin = new BackoffPlugin(new ConstantBackoffStrategy(10)); $plugin->onRequestPoll(new Event(array('request' => $request))); } public function testRetriesRequests() { // Create a script to return several 500 and 503 response codes $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata" )); $plugin = new BackoffPlugin( new TruncatedBackoffStrategy(3, new HttpBackoffStrategy(null, new CurlBackoffStrategy(null, new ConstantBackoffStrategy(0.05) ) ) ) ); $client = new Client($this->getServer()->getUrl()); $client->getEventDispatcher()->addSubscriber($plugin); $request = $client->get(); $request->send(); // Make sure it eventually completed successfully $this->assertEquals(200, $request->getResponse()->getStatusCode()); $this->assertEquals('data', $request->getResponse()->getBody(true)); // Check that three requests were made to retry this request $this->assertEquals(3, count($this->getServer()->getReceivedRequests(false))); $this->assertEquals(2, $request->getParams()->get(BackoffPlugin::RETRY_PARAM)); } /** * @expectedException \Guzzle\Http\Exception\ServerErrorResponseException */ public function testFailsOnTruncation() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n" )); $plugin = new BackoffPlugin( new TruncatedBackoffStrategy(2, new HttpBackoffStrategy(null, new ConstantBackoffStrategy(0.05) ) ) ); $client = new Client($this->getServer()->getUrl()); $client->addSubscriber($plugin); $client->get()->send(); } public function testRetriesRequestsWhenInParallel() { // Create a script to return several 500 and 503 response codes $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata" )); $plugin = new BackoffPlugin( new HttpBackoffStrategy(null, new TruncatedBackoffStrategy(3, new CurlBackoffStrategy(null, new ConstantBackoffStrategy(0.1) ) ) ) ); $client = new Client($this->getServer()->getUrl()); $client->getEventDispatcher()->addSubscriber($plugin); $requests = array(); for ($i = 0; $i < 5; $i++) { $requests[] = $client->get(); } $client->send($requests); $this->assertEquals(15, count($this->getServer()->getReceivedRequests(false))); } /** * @covers Guzzle\Plugin\Backoff\BackoffPlugin * @covers Guzzle\Http\Curl\CurlMulti */ public function testRetriesPooledRequestsUsingDelayAndPollingEvent() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata" )); // Need to sleep for some time ensure that the polling works correctly in the observer $plugin = new BackoffPlugin(new HttpBackoffStrategy(null, new TruncatedBackoffStrategy(1, new ConstantBackoffStrategy(0.5)))); $client = new Client($this->getServer()->getUrl()); $client->getEventDispatcher()->addSubscriber($plugin); $request = $client->get(); $request->send(); // Make sure it eventually completed successfully $this->assertEquals('data', $request->getResponse()->getBody(true)); // Check that two requests were made to retry this request $this->assertEquals(2, count($this->getServer()->getReceivedRequests(false))); } public function testSeeksToBeginningOfRequestBodyWhenRetrying() { // Create a request with a body $request = new EntityEnclosingRequest('PUT', 'http://www.example.com'); $request->setBody('abc'); // Set the retry time to be something that will be retried always $request->getParams()->set(BackoffPlugin::DELAY_PARAM, 2); // Seek to the end of the stream $request->getBody()->seek(3); $this->assertEquals('', $request->getBody()->read(1)); // Create a plugin that does not delay when retrying $plugin = new BackoffPlugin(new ConstantBackoffStrategy(0)); $plugin->onRequestPoll($this->getMockEvent($request)); // Ensure that the stream was seeked to 0 $this->assertEquals('a', $request->getBody()->read(1)); } public function testDoesNotSeekOnRequestsWithNoBodyWhenRetrying() { // Create a request with a body $request = new EntityEnclosingRequest('PUT', 'http://www.example.com'); $request->getParams()->set(BackoffPlugin::DELAY_PARAM, 2); $plugin = new BackoffPlugin(new ConstantBackoffStrategy(0)); $plugin->onRequestPoll($this->getMockEvent($request)); } protected function getMockEvent(RequestInterface $request) { // Create a mock curl multi object $multi = $this->getMockBuilder('Guzzle\Http\Curl\CurlMulti') ->setMethods(array('remove', 'add')) ->getMock(); // Create an event that is expected for the Poll event $event = new Event(array( 'request' => $request, 'curl_multi' => $multi )); $event->setName(CurlMultiInterface::POLLING_REQUEST); return $event; } } tests/Guzzle/Tests/Plugin/Backoff/CallbackBackoffStrategyTest.php000064400000002111151742734620021133 0ustar00getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $strategy = new CallbackBackoffStrategy(function () { return 10; }, true); $this->assertTrue($strategy->makesDecision()); $this->assertEquals(10, $strategy->getBackoffPeriod(0, $request)); // Ensure it chains correctly when null is returned $strategy = new CallbackBackoffStrategy(function () { return null; }, false); $this->assertFalse($strategy->makesDecision()); $this->assertFalse($strategy->getBackoffPeriod(0, $request)); } } tests/Guzzle/Tests/Plugin/Backoff/ConstantBackoffStrategyTest.php000064400000001223151742734620021233 0ustar00assertFalse($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertEquals(3.5, $strategy->getBackoffPeriod(0, $request)); $this->assertEquals(3.5, $strategy->getBackoffPeriod(1, $request)); } } tests/Guzzle/Tests/Plugin/Backoff/CurlBackoffStrategyTest.php000064400000002542151742734620020354 0ustar00assertNotEmpty(CurlBackoffStrategy::getDefaultFailureCodes()); $strategy = new CurlBackoffStrategy(); $this->assertTrue($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $e = new CurlException(); $e->setError('foo', CURLE_BAD_CALLING_ORDER); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, null, $e)); foreach (CurlBackoffStrategy::getDefaultFailureCodes() as $code) { $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, null, $e->setError('foo', $code))); } } public function testIgnoresNonErrors() { $strategy = new CurlBackoffStrategy(); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, new Response(200))); } } tests/Guzzle/Tests/Plugin/Backoff/ExponentialBackoffStrategyTest.php000064400000001572151742734620021737 0ustar00assertFalse($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertEquals(1, $strategy->getBackoffPeriod(0, $request)); $this->assertEquals(2, $strategy->getBackoffPeriod(1, $request)); $this->assertEquals(4, $strategy->getBackoffPeriod(2, $request)); $this->assertEquals(8, $strategy->getBackoffPeriod(3, $request)); $this->assertEquals(16, $strategy->getBackoffPeriod(4, $request)); } } tests/Guzzle/Tests/Plugin/Backoff/HttpBackoffStrategyTest.php000064400000003462151742734620020370 0ustar00assertNotEmpty(HttpBackoffStrategy::getDefaultFailureCodes()); $strategy = new HttpBackoffStrategy(); $this->assertTrue($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $response = new Response(200); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response)); $response->setStatus(400); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response)); foreach (HttpBackoffStrategy::getDefaultFailureCodes() as $code) { $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, $response->setStatus($code))); } } public function testAllowsCustomCodes() { $strategy = new HttpBackoffStrategy(array(204)); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $response = new Response(204); $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, $response)); $response->setStatus(500); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response)); } public function testIgnoresNonErrors() { $strategy = new HttpBackoffStrategy(); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request)); } } tests/Guzzle/Tests/Plugin/Backoff/LinearBackoffStrategyTest.php000064400000001316151742734620020657 0ustar00assertFalse($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request)); $this->assertEquals(5, $strategy->getBackoffPeriod(1, $request)); $this->assertEquals(10, $strategy->getBackoffPeriod(2, $request)); } } tests/Guzzle/Tests/Plugin/Backoff/ReasonPhraseBackoffStrategyTest.php000064400000002374151742734620022044 0ustar00assertEmpty(ReasonPhraseBackoffStrategy::getDefaultFailureCodes()); $strategy = new ReasonPhraseBackoffStrategy(array('Foo', 'Internal Server Error')); $this->assertTrue($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $response = new Response(200); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response)); $response->setStatus(200, 'Foo'); $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, $response)); } public function testIgnoresNonErrors() { $strategy = new ReasonPhraseBackoffStrategy(); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request)); } } tests/Guzzle/Tests/Plugin/Backoff/TruncatedBackoffStrategyTest.php000064400000002321151742734620021373 0ustar00assertTrue($strategy->makesDecision()); $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false); $this->assertFalse($strategy->getBackoffPeriod(0, $request)); $this->assertFalse($strategy->getBackoffPeriod(1, $request)); $this->assertFalse($strategy->getBackoffPeriod(2, $request)); $response = new Response(500); $strategy->setNext(new HttpBackoffStrategy(null, new ConstantBackoffStrategy(10))); $this->assertEquals(10, $strategy->getBackoffPeriod(0, $request, $response)); $this->assertEquals(10, $strategy->getBackoffPeriod(1, $request, $response)); $this->assertFalse($strategy->getBackoffPeriod(2, $request, $response)); } } tests/Guzzle/Tests/Plugin/Cache/CachePluginTest.php000064400000056012151742734620016303 0ustar00assertInstanceOf('Guzzle\Plugin\Cache\CacheStorageInterface', $this->readAttribute($plugin, 'storage')); } public function testAddsDefaultCollaborators() { $this->assertNotEmpty(CachePlugin::getSubscribedEvents()); $plugin = new CachePlugin(array( 'storage' => $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass() )); $this->assertInstanceOf('Guzzle\Plugin\Cache\CacheStorageInterface', $this->readAttribute($plugin, 'storage')); $this->assertInstanceOf( 'Guzzle\Plugin\Cache\CacheKeyProviderInterface', $this->readAttribute($plugin, 'keyProvider') ); $this->assertInstanceOf( 'Guzzle\Plugin\Cache\CanCacheStrategyInterface', $this->readAttribute($plugin, 'canCache') ); $this->assertInstanceOf( 'Guzzle\Plugin\Cache\RevalidationInterface', $this->readAttribute($plugin, 'revalidation') ); } public function testAddsCallbackCollaborators() { $this->assertNotEmpty(CachePlugin::getSubscribedEvents()); $plugin = new CachePlugin(array( 'storage' => $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass(), 'can_cache' => function () {}, 'key_provider' => function () {} )); $this->assertInstanceOf( 'Guzzle\Plugin\Cache\CallbackCacheKeyProvider', $this->readAttribute($plugin, 'keyProvider') ); $this->assertInstanceOf( 'Guzzle\Plugin\Cache\CallbackCanCacheStrategy', $this->readAttribute($plugin, 'canCache') ); } public function testCanPassCacheAsOnlyArgumentToConstructor() { $p = new CachePlugin(new DoctrineCacheAdapter(new ArrayCache())); $p = new CachePlugin(new DefaultCacheStorage(new DoctrineCacheAdapter(new ArrayCache()))); } public function testUsesCreatedCacheStorage() { $plugin = new CachePlugin(array( 'adapter' => $this->getMockBuilder('Guzzle\Cache\CacheAdapterInterface')->getMockForAbstractClass() )); $this->assertInstanceOf('Guzzle\Plugin\Cache\CacheStorageInterface', $this->readAttribute($plugin, 'storage')); } public function testUsesProvidedOptions() { $can = $this->getMockBuilder('Guzzle\Plugin\Cache\CanCacheStrategyInterface')->getMockForAbstractClass(); $revalidate = $this->getMockBuilder('Guzzle\Plugin\Cache\RevalidationInterface')->getMockForAbstractClass(); $key = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheKeyProviderInterface')->getMockForAbstractClass(); $debugHeaders = false; $plugin = new CachePlugin(array( 'storage' => $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass(), 'can_cache' => $can, 'revalidation' => $revalidate, 'key_provider' => $key, 'debug_headers' => $debugHeaders, )); $this->assertSame($key, $this->readAttribute($plugin, 'keyProvider')); $this->assertSame($can, $this->readAttribute($plugin, 'canCache')); $this->assertSame($revalidate, $this->readAttribute($plugin, 'revalidation')); $this->assertSame($debugHeaders, $this->readAttribute($plugin, 'debugHeaders')); } public function satisfyProvider() { $req1 = new Request('GET', 'http://foo.com', array('Cache-Control' => 'no-cache')); $req2 = clone $req1; $req2->getParams()->set('cache.revalidate', 'skip'); $req3 = clone $req1; $req3->getParams()->set('cache.revalidate', 'never'); return array( // The response is too old to satisfy the request array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-age=20')), new Response(200, array('Age' => 100)), false, false), // The response cannot satisfy the request because it is stale array(new Request('GET', 'http://foo.com'), new Response(200, array('Cache-Control' => 'max-age=10', 'Age' => 100)), false, false), // Allows the expired response to satisfy the request because of the max-stale array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale=15')), new Response(200, array('Cache-Control' => 'max-age=90', 'Age' => 100)), true, false), // Max stale is > than the allowed staleness array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale=5')), new Response(200, array('Cache-Control' => 'max-age=90', 'Age' => 100)), false, false), // Performs cache revalidation array($req1, new Response(200), true, true), // Does not perform revalidation array($req2, new Response(200), true, false), // Does not perform revalidation and fails array($req3, new Response(200), false, false), ); } /** * @dataProvider satisfyProvider */ public function testChecksIfResponseCanSatisfyRequest($request, $response, $can, $revalidates) { $didRevalidate = false; $revalidate = $this->getMockBuilder('Guzzle\Plugin\Cache\RevalidationInterface') ->setMethods(array('revalidate')) ->getMockForAbstractClass(); $revalidate->expects($this->any()) ->method('revalidate') ->will($this->returnCallback(function () use (&$didRevalidate) { $didRevalidate = true; return true; })); $plugin = new CachePlugin(array( 'storage' => $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass(), 'revalidation' => $revalidate )); $this->assertEquals($can, $plugin->canResponseSatisfyRequest($request, $response)); $this->assertEquals($didRevalidate, $revalidates); } public function satisfyFailedProvider() { return array( // Neither has stale-if-error array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100)), false), // Request has stale-if-error array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50')), true), // Request has valid stale-if-error array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=50')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50')), true), // Request has expired stale-if-error array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=20')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50')), false), // Response has permanent stale-if-error array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error', )), true), // Response has valid stale-if-error array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=50')), true), // Response has expired stale-if-error array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=20')), false), // Request has valid stale-if-error but response does not array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=50')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=20')), false), // Response has valid stale-if-error but request does not array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=20')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=50')), false), ); } /** * @dataProvider satisfyFailedProvider */ public function testChecksIfResponseCanSatisfyFailedRequest($request, $response, $can) { $plugin = new CachePlugin(); $this->assertEquals($can, $plugin->canResponseSatisfyFailedRequest($request, $response)); } public function testDoesNothingWhenRequestIsNotCacheable() { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('fetch')) ->getMockForAbstractClass(); $storage->expects($this->never())->method('fetch'); $plugin = new CachePlugin(array( 'storage' => $storage, 'can_cache' => new CallbackCanCacheStrategy(function () { return false; }) )); $plugin->onRequestBeforeSend(new Event(array( 'request' => new Request('GET', 'http://foo.com') ))); } public function satisfiableProvider() { $date = new \DateTime('-10 seconds'); return array( // Fresh response adding debug headers array( true, array(200, array(), 'foo'), ), // Stale response adding debug headers array( true, array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5'), 'foo'), ), // Fresh response not adding debug headers array( false, array(200, array(), 'foo'), ), // Stale response not adding debug headers array( false, array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5'), 'foo'), ), ); } /** * @dataProvider satisfiableProvider */ public function testInjectsSatisfiableResponses($debugHeaders, $response) { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('fetch')) ->getMockForAbstractClass(); $storage->expects($this->once())->method('fetch')->will($this->returnValue($response)); $plugin = new CachePlugin(array('storage' => $storage, 'debug_headers' => $debugHeaders)); $request = new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale')); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $plugin->onRequestSent( new Event(array( 'request' => $request, 'response' => $request->getResponse(), )) ); $this->assertEquals($response[0], $request->getResponse()->getStatusCode()); $this->assertEquals($response[2], $request->getResponse()->getBody(true)); $this->assertContains('key=', (string) $request->getResponse()->getHeader('X-Guzzle-Cache')); $this->assertTrue($request->getResponse()->hasHeader('Age')); if ($request->getResponse()->isFresh() === false) { $this->assertContains('110', $request->getResponse()->getHeader('Warning', true)); } $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), $request->getHeader('Via', true)); $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), $request->getResponse()->getHeader('Via', true)); $this->assertTrue($request->getParams()->get('cache.lookup')); $this->assertTrue($request->getParams()->get('cache.hit')); if (!$debugHeaders) { $this->assertFalse($request->getResponse()->hasHeader('X-Cache-Lookup')); $this->assertFalse($request->getResponse()->hasHeader('X-Cache')); } else { $this->assertTrue($request->getResponse()->hasHeader('X-Cache-Lookup')); $this->assertTrue($request->getResponse()->hasHeader('X-Cache')); $this->assertEquals('HIT from GuzzleCache', $request->getResponse()->getHeader('X-Cache-Lookup', true)); $this->assertEquals('HIT from GuzzleCache', $request->getResponse()->getHeader('X-Cache', true)); } } public function satisfiableOnErrorProvider() { $date = new \DateTime('-10 seconds'); return array( // Adding debug headers array( true, array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error'), 'foo'), ), // Not adding debug headers array( false, array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error'), 'foo'), ), ); } /** * @dataProvider satisfiableOnErrorProvider */ public function testInjectsSatisfiableResponsesOnError($debugHeaders, $responseParts) { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('fetch')) ->getMockForAbstractClass(); $storage->expects($this->exactly(2))->method('fetch')->will($this->returnValue($responseParts)); $plugin = new CachePlugin(array('storage' => $storage, 'debug_headers' => $debugHeaders)); $request = new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale')); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $plugin->onRequestError( $event = new Event(array( 'request' => $request, 'response' => $request->getResponse(), )) ); $response = $event['response']; $this->assertEquals($responseParts[0], $response->getStatusCode()); $this->assertEquals($responseParts[2], $response->getBody(true)); $this->assertContains('key=', (string) $response->getHeader('X-Guzzle-Cache')); $this->assertTrue($response->hasHeader('Age')); if ($response->isFresh() === false) { $this->assertContains('110', $response->getHeader('Warning', true)); } $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), $request->getHeader('Via', true)); $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), $response->getHeader('Via', true)); $this->assertTrue($request->getParams()->get('cache.lookup')); $this->assertSame('error', $request->getParams()->get('cache.hit')); if (!$debugHeaders) { $this->assertFalse($response->hasHeader('X-Cache-Lookup')); $this->assertFalse($response->hasHeader('X-Cache')); } else { $this->assertTrue($response->hasHeader('X-Cache-Lookup')); $this->assertTrue($response->hasHeader('X-Cache')); $this->assertEquals('HIT from GuzzleCache', $response->getHeader('X-Cache-Lookup', true)); $this->assertEquals('HIT_ERROR from GuzzleCache', $response->getHeader('X-Cache', true)); } } /** * @dataProvider satisfiableOnErrorProvider */ public function testInjectsSatisfiableResponsesOnException($debugHeaders, $responseParts) { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('fetch')) ->getMockForAbstractClass(); $storage->expects($this->exactly(2))->method('fetch')->will($this->returnValue($responseParts)); $plugin = new CachePlugin(array('storage' => $storage, 'debug_headers' => $debugHeaders)); $request = new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale')); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $plugin->onRequestException( new Event(array( 'request' => $request, 'response' => $request->getResponse(), 'exception' => $this->getMock('Guzzle\Http\Exception\CurlException'), )) ); $plugin->onRequestSent( new Event(array( 'request' => $request, 'response' => $response = $request->getResponse(), )) ); $this->assertEquals($responseParts[0], $response->getStatusCode()); $this->assertEquals($responseParts[2], $response->getBody(true)); $this->assertContains('key=', (string) $response->getHeader('X-Guzzle-Cache')); $this->assertTrue($response->hasHeader('Age')); if ($response->isFresh() === false) { $this->assertContains('110', $response->getHeader('Warning', true)); } $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), $request->getHeader('Via', true)); $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), $response->getHeader('Via', true)); $this->assertTrue($request->getParams()->get('cache.lookup')); $this->assertSame('error', $request->getParams()->get('cache.hit')); if (!$debugHeaders) { $this->assertFalse($response->hasHeader('X-Cache-Lookup')); $this->assertFalse($response->hasHeader('X-Cache')); } else { $this->assertTrue($response->hasHeader('X-Cache-Lookup')); $this->assertTrue($response->hasHeader('X-Cache')); $this->assertEquals('HIT from GuzzleCache', $response->getHeader('X-Cache-Lookup', true)); $this->assertEquals('HIT_ERROR from GuzzleCache', $response->getHeader('X-Cache', true)); } } public function unsatisfiableOnErrorProvider() { $date = new \DateTime('-10 seconds'); return array( // no-store on request array( false, array('Cache-Control' => 'no-store'), array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error'), 'foo'), ), // request expired array( true, array('Cache-Control' => 'stale-if-error=4'), array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error'), 'foo'), ), // response expired array( true, array('Cache-Control' => 'stale-if-error'), array(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error=4'), 'foo'), ), ); } /** * @dataProvider unsatisfiableOnErrorProvider */ public function testDoesNotInjectUnsatisfiableResponsesOnError($requestCanCache, $requestHeaders, $responseParts) { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('fetch')) ->getMockForAbstractClass(); $storage->expects($this->exactly($requestCanCache ? 2 : 0))->method('fetch')->will($this->returnValue($responseParts)); $plugin = new CachePlugin(array('storage' => $storage)); $request = new Request('GET', 'http://foo.com', $requestHeaders); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $plugin->onRequestError( $event = new Event(array( 'request' => $request, 'response' => $response = $request->getResponse(), )) ); $this->assertSame($response, $event['response']); } /** * @dataProvider unsatisfiableOnErrorProvider */ public function testDoesNotInjectUnsatisfiableResponsesOnException($requestCanCache, $requestHeaders, $responseParts) { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('fetch')) ->getMockForAbstractClass(); $storage->expects($this->exactly($requestCanCache ? 2 : 0))->method('fetch')->will($this->returnValue($responseParts)); $plugin = new CachePlugin(array('storage' => $storage)); $request = new Request('GET', 'http://foo.com', $requestHeaders); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $plugin->onRequestException( $event = new Event(array( 'request' => $request, 'response' => $response = $request->getResponse(), 'exception' => $this->getMock('Guzzle\Http\Exception\CurlException'), )) ); $this->assertSame($response, $request->getResponse()); } public function testCachesResponsesWhenCacheable() { $cache = new ArrayCache(); $adapter = new DoctrineCacheAdapter($cache); $plugin = new CachePlugin(array('adapter' => $adapter)); $request = new Request('GET', 'http://foo.com'); $response = new Response(200, array(), 'Foo'); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $plugin->onRequestSent(new Event(array( 'request' => $request, 'response' => $response ))); $data = $this->readAttribute($cache, 'data'); $this->assertNotEmpty($data); $data = end($data); $this->assertEquals(200, $data[0]); $this->assertInternalType('array', $data[1]); $this->assertEquals('Foo', $data[2]); } public function testPurgesRequests() { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('delete')) ->getMockForAbstractClass(); $storage->expects($this->exactly(5)) ->method('delete'); $plugin = new CachePlugin(array('storage' => $storage)); $request = new Request('GET', 'http://foo.com', array('X-Foo' => 'Bar')); $plugin->purge($request); } public function testPurgesRequestsWithCustomMethods() { $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface') ->setMethods(array('delete')) ->getMockForAbstractClass(); $storage->expects($this->exactly(2)) ->method('delete'); $plugin = new CachePlugin(array('storage' => $storage)); $request = new Request('GET', 'http://foo.com', array('X-Foo' => 'Bar')); $request->getParams()->set('cache.purge_methods', array('FOO', 'BAR')); $plugin->purge($request); } } tests/Guzzle/Tests/Plugin/Cache/CallbackCacheKeyProviderTest.php000064400000001324151742734620020721 0ustar00assertEquals('foo', $p->getCacheKey(new Request('GET', 'http://www.foo.com'))); } } tests/Guzzle/Tests/Plugin/Cache/CallbackCanCacheStrategyTest.php000064400000005121151742734620020701 0ustar00assertTrue($c->canCacheRequest(new Request('DELETE', 'http://www.foo.com'))); } /** * The following is a bit of an integration test to ensure that the CachePlugin honors a * custom can cache strategy. */ public function testIntegrationWithCachePlugin() { $c = new CallbackCanCacheStrategy( function ($request) { return true; }, function ($response) { return true; } ); // Make a request and response that have no business being cached $request = new Request('DELETE', 'http://www.foo.com'); $response = Response::fromMessage( "HTTP/1.1 200 OK\r\n" . "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n" . "Last-Modified: Wed, 09 Jan 2013 08:48:53 GMT\r\n" . "Content-Length: 2\r\n" . "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n\r\n" . "hi" ); $this->assertTrue($c->canCacheRequest($request)); $this->assertTrue($c->canCacheResponse($response)); $s = $this->getMockBuilder('Guzzle\Plugin\Cache\DefaultCacheStorage') ->setConstructorArgs(array(new DoctrineCacheAdapter(new ArrayCache()))) ->setMethods(array('fetch')) ->getMockForAbstractClass(); $s->expects($this->once()) ->method('fetch') ->will($this->returnValue( array(200, $response->getHeaders(), $response->getBody(true)) )); $plugin = new CachePlugin(array('can_cache' => $c, 'storage' => $s)); $plugin->onRequestBeforeSend(new Event(array('request' => $request))); $this->assertEquals(200, $request->getResponse()->getStatusCode()); $this->assertEquals('hi', $request->getResponse()->getBody(true)); } } tests/Guzzle/Tests/Plugin/Cache/DefaultCacheKeyProviderTest.php000064400000002622151742734620020613 0ustar00assertNotEmpty($provider->getCacheKey($request)); $this->assertNotEmpty($request->getParams()->get(DefaultCacheKeyProvider::CACHE_KEY)); $this->assertEquals((string) $request, $request->getParams()->get(DefaultCacheKeyProvider::CACHE_KEY_RAW)); } public function testFiltersCacheKey() { $request = new Request('GET', 'http://foo.com?a=b&c=d', array( 'Abc' => '123', 'Def' => '456' )); $request->getParams()->set(DefaultCacheKeyProvider::CACHE_KEY_FILTER, 'header=Def; query=c'); $provider = new DefaultCacheKeyProvider(); $provider->getCacheKey($request); $this->assertNotEmpty($request->getParams()->get(DefaultCacheKeyProvider::CACHE_KEY)); $cloned = clone $request; $cloned->getQuery()->remove('c'); $cloned->removeHeader('Def'); $this->assertEquals((string) $cloned, $request->getParams()->get(DefaultCacheKeyProvider::CACHE_KEY_RAW)); } } tests/Guzzle/Tests/Plugin/Cache/DefaultCacheStorageTest.php000064400000004101151742734620017746 0ustar00save('foo', '123'); $c = new DoctrineCacheAdapter($a); $s = new DefaultCacheStorage($c, 100); $this->assertEquals('123', $s->fetch('foo')); $s->delete('foo'); $this->assertNotEquals('123', $s->fetch('foo')); } public function testStoresResponsesWithDefaultTtl() { $c = $this->getMockBuilder('Guzzle\Cache\CacheAdapterInterface') ->setMethods(array('save')) ->getMockForAbstractClass(); $c->expects($this->once()) ->method('save') ->with('foo', array(200, array( 'foo' => array('bar'), 'X-Guzzle-Cache' => array('key=foo; ttl=100'), 'Date' => array('test') ), 'baz'), 100); $s = new DefaultCacheStorage($c, 100); $response = new Response(200, array('foo' => 'bar', 'Date' => 'test'), 'baz'); $s->cache('foo', $response); } public function testStoresResponsesWithCustomTtl() { $c = $this->getMockBuilder('Guzzle\Cache\CacheAdapterInterface') ->setMethods(array('save')) ->getMockForAbstractClass(); $that = $this; $c->expects($this->once()) ->method('save') ->will($this->returnCallback(function ($a, $b, $c) use ($that) { $that->assertArrayHasKey('Date', $b[1]); $that->assertFalse(array_key_exists('Connection', $b[1])); $that->assertEquals(50, $c); })); $s = new DefaultCacheStorage($c, 100); $response = new Response(200, array('foo' => 'bar', 'Connection' => 'close'), 'baz'); $s->cache('foo', $response, 50); } } tests/Guzzle/Tests/Plugin/Cache/DefaultCanCacheStrategyTest.php000064400000001431151742734620020571 0ustar00getMockBuilder('Guzzle\Http\Message\Request') ->disableOriginalConstructor() ->setMethods(array('canCache')) ->getMock(); $response->expects($this->once()) ->method('canCache') ->will($this->returnValue(true)); $this->assertTrue($strategy->canCacheRequest($response)); } } tests/Guzzle/Tests/Plugin/Cache/DefaultRevalidationTest.php000064400000017026151742734620020051 0ustar00getHttpDate('-100 hours') . "\r\nContent-Length: 4\r\n\r\nData", "HTTP/1.1 304 NOT MODIFIED\r\nCache-Control: max-age=2000000\r\nContent-Length: 0\r\n\r\n", ), // Forces revalidation that overwrites what is in cache array( false, "\r\n", "HTTP/1.1 200 OK\r\nCache-Control: must-revalidate, no-cache\r\nDate: " . $this->getHttpDate('-10 hours') . "\r\nContent-Length: 4\r\n\r\nData", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nDatas", "HTTP/1.1 200 OK\r\nContent-Length: 5\r\nDate: " . $this->getHttpDate('now') . "\r\n\r\nDatas" ), // Must get a fresh copy because the request is declining revalidation array( false, "\r\n", "HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nDate: " . $this->getHttpDate('-3 hours') . "\r\nContent-Length: 4\r\n\r\nData", null, null, 'never' ), // Skips revalidation because the request is accepting the cached copy array( true, "\r\n", "HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nDate: " . $this->getHttpDate('-3 hours') . "\r\nContent-Length: 4\r\n\r\nData", null, null, 'skip' ), // Throws an exception during revalidation array( false, "\r\n", "HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nDate: " . $this->getHttpDate('-3 hours') . "\r\n\r\nData", "HTTP/1.1 500 INTERNAL SERVER ERROR\r\nContent-Length: 0\r\n\r\n" ), // ETag mismatch array( false, "\r\n", "HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nETag: \"123\"\r\nDate: " . $this->getHttpDate('-10 hours') . "\r\n\r\nData", "HTTP/1.1 304 NOT MODIFIED\r\nETag: \"123456\"\r\n\r\n", ), ); } /** * @dataProvider cacheRevalidationDataProvider */ public function testRevalidatesResponsesAgainstOriginServer($can, $request, $response, $validate = null, $result = null, $param = null) { // Send some responses to the test server for cache validation $server = $this->getServer(); $server->flush(); if ($validate) { $server->enqueue($validate); } $request = RequestFactory::getInstance()->fromMessage("GET / HTTP/1.1\r\nHost: 127.0.0.1:" . $server->getPort() . "\r\n" . $request); $response = Response::fromMessage($response); $request->setClient(new Client()); if ($param) { $request->getParams()->set('cache.revalidate', $param); } $plugin = new CachePlugin(new DoctrineCacheAdapter(new ArrayCache())); $this->assertEquals($can, $plugin->canResponseSatisfyRequest($request, $response), '-> ' . $request . "\n" . $response); if ($result) { $result = Response::fromMessage($result); // Get rid of the X-Guzzle-Cache header $this->assertTrue($request->getResponse()->hasHeader('X-Guzzle-Cache')); $result->removeHeader('X-Guzzle-Cache'); $request->getResponse()->removeHeader('X-Guzzle-Cache'); // Get rid of dates $this->assertTrue($result->hasHeader('Date')); $this->assertTrue($request->getResponse()->hasHeader('Date')); $result->removeHeader('Date'); $request->getResponse()->removeHeader('Date'); // Get rid of dates $this->assertEquals((string) $result, (string) $request->getResponse()); } if ($validate) { $this->assertEquals(1, count($server->getReceivedRequests())); } } public function testHandles404RevalidationResponses() { $request = new Request('GET', 'http://foo.com'); $request->setClient(new Client()); $badResponse = new Response(404, array(), 'Oh no!'); $badRequest = clone $request; $badRequest->setResponse($badResponse, true); $response = new Response(200, array(), 'foo'); $plugin = new CachePlugin(); $c = new ArrayCache(); $c->save('foo', array(200, array(), 'foo')); $s = new DefaultCacheStorage(new DoctrineCacheAdapter($c)); $k = new CallbackCacheKeyProvider(function () { return 'foo'; }); $rev = $this->getMockBuilder('Guzzle\Plugin\Cache\DefaultRevalidation') ->setConstructorArgs(array($k, $s, $plugin)) ->setMethods(array('createRevalidationRequest')) ->getMock(); $rev->expects($this->once()) ->method('createRevalidationRequest') ->will($this->returnValue($badRequest)); try { $rev->revalidate($request, $response); $this->fail('Should have thrown an exception'); } catch (BadResponseException $e) { $this->assertSame($badResponse, $e->getResponse()); $this->assertFalse($c->fetch('foo')); } } public function testCanRevalidateWithPlugin() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\n" . "Date: Mon, 12 Nov 2012 03:06:37 GMT\r\n" . "Cache-Control: private, s-maxage=0, max-age=0, must-revalidate\r\n" . "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" . "Content-Length: 2\r\n\r\nhi", "HTTP/1.0 304 Not Modified\r\n" . "Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" . "Age: 6302\r\n\r\n", "HTTP/1.0 304 Not Modified\r\n" . "Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" . "Age: 6302\r\n\r\n", )); $client = new Client($this->getServer()->getUrl()); $client->addSubscriber(new CachePlugin()); $this->assertEquals(200, $client->get()->send()->getStatusCode()); $this->assertEquals(200, $client->get()->send()->getStatusCode()); $this->assertEquals(200, $client->get()->send()->getStatusCode()); $this->assertEquals(3, count($this->getServer()->getReceivedRequests())); } } tests/Guzzle/Tests/Plugin/Cache/DenyRevalidationTest.php000064400000000747151742734620017366 0ustar00assertFalse($deny->revalidate(new Request('GET', 'http://foo.com'), new Response(200))); } } tests/Guzzle/Tests/Plugin/Cache/SkipRevalidationTest.php000064400000000745151742734620017373 0ustar00assertTrue($skip->revalidate(new Request('GET', 'http://foo.com'), new Response(200))); } } tests/Guzzle/Tests/Plugin/Cookie/CookieJar/ArrayCookieJarTest.php000064400000030547151742734620021047 0ustar00jar = new ArrayCookieJar(); } protected function getTestCookies() { return array( new Cookie(array('name' => 'foo', 'value' => 'bar', 'domain' => 'foo.com', 'path' => '/', 'discard' => true)), new Cookie(array('name' => 'test', 'value' => '123', 'domain' => 'baz.com', 'path' => '/foo', 'expires' => 2)), new Cookie(array('name' => 'you', 'value' => '123', 'domain' => 'bar.com', 'path' => '/boo', 'expires' => time() + 1000)) ); } /** * Provides test data for cookie cookieJar retrieval */ public function getCookiesDataProvider() { return array( array(array('foo', 'baz', 'test', 'muppet', 'googoo'), '', '', '', false), array(array('foo', 'baz', 'muppet', 'googoo'), '', '', '', true), array(array('googoo'), 'www.example.com', '', '', false), array(array('muppet', 'googoo'), 'test.y.example.com', '', '', false), array(array('foo', 'baz'), 'example.com', '', '', false), array(array('muppet'), 'x.y.example.com', '/acme/', '', false), array(array('muppet'), 'x.y.example.com', '/acme/test/', '', false), array(array('googoo'), 'x.y.example.com', '/test/acme/test/', '', false), array(array('foo', 'baz'), 'example.com', '', '', false), array(array('baz'), 'example.com', '', 'baz', false), ); } public function testStoresAndRetrievesCookies() { $cookies = $this->getTestCookies(); foreach ($cookies as $cookie) { $this->assertTrue($this->jar->add($cookie)); } $this->assertEquals(3, count($this->jar)); $this->assertEquals(3, count($this->jar->getIterator())); $this->assertEquals($cookies, $this->jar->all(null, null, null, false, false)); } public function testRemovesExpiredCookies() { $cookies = $this->getTestCookies(); foreach ($this->getTestCookies() as $cookie) { $this->jar->add($cookie); } $this->jar->removeExpired(); $this->assertEquals(array($cookies[0], $cookies[2]), $this->jar->all()); } public function testRemovesTemporaryCookies() { $cookies = $this->getTestCookies(); foreach ($this->getTestCookies() as $cookie) { $this->jar->add($cookie); } $this->jar->removeTemporary(); $this->assertEquals(array($cookies[2]), $this->jar->all()); } public function testIsSerializable() { $this->assertEquals('[]', $this->jar->serialize()); $this->jar->unserialize('[]'); $this->assertEquals(array(), $this->jar->all()); $cookies = $this->getTestCookies(); foreach ($this->getTestCookies() as $cookie) { $this->jar->add($cookie); } // Remove discard and expired cookies $serialized = $this->jar->serialize(); $data = json_decode($serialized, true); $this->assertEquals(1, count($data)); $a = new ArrayCookieJar(); $a->unserialize($serialized); $this->assertEquals(1, count($a)); } public function testRemovesSelectively() { $cookies = $this->getTestCookies(); foreach ($this->getTestCookies() as $cookie) { $this->jar->add($cookie); } // Remove foo.com cookies $this->jar->remove('foo.com'); $this->assertEquals(2, count($this->jar)); // Try again, removing no further cookies $this->jar->remove('foo.com'); $this->assertEquals(2, count($this->jar)); // Remove bar.com cookies with path of /boo $this->jar->remove('bar.com', '/boo'); $this->assertEquals(1, count($this->jar)); // Remove cookie by name $this->jar->remove(null, null, 'test'); $this->assertEquals(0, count($this->jar)); } public function testDoesNotAddIncompleteCookies() { $this->assertEquals(false, $this->jar->add(new Cookie())); $this->assertFalse($this->jar->add(new Cookie(array( 'name' => 'foo' )))); $this->assertFalse($this->jar->add(new Cookie(array( 'name' => false )))); $this->assertFalse($this->jar->add(new Cookie(array( 'name' => true )))); $this->assertFalse($this->jar->add(new Cookie(array( 'name' => 'foo', 'domain' => 'foo.com' )))); } public function testDoesAddValidCookies() { $this->assertTrue($this->jar->add(new Cookie(array( 'name' => 'foo', 'domain' => 'foo.com', 'value' => 0 )))); $this->assertTrue($this->jar->add(new Cookie(array( 'name' => 'foo', 'domain' => 'foo.com', 'value' => 0.0 )))); $this->assertTrue($this->jar->add(new Cookie(array( 'name' => 'foo', 'domain' => 'foo.com', 'value' => '0' )))); } public function testOverwritesCookiesThatAreOlderOrDiscardable() { $t = time() + 1000; $data = array( 'name' => 'foo', 'value' => 'bar', 'domain' => '.example.com', 'path' => '/', 'max_age' => '86400', 'port' => array(80, 8080), 'version' => '1', 'secure' => true, 'discard' => true, 'expires' => $t ); // Make sure that the discard cookie is overridden with the non-discard $this->assertTrue($this->jar->add(new Cookie($data))); unset($data['discard']); $this->assertTrue($this->jar->add(new Cookie($data))); $this->assertEquals(1, count($this->jar)); $c = $this->jar->all(); $this->assertEquals(false, $c[0]->getDiscard()); // Make sure it doesn't duplicate the cookie $this->jar->add(new Cookie($data)); $this->assertEquals(1, count($this->jar)); // Make sure the more future-ful expiration date supersede the other $data['expires'] = time() + 2000; $this->assertTrue($this->jar->add(new Cookie($data))); $this->assertEquals(1, count($this->jar)); $c = $this->jar->all(); $this->assertNotEquals($t, $c[0]->getExpires()); } public function testOverwritesCookiesThatHaveChanged() { $t = time() + 1000; $data = array( 'name' => 'foo', 'value' => 'bar', 'domain' => '.example.com', 'path' => '/', 'max_age' => '86400', 'port' => array(80, 8080), 'version' => '1', 'secure' => true, 'discard' => true, 'expires' => $t ); // Make sure that the discard cookie is overridden with the non-discard $this->assertTrue($this->jar->add(new Cookie($data))); $data['value'] = 'boo'; $this->assertTrue($this->jar->add(new Cookie($data))); $this->assertEquals(1, count($this->jar)); // Changing the value plus a parameter also must overwrite the existing one $data['value'] = 'zoo'; $data['secure'] = false; $this->assertTrue($this->jar->add(new Cookie($data))); $this->assertEquals(1, count($this->jar)); $c = $this->jar->all(); $this->assertEquals('zoo', $c[0]->getValue()); } public function testAddsCookiesFromResponseWithNoRequest() { $response = new Response(200, array( 'Set-Cookie' => array( "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT; path=/; domain=127.0.0.1", "FPCK3=AgBNbvoQAGpGEABZLRAAbFsQAF1tEABkDhAAeO0=; expires=Sat, 02-Apr-2019 02:17:40 GMT; path=/; domain=127.0.0.1", "CH=deleted; expires=Wed, 03-Mar-2010 02:17:39 GMT; path=/; domain=127.0.0.1", "CH=AgBNbvoQAAEcEAApuhAAMJcQADQvEAAvGxAALe0QAD6uEAATwhAAC1AQAC8t; expires=Sat, 02-Apr-2019 02:17:40 GMT; path=/; domain=127.0.0.1" ) )); $this->jar->addCookiesFromResponse($response); $this->assertEquals(3, count($this->jar)); $this->assertEquals(1, count($this->jar->all(null, null, 'fpc'))); $this->assertEquals(1, count($this->jar->all(null, null, 'FPCK3'))); $this->assertEquals(1, count($this->jar->all(null, null, 'CH'))); } public function testAddsCookiesFromResponseWithRequest() { $response = new Response(200, array( 'Set-Cookie' => "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT;" )); $response->setRequest(new Request('GET', 'http://www.example.com')); $this->jar->addCookiesFromResponse($response); $this->assertEquals(1, count($this->jar)); } public function getMatchingCookiesDataProvider() { return array( array('https://example.com', array(0)), array('http://example.com', array()), array('https://example.com:8912', array()), array('https://foo.example.com', array()), array('http://foo.example.com/test/acme/', array(4)) ); } /** * @dataProvider getMatchingCookiesDataProvider */ public function testReturnsCookiesMatchingRequests($url, $cookies) { $bag = array( new Cookie(array( 'name' => 'foo', 'value' => 'bar', 'domain' => 'example.com', 'path' => '/', 'max_age' => '86400', 'port' => array(443, 8080), 'version' => '1', 'secure' => true )), new Cookie(array( 'name' => 'baz', 'value' => 'foobar', 'domain' => 'example.com', 'path' => '/', 'max_age' => '86400', 'port' => array(80, 8080), 'version' => '1', 'secure' => true )), new Cookie(array( 'name' => 'test', 'value' => '123', 'domain' => 'www.foobar.com', 'path' => '/path/', 'discard' => true )), new Cookie(array( 'name' => 'muppet', 'value' => 'cookie_monster', 'domain' => '.y.example.com', 'path' => '/acme/', 'comment' => 'Comment goes here...', 'expires' => time() + 86400 )), new Cookie(array( 'name' => 'googoo', 'value' => 'gaga', 'domain' => '.example.com', 'path' => '/test/acme/', 'max_age' => 1500, 'version' => 2 )) ); foreach ($bag as $cookie) { $this->jar->add($cookie); } $request = new Request('GET', $url); $results = $this->jar->getMatchingCookies($request); $this->assertEquals(count($results), count($cookies)); foreach ($cookies as $i) { $this->assertContains($bag[$i], $results); } } /** * @expectedException \Guzzle\Plugin\Cookie\Exception\InvalidCookieException * @expectedExceptionMessage The cookie name must not contain invalid characters: abc:@123 */ public function testThrowsExceptionWithStrictMode() { $a = new ArrayCookieJar(); $a->setStrictMode(true); $a->add(new Cookie(array( 'name' => 'abc:@123', 'value' => 'foo', 'domain' => 'bar' ))); } } tests/Guzzle/Tests/Plugin/Cookie/CookieJar/FileCookieJarTest.php000064400000003151151742734620020637 0ustar00file = tempnam('/tmp', 'file-cookies'); } public function testLoadsFromFileFile() { $jar = new FileCookieJar($this->file); $this->assertEquals(array(), $jar->all()); unlink($this->file); } public function testPersistsToFileFile() { $jar = new FileCookieJar($this->file); $jar->add(new Cookie(array( 'name' => 'foo', 'value' => 'bar', 'domain' => 'foo.com', 'expires' => time() + 1000 ))); $jar->add(new Cookie(array( 'name' => 'baz', 'value' => 'bar', 'domain' => 'foo.com', 'expires' => time() + 1000 ))); $jar->add(new Cookie(array( 'name' => 'boo', 'value' => 'bar', 'domain' => 'foo.com', ))); $this->assertEquals(3, count($jar)); unset($jar); // Make sure it wrote to the file $contents = file_get_contents($this->file); $this->assertNotEmpty($contents); // Load the cookieJar from the file $jar = new FileCookieJar($this->file); // Weeds out temporary and session cookies $this->assertEquals(2, count($jar)); unset($jar); unlink($this->file); } } tests/Guzzle/Tests/Plugin/Cookie/CookiePluginTest.php000064400000010073151742734620016714 0ustar00getMockBuilder('Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar') ->setMethods(array('addCookiesFromResponse')) ->getMock(); $mock->expects($this->exactly(1)) ->method('addCookiesFromResponse') ->with($response); $plugin = new CookiePlugin($mock); $plugin->onRequestSent(new Event(array( 'response' => $response ))); } public function testAddsCookiesToRequests() { $cookie = new Cookie(array( 'name' => 'foo', 'value' => 'bar' )); $mock = $this->getMockBuilder('Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar') ->setMethods(array('getMatchingCookies')) ->getMock(); $mock->expects($this->once()) ->method('getMatchingCookies') ->will($this->returnValue(array($cookie))); $plugin = new CookiePlugin($mock); $client = new Client(); $client->getEventDispatcher()->addSubscriber($plugin); $request = $client->get('http://www.example.com'); $plugin->onRequestBeforeSend(new Event(array( 'request' => $request ))); $this->assertEquals('bar', $request->getCookie('foo')); } public function testCookiesAreExtractedFromRedirectResponses() { $plugin = new CookiePlugin(new ArrayCookieJar()); $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 302 Moved Temporarily\r\n" . "Set-Cookie: test=583551; expires=Wednesday, 23-Mar-2050 19:49:45 GMT; path=/\r\n" . "Location: /redirect\r\n\r\n", "HTTP/1.1 200 OK\r\n" . "Content-Length: 0\r\n\r\n", "HTTP/1.1 200 OK\r\n" . "Content-Length: 0\r\n\r\n" )); $client = new Client($this->getServer()->getUrl()); $client->getEventDispatcher()->addSubscriber($plugin); $client->get()->send(); $request = $client->get(); $request->send(); $this->assertEquals('test=583551', $request->getHeader('Cookie')); $requests = $this->getServer()->getReceivedRequests(true); // Confirm subsequent requests have the cookie. $this->assertEquals('test=583551', $requests[2]->getHeader('Cookie')); // Confirm the redirected request has the cookie. $this->assertEquals('test=583551', $requests[1]->getHeader('Cookie')); } public function testCookiesAreNotAddedWhenParamIsSet() { $jar = new ArrayCookieJar(); $plugin = new CookiePlugin($jar); $jar->add(new Cookie(array( 'domain' => 'example.com', 'path' => '/', 'name' => 'test', 'value' => 'hi', 'expires' => time() + 3600 ))); $client = new Client('http://example.com'); $client->getEventDispatcher()->addSubscriber($plugin); // Ensure that it is normally added $request = $client->get(); $request->setResponse(new Response(200), true); $request->send(); $this->assertEquals('hi', $request->getCookie('test')); // Now ensure that it is not added $request = $client->get(); $request->getParams()->set('cookies.disable', true); $request->setResponse(new Response(200), true); $request->send(); $this->assertNull($request->getCookie('test')); } public function testProvidesCookieJar() { $jar = new ArrayCookieJar(); $plugin = new CookiePlugin($jar); $this->assertSame($jar, $plugin->getCookieJar()); } } tests/Guzzle/Tests/Plugin/Cookie/CookieTest.php000064400000015636151742734620015547 0ustar00assertEquals('/', $cookie->getPath()); $this->assertEquals(array(), $cookie->getPorts()); } public function testConvertsDateTimeMaxAgeToUnixTimestamp() { $cookie = new Cookie(array( 'expires' => 'November 20, 1984' )); $this->assertTrue(is_numeric($cookie->getExpires())); } public function testAddsExpiresBasedOnMaxAge() { $t = time(); $cookie = new Cookie(array( 'max_age' => 100 )); $this->assertEquals($t + 100, $cookie->getExpires()); } public function testHoldsValues() { $t = time(); $data = array( 'name' => 'foo', 'value' => 'baz', 'path' => '/bar', 'domain' => 'baz.com', 'expires' => $t, 'max_age' => 100, 'comment' => 'Hi', 'comment_url' => 'foo.com', 'port' => array(1, 2), 'version' => 2, 'secure' => true, 'discard' => true, 'http_only' => true, 'data' => array( 'foo' => 'baz', 'bar' => 'bam' ) ); $cookie = new Cookie($data); $this->assertEquals($data, $cookie->toArray()); $this->assertEquals('foo', $cookie->getName()); $this->assertEquals('baz', $cookie->getValue()); $this->assertEquals('baz.com', $cookie->getDomain()); $this->assertEquals('/bar', $cookie->getPath()); $this->assertEquals($t, $cookie->getExpires()); $this->assertEquals(100, $cookie->getMaxAge()); $this->assertEquals('Hi', $cookie->getComment()); $this->assertEquals('foo.com', $cookie->getCommentUrl()); $this->assertEquals(array(1, 2), $cookie->getPorts()); $this->assertEquals(2, $cookie->getVersion()); $this->assertTrue($cookie->getSecure()); $this->assertTrue($cookie->getDiscard()); $this->assertTrue($cookie->getHttpOnly()); $this->assertEquals('baz', $cookie->getAttribute('foo')); $this->assertEquals('bam', $cookie->getAttribute('bar')); $this->assertEquals(array( 'foo' => 'baz', 'bar' => 'bam' ), $cookie->getAttributes()); $cookie->setName('a') ->setValue('b') ->setPath('c') ->setDomain('bar.com') ->setExpires(10) ->setMaxAge(200) ->setComment('e') ->setCommentUrl('f') ->setPorts(array(80)) ->setVersion(3) ->setSecure(false) ->setHttpOnly(false) ->setDiscard(false) ->setAttribute('snoop', 'dog'); $this->assertEquals('a', $cookie->getName()); $this->assertEquals('b', $cookie->getValue()); $this->assertEquals('c', $cookie->getPath()); $this->assertEquals('bar.com', $cookie->getDomain()); $this->assertEquals(10, $cookie->getExpires()); $this->assertEquals(200, $cookie->getMaxAge()); $this->assertEquals('e', $cookie->getComment()); $this->assertEquals('f', $cookie->getCommentUrl()); $this->assertEquals(array(80), $cookie->getPorts()); $this->assertEquals(3, $cookie->getVersion()); $this->assertFalse($cookie->getSecure()); $this->assertFalse($cookie->getDiscard()); $this->assertFalse($cookie->getHttpOnly()); $this->assertEquals('dog', $cookie->getAttribute('snoop')); } public function testDeterminesIfExpired() { $c = new Cookie(); $c->setExpires(10); $this->assertTrue($c->isExpired()); $c->setExpires(time() + 10000); $this->assertFalse($c->isExpired()); } public function testMatchesPorts() { $cookie = new Cookie(); // Always matches when nothing is set $this->assertTrue($cookie->matchesPort(2)); $cookie->setPorts(array(1, 2)); $this->assertTrue($cookie->matchesPort(2)); $this->assertFalse($cookie->matchesPort(100)); } public function testMatchesDomain() { $cookie = new Cookie(); $this->assertTrue($cookie->matchesDomain('baz.com')); $cookie->setDomain('baz.com'); $this->assertTrue($cookie->matchesDomain('baz.com')); $this->assertFalse($cookie->matchesDomain('bar.com')); $cookie->setDomain('.baz.com'); $this->assertTrue($cookie->matchesDomain('.baz.com')); $this->assertTrue($cookie->matchesDomain('foo.baz.com')); $this->assertFalse($cookie->matchesDomain('baz.bar.com')); $this->assertTrue($cookie->matchesDomain('baz.com')); $cookie->setDomain('.com'); $this->assertFalse($cookie->matchesDomain('baz.com')); $cookie->setDomain('.com.'); $this->assertFalse($cookie->matchesDomain('baz.com')); $cookie->setDomain('.local'); $this->assertTrue($cookie->matchesDomain('example.local')); } public function testMatchesPath() { $cookie = new Cookie(); $this->assertTrue($cookie->matchesPath('/foo')); $cookie->setPath('/foo'); $this->assertTrue($cookie->matchesPath('/foo')); $this->assertTrue($cookie->matchesPath('/foo/bar')); $this->assertFalse($cookie->matchesPath('/bar')); } public function cookieValidateProvider() { return array( array('foo', 'baz', 'bar', true), array('0', '0', '0', true), array('', 'baz', 'bar', 'The cookie name must not be empty'), array('foo', '', 'bar', 'The cookie value must not be empty'), array('foo', 'baz', '', 'The cookie domain must not be empty'), array('foo\\', 'baz', '0', 'The cookie name must not contain invalid characters: foo\\'), ); } /** * @dataProvider cookieValidateProvider */ public function testValidatesCookies($name, $value, $domain, $result) { $cookie = new Cookie(array( 'name' => $name, 'value' => $value, 'domain' => $domain )); $this->assertSame($result, $cookie->validate()); } public function testCreatesInvalidCharacterString() { $m = new \ReflectionMethod('Guzzle\Plugin\Cookie\Cookie', 'getInvalidCharacters'); $m->setAccessible(true); $p = new \ReflectionProperty('Guzzle\Plugin\Cookie\Cookie', 'invalidCharString'); $p->setAccessible(true); $p->setValue(''); // Expects a string containing 51 invalid characters $this->assertEquals(51, strlen($m->invoke($m))); $this->assertContains('@', $m->invoke($m)); } } tests/Guzzle/Tests/Plugin/CurlAuth/CurlAuthPluginTest.php000064400000002341151742734620017547 0ustar00getEventDispatcher()->addSubscriber($plugin); $request = $client->get('/'); $this->assertEquals('michael', $request->getUsername()); $this->assertEquals('test', $request->getPassword()); } public function testAddsDigestAuthentication() { $plugin = new CurlAuthPlugin('julian', 'test', CURLAUTH_DIGEST); $client = new Client('http://www.test.com/'); $client->getEventDispatcher()->addSubscriber($plugin); $request = $client->get('/'); $this->assertEquals('julian', $request->getUsername()); $this->assertEquals('test', $request->getPassword()); $this->assertEquals('julian:test', $request->getCurlOptions()->get(CURLOPT_USERPWD)); $this->assertEquals(CURLAUTH_DIGEST, $request->getCurlOptions()->get(CURLOPT_HTTPAUTH)); } } tests/Guzzle/Tests/Plugin/ErrorResponse/ErrorResponsePluginTest.php000064400000012036151742734620021713 0ustar00flush(); } public function setUp() { $mockError = 'Guzzle\Tests\Mock\ErrorResponseMock'; $description = ServiceDescription::factory(array( 'operations' => array( 'works' => array( 'httpMethod' => 'GET', 'errorResponses' => array( array('code' => 500, 'class' => $mockError), array('code' => 503, 'reason' => 'foo', 'class' => $mockError), array('code' => 200, 'reason' => 'Error!', 'class' => $mockError) ) ), 'bad_class' => array( 'httpMethod' => 'GET', 'errorResponses' => array( array('code' => 500, 'class' => 'Does\\Not\\Exist') ) ), 'does_not_implement' => array( 'httpMethod' => 'GET', 'errorResponses' => array( array('code' => 500, 'class' => __CLASS__) ) ), 'no_errors' => array('httpMethod' => 'GET'), 'no_class' => array( 'httpMethod' => 'GET', 'errorResponses' => array( array('code' => 500) ) ), ) )); $this->client = new Client($this->getServer()->getUrl()); $this->client->setDescription($description); } /** * @expectedException \Guzzle\Http\Exception\ServerErrorResponseException */ public function testSkipsWhenErrorResponsesIsNotSet() { $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('no_errors')->execute(); } public function testSkipsWhenErrorResponsesIsNotSetAndAllowsSuccess() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('no_errors')->execute(); } /** * @expectedException \Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException * @expectedExceptionMessage Does\Not\Exist does not exist */ public function testEnsuresErrorResponseExists() { $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('bad_class')->execute(); } /** * @expectedException \Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException * @expectedExceptionMessage must implement Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface */ public function testEnsuresErrorResponseImplementsInterface() { $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('does_not_implement')->execute(); } public function testThrowsSpecificErrorResponseOnMatch() { try { $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $command = $this->client->getCommand('works'); $command->execute(); $this->fail('Exception not thrown'); } catch (ErrorResponseMock $e) { $this->assertSame($command, $e->command); $this->assertEquals(500, $e->response->getStatusCode()); } } /** * @expectedException \Guzzle\Tests\Mock\ErrorResponseMock */ public function testThrowsWhenCodeAndPhraseMatch() { $this->getServer()->enqueue("HTTP/1.1 200 Error!\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('works')->execute(); } public function testSkipsWhenReasonDoesNotMatch() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('works')->execute(); } public function testSkipsWhenNoClassIsSet() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $this->client->addSubscriber(new ErrorResponsePlugin()); $this->client->getCommand('no_class')->execute(); } } tests/Guzzle/Tests/Plugin/History/HistoryPluginTest.php000064400000006375151742734620017406 0ustar00get(); $requests[$i]->setResponse(new Response(200), true); $requests[$i]->send(); $h->add($requests[$i]); } return $requests; } public function testDescribesSubscribedEvents() { $this->assertInternalType('array', HistoryPlugin::getSubscribedEvents()); } public function testMaintainsLimitValue() { $h = new HistoryPlugin(); $this->assertSame($h, $h->setLimit(10)); $this->assertEquals(10, $h->getLimit()); } public function testAddsRequests() { $h = new HistoryPlugin(); $requests = $this->addRequests($h, 1); $this->assertEquals(1, count($h)); $i = $h->getIterator(); $this->assertEquals(1, count($i)); $this->assertEquals($requests[0], $i[0]); } public function testIgnoresUnsentRequests() { $h = new HistoryPlugin(); $request = RequestFactory::getInstance()->create('GET', 'http://localhost/'); $h->add($request); $this->assertEquals(0, count($h)); } /** * @depends testAddsRequests */ public function testMaintainsLimit() { $h = new HistoryPlugin(); $h->setLimit(2); $requests = $this->addRequests($h, 3); $this->assertEquals(2, count($h)); $i = 0; foreach ($h as $request) { if ($i > 0) { $this->assertSame($requests[$i], $request); } } } public function testReturnsLastRequest() { $h = new HistoryPlugin(); $requests = $this->addRequests($h, 5); $this->assertSame(end($requests), $h->getLastRequest()); } public function testReturnsLastResponse() { $h = new HistoryPlugin(); $requests = $this->addRequests($h, 5); $this->assertSame(end($requests)->getResponse(), $h->getLastResponse()); } public function testClearsHistory() { $h = new HistoryPlugin(); $requests = $this->addRequests($h, 5); $this->assertEquals(5, count($h)); $h->clear(); $this->assertEquals(0, count($h)); } /** * @depends testAddsRequests */ public function testUpdatesAddRequests() { $h = new HistoryPlugin(); $client = new Client('http://localhost/'); $client->getEventDispatcher()->addSubscriber($h); $request = $client->get(); $request->setResponse(new Response(200), true); $request->send(); $this->assertSame($request, $h->getLastRequest()); } } tests/Guzzle/Tests/Plugin/Log/LogPluginTest.php000064400000006164151742734620015542 0ustar00adapter = new ClosureLogAdapter(function ($message) { echo $message; }); } public function testIgnoresCurlEventsWhenNotWiringBodies() { $p = new LogPlugin($this->adapter); $this->assertNotEmpty($p->getSubscribedEvents()); $event = new Event(array('request' => new Request('GET', 'http://foo.com'))); $p->onCurlRead($event); $p->onCurlWrite($event); $p->onRequestBeforeSend($event); } public function testLogsWhenComplete() { $output = ''; $p = new LogPlugin(new ClosureLogAdapter(function ($message) use (&$output) { $output = $message; }), '{method} {resource} | {code} {res_body}'); $p->onRequestSent(new Event(array( 'request' => new Request('GET', 'http://foo.com'), 'response' => new Response(200, array(), 'Foo') ))); $this->assertEquals('GET / | 200 Foo', $output); } public function testWiresBodiesWhenNeeded() { $client = new Client($this->getServer()->getUrl()); $plugin = new LogPlugin($this->adapter, '{req_body} | {res_body}', true); $client->getEventDispatcher()->addSubscriber($plugin); $request = $client->put(); // Send the response from the dummy server as the request body $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nsend"); $stream = fopen($this->getServer()->getUrl(), 'r'); $request->setBody(EntityBody::factory($stream, 4)); $tmpFile = tempnam(sys_get_temp_dir(), 'non_repeatable'); $request->setResponseBody(EntityBody::factory(fopen($tmpFile, 'w'))); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 8\r\n\r\nresponse"); ob_start(); $request->send(); $message = ob_get_clean(); unlink($tmpFile); $this->assertContains("send", $message); $this->assertContains("response", $message); } public function testHasHelpfulStaticFactoryMethod() { $s = fopen('php://temp', 'r+'); $client = new Client(); $client->addSubscriber(LogPlugin::getDebugPlugin(true, $s)); $request = $client->put('http://foo.com', array('Content-Type' => 'Foo'), 'Bar'); $request->setresponse(new Response(200), true); $request->send(); rewind($s); $contents = stream_get_contents($s); $this->assertContains('# Request:', $contents); $this->assertContainsIns('PUT / HTTP/1.1', $contents); $this->assertContains('# Response:', $contents); $this->assertContainsIns('HTTP/1.1 200 OK', $contents); $this->assertContains('# Errors:', $contents); } } tests/Guzzle/Tests/Plugin/Md5/CommandContentMd5PluginTest.php000064400000006347151742734620020207 0ustar00 array( 'test' => array( 'httpMethod' => 'PUT', 'parameters' => array( 'ContentMD5' => array(), 'Body' => array( 'location' => 'body' ) ) ) ) )); $client = new Client(); $client->setDescription($description); return $client; } public function testHasEvents() { $this->assertNotEmpty(CommandContentMd5Plugin::getSubscribedEvents()); } public function testValidatesMd5WhenParamExists() { $client = $this->getClient(); $command = $client->getCommand('test', array( 'Body' => 'Foo', 'ContentMD5' => true )); $event = new Event(array('command' => $command)); $request = $command->prepare(); $plugin = new CommandContentMd5Plugin(); $plugin->onCommandBeforeSend($event); $this->assertEquals('E1bGfXrRY42Ba/uCLdLCXQ==', (string) $request->getHeader('Content-MD5')); } public function testDoesNothingWhenNoPayloadExists() { $client = $this->getClient(); $client->getDescription()->getOperation('test')->setHttpMethod('GET'); $command = $client->getCommand('test'); $event = new Event(array('command' => $command)); $request = $command->prepare(); $plugin = new CommandContentMd5Plugin(); $plugin->onCommandBeforeSend($event); $this->assertNull($request->getHeader('Content-MD5')); } public function testAddsValidationToResponsesOfContentMd5() { $client = $this->getClient(); $client->getDescription()->getOperation('test')->setHttpMethod('GET'); $command = $client->getCommand('test', array( 'ValidateMD5' => true )); $event = new Event(array('command' => $command)); $request = $command->prepare(); $plugin = new CommandContentMd5Plugin(); $plugin->onCommandBeforeSend($event); $listeners = $request->getEventDispatcher()->getListeners('request.complete'); $this->assertNotEmpty($listeners); } public function testIgnoresValidationWhenDisabled() { $client = $this->getClient(); $client->getDescription()->getOperation('test')->setHttpMethod('GET'); $command = $client->getCommand('test', array( 'ValidateMD5' => false )); $event = new Event(array('command' => $command)); $request = $command->prepare(); $plugin = new CommandContentMd5Plugin(); $plugin->onCommandBeforeSend($event); $listeners = $request->getEventDispatcher()->getListeners('request.complete'); $this->assertEmpty($listeners); } } tests/Guzzle/Tests/Plugin/Md5/Md5ValidatorPluginTest.php000064400000007712151742734620017220 0ustar00create('GET', 'http://www.test.com/'); $request->getEventDispatcher()->addSubscriber($plugin); $body = 'abc'; $hash = md5($body); $response = new Response(200, array( 'Content-MD5' => $hash, 'Content-Length' => 3 ), 'abc'); $request->dispatch('request.complete', array( 'response' => $response )); // Try again with no Content-MD5 $response->removeHeader('Content-MD5'); $request->dispatch('request.complete', array( 'response' => $response )); } /** * @expectedException UnexpectedValueException */ public function testThrowsExceptionOnInvalidMd5() { $plugin = new Md5ValidatorPlugin(); $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/'); $request->getEventDispatcher()->addSubscriber($plugin); $request->dispatch('request.complete', array( 'response' => new Response(200, array( 'Content-MD5' => 'foobar', 'Content-Length' => 3 ), 'abc') )); } public function testSkipsWhenContentLengthIsTooLarge() { $plugin = new Md5ValidatorPlugin(false, 1); $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/'); $request->getEventDispatcher()->addSubscriber($plugin); $request->dispatch('request.complete', array( 'response' => new Response(200, array( 'Content-MD5' => 'foobar', 'Content-Length' => 3 ), 'abc') )); } public function testProperlyValidatesWhenUsingContentEncoding() { $plugin = new Md5ValidatorPlugin(true); $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/'); $request->getEventDispatcher()->addSubscriber($plugin); // Content-MD5 is the MD5 hash of the canonical content after all // content-encoding has been applied. Because cURL will automatically // decompress entity bodies, we need to re-compress it to calculate. $body = EntityBody::factory('abc'); $body->compress(); $hash = $body->getContentMd5(); $body->uncompress(); $response = new Response(200, array( 'Content-MD5' => $hash, 'Content-Encoding' => 'gzip' ), 'abc'); $request->dispatch('request.complete', array( 'response' => $response )); $this->assertEquals('abc', $response->getBody(true)); // Try again with an unknown encoding $response = new Response(200, array( 'Content-MD5' => $hash, 'Content-Encoding' => 'foobar' ), 'abc'); $request->dispatch('request.complete', array( 'response' => $response )); // Try again with compress $body->compress('bzip2.compress'); $response = new Response(200, array( 'Content-MD5' => $body->getContentMd5(), 'Content-Encoding' => 'compress' ), 'abc'); $request->dispatch('request.complete', array( 'response' => $response )); // Try again with encoding and disabled content-encoding checks $request->getEventDispatcher()->removeSubscriber($plugin); $plugin = new Md5ValidatorPlugin(false); $request->getEventDispatcher()->addSubscriber($plugin); $request->dispatch('request.complete', array( 'response' => $response )); } } tests/Guzzle/Tests/Plugin/Mock/MockPluginTest.php000064400000012572151742734620016062 0ustar00assertInternalType('array', MockPlugin::getSubscribedEvents()); } public function testDescribesEvents() { $this->assertInternalType('array', MockPlugin::getAllEvents()); } public function testCanBeTemporary() { $plugin = new MockPlugin(); $this->assertFalse($plugin->isTemporary()); $plugin = new MockPlugin(null, true); $this->assertTrue($plugin->isTemporary()); } public function testIsCountable() { $plugin = new MockPlugin(); $plugin->addResponse(Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); $this->assertEquals(1, count($plugin)); } /** * @depends testIsCountable */ public function testCanClearQueue() { $plugin = new MockPlugin(); $plugin->addResponse(Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); $plugin->clearQueue(); $this->assertEquals(0, count($plugin)); } public function testCanInspectQueue() { $plugin = new MockPlugin(); $this->assertInternalType('array', $plugin->getQueue()); $plugin->addResponse(Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); $queue = $plugin->getQueue(); $this->assertInternalType('array', $queue); $this->assertEquals(1, count($queue)); } public function testRetrievesResponsesFromFiles() { $response = MockPlugin::getMockFile(__DIR__ . '/../../TestData/mock_response'); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response); $this->assertEquals(200, $response->getStatusCode()); } /** * @expectedException InvalidArgumentException */ public function testThrowsExceptionWhenResponseFileIsNotFound() { MockPlugin::getMockFile('missing/filename'); } /** * @expectedException InvalidArgumentException */ public function testInvalidResponsesThrowAnException() { $p = new MockPlugin(); $p->addResponse($this); } public function testAddsResponseObjectsToQueue() { $p = new MockPlugin(); $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $p->addResponse($response); $this->assertEquals(array($response), $p->getQueue()); } public function testAddsResponseFilesToQueue() { $p = new MockPlugin(); $p->addResponse(__DIR__ . '/../../TestData/mock_response'); $this->assertEquals(1, count($p)); } /** * @depends testAddsResponseFilesToQueue */ public function testAddsMockResponseToRequestFromClient() { $p = new MockPlugin(); $response = MockPlugin::getMockFile(__DIR__ . '/../../TestData/mock_response'); $p->addResponse($response); $client = new Client('http://localhost:123/'); $client->getEventDispatcher()->addSubscriber($p, 9999); $request = $client->get(); $request->send(); $this->assertSame($response, $request->getResponse()); $this->assertEquals(0, count($p)); } /** * @depends testAddsResponseFilesToQueue */ public function testUpdateIgnoresWhenEmpty() { $p = new MockPlugin(); $p->onRequestCreate(new Event()); } /** * @depends testAddsMockResponseToRequestFromClient */ public function testDetachesTemporaryWhenEmpty() { $p = new MockPlugin(null, true); $p->addResponse(MockPlugin::getMockFile(__DIR__ . '/../../TestData/mock_response')); $client = new Client('http://localhost:123/'); $client->getEventDispatcher()->addSubscriber($p, 9999); $request = $client->get(); $request->send(); $this->assertFalse($this->hasSubscriber($client, $p)); } public function testLoadsResponsesFromConstructor() { $p = new MockPlugin(array(new Response(200))); $this->assertEquals(1, $p->count()); } public function testStoresMockedRequests() { $p = new MockPlugin(array(new Response(200), new Response(200))); $client = new Client('http://localhost:123/'); $client->getEventDispatcher()->addSubscriber($p, 9999); $request1 = $client->get(); $request1->send(); $this->assertEquals(array($request1), $p->getReceivedRequests()); $request2 = $client->get(); $request2->send(); $this->assertEquals(array($request1, $request2), $p->getReceivedRequests()); $p->flush(); $this->assertEquals(array(), $p->getReceivedRequests()); } public function testReadsBodiesFromMockedRequests() { $p = new MockPlugin(array(new Response(200))); $p->readBodies(true); $client = new Client('http://localhost:123/'); $client->getEventDispatcher()->addSubscriber($p, 9999); $body = EntityBody::factory('foo'); $request = $client->put(); $request->setBody($body); $request->send(); $this->assertEquals(3, $body->ftell()); } } tests/Guzzle/Tests/Plugin/Oauth/OauthPluginTest.php000064400000017034151742734620016436 0ustar00 'foo', 'consumer_secret' => 'bar', 'token' => 'count', 'token_secret' => 'dracula' ); protected function getRequest() { return RequestFactory::getInstance()->create('POST', 'http://www.test.com/path?a=b&c=d', null, array( 'e' => 'f' )); } public function testSubscribesToEvents() { $events = OauthPlugin::getSubscribedEvents(); $this->assertArrayHasKey('request.before_send', $events); } public function testAcceptsConfigurationData() { $p = new OauthPlugin($this->config); // Access the config object $class = new \ReflectionClass($p); $property = $class->getProperty('config'); $property->setAccessible(true); $config = $property->getValue($p); $this->assertEquals('foo', $config['consumer_key']); $this->assertEquals('bar', $config['consumer_secret']); $this->assertEquals('count', $config['token']); $this->assertEquals('dracula', $config['token_secret']); $this->assertEquals('1.0', $config['version']); $this->assertEquals('HMAC-SHA1', $config['signature_method']); } public function testCreatesStringToSignFromPostRequest() { $p = new OauthPlugin($this->config); $request = $this->getRequest(); $signString = $p->getStringToSign($request, self::TIMESTAMP, self::NONCE); $this->assertContains('&e=f', rawurldecode($signString)); $expectedSignString = // Method and URL 'POST&http%3A%2F%2Fwww.test.com%2Fpath' . // Sorted parameters from query string and body '&a%3Db%26c%3Dd%26e%3Df%26oauth_consumer_key%3Dfoo' . '%26oauth_nonce%3De7aa11195ca58349bec8b5ebe351d3497eb9e603%26' . 'oauth_signature_method%3DHMAC-SHA1' . '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_token%3Dcount%26oauth_version%3D1.0'; $this->assertEquals($expectedSignString, $signString); } public function testCreatesStringToSignIgnoringPostFields() { $config = $this->config; $config['disable_post_params'] = true; $p = new OauthPlugin($config); $request = $this->getRequest(); $sts = rawurldecode($p->getStringToSign($request, self::TIMESTAMP, self::NONCE)); $this->assertNotContains('&e=f', $sts); } public function testCreatesStringToSignFromPostRequestWithCustomContentType() { $p = new OauthPlugin($this->config); $request = $this->getRequest(); $request->setHeader('Content-Type', 'Foo'); $this->assertEquals( // Method and URL 'POST&http%3A%2F%2Fwww.test.com%2Fpath' . // Sorted parameters from query string and body '&a%3Db%26c%3Dd%26oauth_consumer_key%3Dfoo' . '%26oauth_nonce%3D'. self::NONCE .'%26' . 'oauth_signature_method%3DHMAC-SHA1' . '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_token%3Dcount%26oauth_version%3D1.0', $p->getStringToSign($request, self::TIMESTAMP, self::NONCE) ); } /** * @depends testCreatesStringToSignFromPostRequest */ public function testConvertsBooleansToStrings() { $p = new OauthPlugin($this->config); $request = $this->getRequest(); $request->getQuery()->set('a', true); $request->getQuery()->set('c', false); $this->assertContains('&a%3Dtrue%26c%3Dfalse', $p->getStringToSign($request, self::TIMESTAMP, self::NONCE)); } public function testCreatesStringToSignFromPostRequestWithNullValues() { $config = array( 'consumer_key' => 'foo', 'consumer_secret' => 'bar', 'token' => null, 'token_secret' => 'dracula' ); $p = new OauthPlugin($config); $request = $this->getRequest(); $signString = $p->getStringToSign($request, self::TIMESTAMP, self::NONCE); $this->assertContains('&e=f', rawurldecode($signString)); $expectedSignString = // Method and URL 'POST&http%3A%2F%2Fwww.test.com%2Fpath' . // Sorted parameters from query string and body '&a%3Db%26c%3Dd%26e%3Df%26oauth_consumer_key%3Dfoo' . '%26oauth_nonce%3De7aa11195ca58349bec8b5ebe351d3497eb9e603%26' . 'oauth_signature_method%3DHMAC-SHA1' . '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_version%3D1.0'; $this->assertEquals($expectedSignString, $signString); } /** * @depends testCreatesStringToSignFromPostRequest */ public function testMultiDimensionalArray() { $p = new OauthPlugin($this->config); $request = $this->getRequest(); $request->getQuery()->set('a', array('b' => array('e' => 'f', 'c' => 'd'))); $this->assertContains('a%255Bb%255D%255Bc%255D%3Dd%26a%255Bb%255D%255Be%255D%3Df%26c%3Dd%26e%3Df%26', $p->getStringToSign($request, self::TIMESTAMP, self::NONCE)); } /** * @depends testCreatesStringToSignFromPostRequest */ public function testSignsStrings() { $p = new OauthPlugin(array_merge($this->config, array( 'signature_callback' => function($string, $key) { return "_{$string}|{$key}_"; } ))); $request = $this->getRequest(); $sig = $p->getSignature($request, self::TIMESTAMP, self::NONCE); $this->assertEquals( '_POST&http%3A%2F%2Fwww.test.com%2Fpath&a%3Db%26c%3Dd%26e%3Df%26oauth_consumer_key%3Dfoo' . '%26oauth_nonce%3D'. self::NONCE .'%26oauth_signature_method%3DHMAC-SHA1' . '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_token%3Dcount%26oauth_version%3D1.0|' . 'bar&dracula_', base64_decode($sig) ); } public function testSignsOauthRequests() { $p = new OauthPlugin($this->config); $event = new Event(array( 'request' => $this->getRequest(), 'timestamp' => self::TIMESTAMP )); $params = $p->onRequestBeforeSend($event); $this->assertTrue($event['request']->hasHeader('Authorization')); $this->assertEquals('OAuth oauth_consumer_key="foo", ' . 'oauth_nonce="'.urlencode($params['oauth_nonce']).'", ' . 'oauth_signature="'.urlencode($params['oauth_signature']).'", ' . 'oauth_signature_method="HMAC-SHA1", ' . 'oauth_timestamp="' . self::TIMESTAMP . '", ' . 'oauth_token="count", ' . 'oauth_version="1.0"', (string) $event['request']->getHeader('Authorization') ); } public function testDoesNotAddFalseyValuesToAuthorization() { unset($this->config['token']); $p = new OauthPlugin($this->config); $event = new Event(array('request' => $this->getRequest(), 'timestamp' => self::TIMESTAMP)); $p->onRequestBeforeSend($event); $this->assertTrue($event['request']->hasHeader('Authorization')); $this->assertNotContains('oauth_token=', (string) $event['request']->getHeader('Authorization')); } } tests/Guzzle/Tests/Service/AbstractConfigLoaderTest.php000064400000012677151742734620017311 0ustar00loader = $this->getMockBuilder('Guzzle\Service\AbstractConfigLoader') ->setMethods(array('build')) ->getMockForAbstractClass(); } public function tearDown() { foreach ($this->cleanup as $file) { unlink($file); } } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException */ public function testOnlyLoadsSupportedTypes() { $this->loader->load(new \stdClass()); } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException * @expectedExceptionMessage Unable to open fooooooo! for reading */ public function testFileMustBeReadable() { $this->loader->load('fooooooo!'); } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException * @expectedExceptionMessage Unknown file extension */ public function testMustBeSupportedExtension() { $this->loader->load(dirname(__DIR__) . '/TestData/FileBody.txt'); } /** * @expectedException \Guzzle\Common\Exception\RuntimeException * @expectedExceptionMessage Error loading JSON data from */ public function testJsonMustBeValue() { $filename = tempnam(sys_get_temp_dir(), 'json') . '.json'; file_put_contents($filename, '{/{./{}foo'); $this->cleanup[] = $filename; $this->loader->load($filename); } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException * @expectedExceptionMessage PHP files must return an array */ public function testPhpFilesMustReturnAnArray() { $filename = tempnam(sys_get_temp_dir(), 'php') . '.php'; file_put_contents($filename, 'cleanup[] = $filename; $this->loader->load($filename); } public function testLoadsPhpFileIncludes() { $filename = tempnam(sys_get_temp_dir(), 'php') . '.php'; file_put_contents($filename, ' "bar");'); $this->cleanup[] = $filename; $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0)); $config = $this->loader->load($filename); $this->assertEquals(array('foo' => 'bar'), $config); } public function testCanCreateFromJson() { $file = dirname(__DIR__) . '/TestData/services/json1.json'; // The build method will just return the config data $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0)); $data = $this->loader->load($file); // Ensure that the config files were merged using the includes directives $this->assertArrayHasKey('includes', $data); $this->assertArrayHasKey('services', $data); $this->assertInternalType('array', $data['services']['foo']); $this->assertInternalType('array', $data['services']['abstract']); $this->assertInternalType('array', $data['services']['mock']); $this->assertEquals('bar', $data['services']['foo']['params']['baz']); } public function testUsesAliases() { $file = dirname(__DIR__) . '/TestData/services/json1.json'; $this->loader->addAlias('foo', $file); // The build method will just return the config data $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0)); $data = $this->loader->load('foo'); $this->assertEquals('bar', $data['services']['foo']['params']['baz']); } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException * @expectedExceptionMessage Unable to open foo for reading */ public function testCanRemoveAliases() { $file = dirname(__DIR__) . '/TestData/services/json1.json'; $this->loader->addAlias('foo', $file); $this->loader->removeAlias('foo'); $this->loader->load('foo'); } public function testCanLoadArraysWithIncludes() { $file = dirname(__DIR__) . '/TestData/services/json1.json'; $config = array('includes' => array($file)); // The build method will just return the config data $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0)); $data = $this->loader->load($config); $this->assertEquals('bar', $data['services']['foo']['params']['baz']); } public function testDoesNotEnterInfiniteLoop() { $prefix = $file = dirname(__DIR__) . '/TestData/description'; $this->loader->load("{$prefix}/baz.json"); $this->assertCount(4, $this->readAttribute($this->loader, 'loadedFiles')); // Ensure that the internal list of loaded files is reset $this->loader->load("{$prefix}/../test_service2.json"); $this->assertCount(1, $this->readAttribute($this->loader, 'loadedFiles')); // Ensure that previously loaded files will be reloaded when starting fresh $this->loader->load("{$prefix}/baz.json"); $this->assertCount(4, $this->readAttribute($this->loader, 'loadedFiles')); } } tests/Guzzle/Tests/Service/Builder/ServiceBuilderLoaderTest.php000064400000012337151742734620020706 0ustar00 array( 'abstract' => array( 'params' => array( 'access_key' => 'xyz', 'secret' => 'abc', ), ), 'foo' => array( 'extends' => 'abstract', 'params' => array( 'baz' => 'bar', ), ), 'mock' => array( 'extends' => 'abstract', 'params' => array( 'username' => 'foo', 'password' => 'baz', 'subdomain' => 'bar', ) ) ) ); $builder = $arrayFactory->load($data); // Ensure that services were parsed $this->assertTrue(isset($builder['mock'])); $this->assertTrue(isset($builder['abstract'])); $this->assertTrue(isset($builder['foo'])); $this->assertFalse(isset($builder['jimmy'])); } /** * @expectedException Guzzle\Service\Exception\ServiceNotFoundException * @expectedExceptionMessage foo is trying to extend a non-existent service: abstract */ public function testThrowsExceptionWhenExtendingNonExistentService() { $arrayFactory = new ServiceBuilderLoader(); $data = array( 'services' => array( 'foo' => array( 'extends' => 'abstract' ) ) ); $builder = $arrayFactory->load($data); } public function testAllowsGlobalParameterOverrides() { $arrayFactory = new ServiceBuilderLoader(); $data = array( 'services' => array( 'foo' => array( 'params' => array( 'foo' => 'baz', 'bar' => 'boo' ) ) ) ); $builder = $arrayFactory->load($data, array( 'bar' => 'jar', 'far' => 'car' )); $compiled = json_decode($builder->serialize(), true); $this->assertEquals(array( 'foo' => 'baz', 'bar' => 'jar', 'far' => 'car' ), $compiled['foo']['params']); } public function tstDoesNotErrorOnCircularReferences() { $arrayFactory = new ServiceBuilderLoader(); $arrayFactory->load(array( 'services' => array( 'too' => array('extends' => 'ball'), 'ball' => array('extends' => 'too'), ) )); } public function configProvider() { $foo = array( 'extends' => 'bar', 'class' => 'stdClass', 'params' => array('a' => 'test', 'b' => '456') ); return array( array( // Does not extend the existing `foo` service but overwrites it array( 'services' => array( 'foo' => $foo, 'bar' => array('params' => array('baz' => '123')) ) ), array( 'services' => array( 'foo' => array('class' => 'Baz') ) ), array( 'services' => array( 'foo' => array('class' => 'Baz'), 'bar' => array('params' => array('baz' => '123')) ) ) ), array( // Extends the existing `foo` service array( 'services' => array( 'foo' => $foo, 'bar' => array('params' => array('baz' => '123')) ) ), array( 'services' => array( 'foo' => array( 'extends' => 'foo', 'params' => array('b' => '123', 'c' => 'def') ) ) ), array( 'services' => array( 'foo' => array( 'extends' => 'bar', 'class' => 'stdClass', 'params' => array('a' => 'test', 'b' => '123', 'c' => 'def') ), 'bar' => array('params' => array('baz' => '123')) ) ) ) ); } /** * @dataProvider configProvider */ public function testCombinesConfigs($a, $b, $c) { $l = new ServiceBuilderLoader(); $m = new \ReflectionMethod($l, 'mergeData'); $m->setAccessible(true); $this->assertEquals($c, $m->invoke($l, $a, $b)); } } tests/Guzzle/Tests/Service/Builder/ServiceBuilderTest.php000064400000026605151742734620017562 0ustar00 array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'username' => 'michael', 'password' => 'testing123', 'subdomain' => 'michael', ), ), 'billy.mock' => array( 'alias' => 'Hello!', 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'username' => 'billy', 'password' => 'passw0rd', 'subdomain' => 'billy', ), ), 'billy.testing' => array( 'extends' => 'billy.mock', 'params' => array( 'subdomain' => 'test.billy', ), ), 'missing_params' => array( 'extends' => 'billy.mock' ), 'cache.adapter' => array( 'class' => 'Guzzle\Cache\CacheAdapterFactory', 'params' => array( 'cache.adapter' => 'Guzzle\Cache\DoctrineCacheAdapter', 'cache.provider' => 'Doctrine\Common\Cache\ArrayCache' ) ), 'service_uses_cache' => array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'cache' => '{cache.adapter}', 'username' => 'foo', 'password' => 'bar', 'subdomain' => 'baz' ) ) ); public function testAllowsSerialization() { $builder = ServiceBuilder::factory($this->arrayData); $cached = unserialize(serialize($builder)); $this->assertEquals($cached, $builder); } public function testDelegatesFactoryMethodToAbstractFactory() { $builder = ServiceBuilder::factory($this->arrayData); $c = $builder->get('michael.mock'); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $c); } /** * @expectedException Guzzle\Service\Exception\ServiceNotFoundException * @expectedExceptionMessage No service is registered as foobar */ public function testThrowsExceptionWhenGettingInvalidClient() { ServiceBuilder::factory($this->arrayData)->get('foobar'); } public function testStoresClientCopy() { $builder = ServiceBuilder::factory($this->arrayData); $client = $builder->get('michael.mock'); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $client); $this->assertEquals('http://127.0.0.1:8124/v1/michael', $client->getBaseUrl()); $this->assertEquals($client, $builder->get('michael.mock')); // Get another client but throw this one away $client2 = $builder->get('billy.mock', true); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $client2); $this->assertEquals('http://127.0.0.1:8124/v1/billy', $client2->getBaseUrl()); // Make sure the original client is still there and set $this->assertTrue($client === $builder->get('michael.mock')); // Create a new billy.mock client that is stored $client3 = $builder->get('billy.mock'); // Make sure that the stored billy.mock client is equal to the other stored client $this->assertTrue($client3 === $builder->get('billy.mock')); // Make sure that this client is not equal to the previous throwaway client $this->assertFalse($client2 === $builder->get('billy.mock')); } public function testBuildersPassOptionsThroughToClients() { $s = new ServiceBuilder(array( 'michael.mock' => array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'base_url' => 'http://www.test.com/', 'subdomain' => 'michael', 'password' => 'test', 'username' => 'michael', 'curl.curlopt_proxyport' => 8080 ) ) )); $c = $s->get('michael.mock'); $this->assertEquals(8080, $c->getConfig('curl.curlopt_proxyport')); } public function testUsesTheDefaultBuilderWhenNoBuilderIsSpecified() { $s = new ServiceBuilder(array( 'michael.mock' => array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'base_url' => 'http://www.test.com/', 'subdomain' => 'michael', 'password' => 'test', 'username' => 'michael', 'curl.curlopt_proxyport' => 8080 ) ) )); $c = $s->get('michael.mock'); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $c); } public function testUsedAsArray() { $b = ServiceBuilder::factory($this->arrayData); $this->assertTrue($b->offsetExists('michael.mock')); $this->assertFalse($b->offsetExists('not_there')); $this->assertInstanceOf('Guzzle\Service\Client', $b['michael.mock']); unset($b['michael.mock']); $this->assertFalse($b->offsetExists('michael.mock')); $b['michael.mock'] = new Client('http://www.test.com/'); $this->assertInstanceOf('Guzzle\Service\Client', $b['michael.mock']); } public function testFactoryCanCreateFromJson() { $tmp = sys_get_temp_dir() . '/test.js'; file_put_contents($tmp, json_encode($this->arrayData)); $b = ServiceBuilder::factory($tmp); unlink($tmp); $s = $b->get('billy.testing'); $this->assertEquals('test.billy', $s->getConfig('subdomain')); $this->assertEquals('billy', $s->getConfig('username')); } public function testFactoryCanCreateFromArray() { $b = ServiceBuilder::factory($this->arrayData); $s = $b->get('billy.testing'); $this->assertEquals('test.billy', $s->getConfig('subdomain')); $this->assertEquals('billy', $s->getConfig('username')); } public function testFactoryDoesNotRequireParams() { $b = ServiceBuilder::factory($this->arrayData); $s = $b->get('missing_params'); $this->assertEquals('billy', $s->getConfig('username')); } public function testBuilderAllowsReferencesBetweenClients() { $builder = ServiceBuilder::factory(array( 'a' => array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'other_client' => '{b}', 'username' => 'x', 'password' => 'y', 'subdomain' => 'z' ) ), 'b' => array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'username' => '1', 'password' => '2', 'subdomain' => '3' ) ) )); $client = $builder['a']; $this->assertEquals('x', $client->getConfig('username')); $this->assertSame($builder['b'], $client->getConfig('other_client')); $this->assertEquals('1', $builder['b']->getConfig('username')); } public function testEmitsEventsWhenClientsAreCreated() { // Ensure that the client signals that it emits an event $this->assertEquals(array('service_builder.create_client'), ServiceBuilder::getAllEvents()); // Create a test service builder $builder = ServiceBuilder::factory(array( 'a' => array( 'class' => 'Guzzle\Tests\Service\Mock\MockClient', 'params' => array( 'username' => 'test', 'password' => '123', 'subdomain' => 'z' ) ) )); // Add an event listener to pick up client creation events $emits = 0; $builder->getEventDispatcher()->addListener('service_builder.create_client', function($event) use (&$emits) { $emits++; }); // Get the 'a' client by name $client = $builder->get('a'); // Ensure that the event was emitted once, and that the client was present $this->assertEquals(1, $emits); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $client); } public function testCanAddGlobalParametersToServicesOnLoad() { $builder = ServiceBuilder::factory($this->arrayData, array( 'username' => 'fred', 'new_value' => 'test' )); $data = json_decode($builder->serialize(), true); foreach ($data as $service) { $this->assertEquals('fred', $service['params']['username']); $this->assertEquals('test', $service['params']['new_value']); } } public function testCacheServiceCanBeCreatedAndInjectedIntoOtherServices() { $builder = ServiceBuilder::factory($this->arrayData); $usesCache = $builder['service_uses_cache']; $this->assertInstanceOf('Guzzle\Cache\DoctrineCacheAdapter', $usesCache->getConfig('cache')); } public function testServicesCanBeAddedToBuilderAfterInstantiationAndInjectedIntoServices() { // Grab the cache adapter and remove it from the config $cache = $this->arrayData['cache.adapter']; $data = $this->arrayData; unset($data['cache.adapter']); // Create the builder and add the cache adapter $builder = ServiceBuilder::factory($data); $builder['cache.adapter'] = $cache; $this->assertInstanceOf( 'Guzzle\Cache\DoctrineCacheAdapter', $builder['service_uses_cache']->getConfig('cache') ); } public function testAddsGlobalPlugins() { $b = new ServiceBuilder($this->arrayData); $b->addGlobalPlugin(new HistoryPlugin()); $s = $b->get('michael.mock'); $this->assertTrue($s->getEventDispatcher()->hasListeners('request.complete')); } public function testCanGetData() { $b = new ServiceBuilder($this->arrayData); $this->assertEquals($this->arrayData['michael.mock'], $b->getData('michael.mock')); $this->assertNull($b->getData('ewofweoweofe')); } public function testCanGetByAlias() { $b = new ServiceBuilder($this->arrayData); $this->assertSame($b->get('billy.mock'), $b->get('Hello!')); } public function testCanOverwriteParametersForThrowawayClients() { $b = new ServiceBuilder($this->arrayData); $c1 = $b->get('michael.mock'); $this->assertEquals('michael', $c1->getConfig('username')); $c2 = $b->get('michael.mock', array('username' => 'jeremy')); $this->assertEquals('jeremy', $c2->getConfig('username')); } public function testGettingAThrowawayClientWithParametersDoesNotAffectGettingOtherClients() { $b = new ServiceBuilder($this->arrayData); $c1 = $b->get('michael.mock', array('username' => 'jeremy')); $this->assertEquals('jeremy', $c1->getConfig('username')); $c2 = $b->get('michael.mock'); $this->assertEquals('michael', $c2->getConfig('username')); } } tests/Guzzle/Tests/Service/CachingConfigLoaderTest.php000064400000002744151742734620017074 0ustar00getMockBuilder('Guzzle\Service\ConfigLoaderInterface') ->setMethods(array('load')) ->getMockForAbstractClass(); $data = array('foo' => 'bar'); $loader->expects($this->once()) ->method('load') ->will($this->returnValue($data)); $cache = new CachingConfigLoader($loader, $cache); $this->assertEquals($data, $cache->load('foo')); $this->assertEquals($data, $cache->load('foo')); } public function testDoesNotCacheArrays() { $cache = new DoctrineCacheAdapter(new ArrayCache()); $loader = $this->getMockBuilder('Guzzle\Service\ConfigLoaderInterface') ->setMethods(array('load')) ->getMockForAbstractClass(); $data = array('foo' => 'bar'); $loader->expects($this->exactly(2)) ->method('load') ->will($this->returnValue($data)); $cache = new CachingConfigLoader($loader, $cache); $this->assertEquals($data, $cache->load(array())); $this->assertEquals($data, $cache->load(array())); } } tests/Guzzle/Tests/Service/ClientTest.php000064400000031512151742734620014474 0ustar00serviceTest = new ServiceDescription(array( 'test_command' => new Operation(array( 'doc' => 'documentationForCommand', 'method' => 'DELETE', 'class' => 'Guzzle\\Tests\\Service\\Mock\\Command\\MockCommand', 'args' => array( 'bucket' => array( 'required' => true ), 'key' => array( 'required' => true ) ) )) )); $this->service = ServiceDescription::factory(__DIR__ . '/../TestData/test_service.json'); } public function testAllowsCustomClientParameters() { $client = new Mock\MockClient(null, array( Client::COMMAND_PARAMS => array(AbstractCommand::RESPONSE_PROCESSING => 'foo') )); $command = $client->getCommand('mock_command'); $this->assertEquals('foo', $command->get(AbstractCommand::RESPONSE_PROCESSING)); } /** * @covers Guzzle\Service\Client::factory */ public function testFactoryCreatesClient() { $client = Client::factory(array( 'base_url' => 'http://www.test.com/', 'test' => '123' )); $this->assertEquals('http://www.test.com/', $client->getBaseUrl()); $this->assertEquals('123', $client->getConfig('test')); } /** * @covers Guzzle\Service\Client::factory */ public function testFactoryDoesNotRequireBaseUrl() { $client = Client::factory(); } /** * @covers Guzzle\Service\Client::getAllEvents */ public function testDescribesEvents() { $this->assertInternalType('array', Client::getAllEvents()); } /** * @covers Guzzle\Service\Client::execute */ public function testExecutesCommands() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $client = new Client($this->getServer()->getUrl()); $cmd = new MockCommand(); $client->execute($cmd); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $cmd->getResponse()); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $cmd->getResult()); $this->assertEquals(1, count($this->getServer()->getReceivedRequests(false))); } /** * @covers Guzzle\Service\Client::execute */ public function testExecutesCommandsWithArray() { $client = new Client('http://www.test.com/'); $client->getEventDispatcher()->addSubscriber(new MockPlugin(array( new Response(200), new Response(200) ))); // Create a command set and a command $set = array(new MockCommand(), new MockCommand()); $client->execute($set); // Make sure it sent $this->assertTrue($set[0]->isExecuted()); $this->assertTrue($set[1]->isExecuted()); } /** * @covers Guzzle\Service\Client::execute * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testThrowsExceptionWhenInvalidCommandIsExecuted() { $client = new Client(); $client->execute(new \stdClass()); } /** * @covers Guzzle\Service\Client::getCommand * @expectedException InvalidArgumentException */ public function testThrowsExceptionWhenMissingCommand() { $client = new Client(); $mock = $this->getMock('Guzzle\\Service\\Command\\Factory\\FactoryInterface'); $mock->expects($this->any()) ->method('factory') ->with($this->equalTo('test')) ->will($this->returnValue(null)); $client->setCommandFactory($mock); $client->getCommand('test'); } /** * @covers Guzzle\Service\Client::getCommand * @covers Guzzle\Service\Client::getCommandFactory * @covers Guzzle\Service\Client::setCommandFactory */ public function testCreatesCommandsUsingCommandFactory() { $mockCommand = new MockCommand(); $client = new Mock\MockClient(); $mock = $this->getMock('Guzzle\\Service\\Command\\Factory\\FactoryInterface'); $mock->expects($this->any()) ->method('factory') ->with($this->equalTo('foo')) ->will($this->returnValue($mockCommand)); $client->setCommandFactory($mock); $command = $client->getCommand('foo', array('acl' => '123')); $this->assertSame($mockCommand, $command); $command = $client->getCommand('foo', array('acl' => '123')); $this->assertSame($mockCommand, $command); $this->assertSame($client, $command->getClient()); } /** * @covers Guzzle\Service\Client::getDescription * @covers Guzzle\Service\Client::setDescription */ public function testOwnsServiceDescription() { $client = new Mock\MockClient(); $this->assertNull($client->getDescription()); $description = $this->getMock('Guzzle\\Service\\Description\\ServiceDescription'); $this->assertSame($client, $client->setDescription($description)); $this->assertSame($description, $client->getDescription()); } /** * @covers Guzzle\Service\Client::__call * @expectedException BadMethodCallException */ public function testMagicCallBehaviorCanBeDisabled() { $client = new Client(); $client->enableMagicMethods(false); $client->foo(); } /** * @covers Guzzle\Service\Client::__call * @covers Guzzle\Service\Client::enableMagicMethods * @expectedException InvalidArgumentException * @expectedExceptionMessage Command was not found matching foo */ public function testMagicCallBehaviorEnsuresCommandExists() { $client = new Mock\MockClient(); $client->setDescription($this->service); $client->enableMagicMethods(true); $client->foo(); } /** * @covers Guzzle\Service\Client::__call */ public function testMagicCallBehaviorExecuteExecutesCommands() { $client = new Mock\MockClient(); $client->setDescription($this->service); $client->getEventDispatcher()->addSubscriber(new MockPlugin(array(new Response(200)))); $result = $client->mockCommand(); $this->assertInstanceOf('Guzzle\Http\Message\Response', $result); } /** * @covers Guzzle\Service\Client::getResourceIteratorFactory * @covers Guzzle\Service\Client::setResourceIteratorFactory */ public function testOwnsResourceIteratorFactory() { $client = new Mock\MockClient(); $method = new \ReflectionMethod($client, 'getResourceIteratorFactory'); $method->setAccessible(TRUE); $rf1 = $method->invoke($client); $rf = $this->readAttribute($client, 'resourceIteratorFactory'); $this->assertInstanceOf('Guzzle\\Service\\Resource\\ResourceIteratorClassFactory', $rf); $this->assertSame($rf1, $rf); $rf = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock'); $client->setResourceIteratorFactory($rf); $this->assertNotSame($rf1, $rf); } /** * @covers Guzzle\Service\Client::execute */ public function testClientResetsRequestsBeforeExecutingCommands() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nHi", "HTTP/1.1 200 OK\r\nContent-Length: 1\r\n\r\nI" )); $client = new Mock\MockClient($this->getServer()->getUrl()); $command = $client->getCommand('mock_command'); $client->execute($command); $client->execute($command); $this->assertEquals('I', $command->getResponse()->getBody(true)); } /** * @covers Guzzle\Service\Client::getIterator */ public function testClientCreatesIterators() { $client = new Mock\MockClient(); $iterator = $client->getIterator('mock_command', array( 'foo' => 'bar' ), array( 'limit' => 10 )); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); $this->assertEquals(10, $this->readAttribute($iterator, 'limit')); $command = $this->readAttribute($iterator, 'originalCommand'); $this->assertEquals('bar', $command->get('foo')); } /** * @covers Guzzle\Service\Client::getIterator */ public function testClientCreatesIteratorsWithNoOptions() { $client = new Mock\MockClient(); $iterator = $client->getIterator('mock_command'); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); } /** * @covers Guzzle\Service\Client::getIterator */ public function testClientCreatesIteratorsWithCommands() { $client = new Mock\MockClient(); $command = new MockCommand(); $iterator = $client->getIterator($command); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); $iteratorCommand = $this->readAttribute($iterator, 'originalCommand'); $this->assertSame($command, $iteratorCommand); } /** * @covers Guzzle\Service\Client::getInflector * @covers Guzzle\Service\Client::setInflector */ public function testClientHoldsInflector() { $client = new Mock\MockClient(); $this->assertInstanceOf('Guzzle\Inflection\MemoizingInflector', $client->getInflector()); $inflector = new Inflector(); $client->setInflector($inflector); $this->assertSame($inflector, $client->getInflector()); } /** * @covers Guzzle\Service\Client::getCommand */ public function testClientAddsGlobalCommandOptions() { $client = new Mock\MockClient('http://www.foo.com', array( Client::COMMAND_PARAMS => array( 'mesa' => 'bar' ) )); $command = $client->getCommand('mock_command'); $this->assertEquals('bar', $command->get('mesa')); } public function testSupportsServiceDescriptionBaseUrls() { $description = new ServiceDescription(array('baseUrl' => 'http://foo.com')); $client = new Client(); $client->setDescription($description); $this->assertEquals('http://foo.com', $client->getBaseUrl()); } public function testMergesDefaultCommandParamsCorrectly() { $client = new Mock\MockClient('http://www.foo.com', array( Client::COMMAND_PARAMS => array( 'mesa' => 'bar', 'jar' => 'jar' ) )); $command = $client->getCommand('mock_command', array('jar' => 'test')); $this->assertEquals('bar', $command->get('mesa')); $this->assertEquals('test', $command->get('jar')); } /** * @expectedException \Guzzle\Http\Exception\BadResponseException */ public function testWrapsSingleCommandExceptions() { $client = new Mock\MockClient('http://foobaz.com'); $mock = new MockPlugin(array(new Response(401))); $client->addSubscriber($mock); $client->execute(new MockCommand()); } public function testWrapsMultipleCommandExceptions() { $client = new Mock\MockClient('http://foobaz.com'); $mock = new MockPlugin(array(new Response(200), new Response(200), new Response(404), new Response(500))); $client->addSubscriber($mock); $cmds = array(new MockCommand(), new MockCommand(), new MockCommand(), new MockCommand()); try { $client->execute($cmds); } catch (CommandTransferException $e) { $this->assertEquals(2, count($e->getFailedRequests())); $this->assertEquals(2, count($e->getFailedCommands())); $this->assertEquals(2, count($e->getSuccessfulRequests())); $this->assertEquals(2, count($e->getSuccessfulCommands())); foreach ($e->getSuccessfulCommands() as $c) { $this->assertTrue($c->getResponse()->isSuccessful()); } foreach ($e->getFailedCommands() as $c) { $this->assertFalse($c->getRequest()->getResponse()->isSuccessful()); } } } } tests/Guzzle/Tests/Service/Command/AbstractCommandTest.php000064400000000647151742734620017703 0ustar00setDescription(ServiceDescription::factory(__DIR__ . '/../../TestData/test_service.json')); } } tests/Guzzle/Tests/Service/Command/ClosureCommandTest.php000064400000003356151742734620017554 0ustar00 function($command, $api) { $command->set('testing', '123'); $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/'); return $request; } )); $client = $this->getServiceBuilder()->get('mock'); $c->setClient($client)->prepare(); $this->assertEquals('123', $c->get('testing')); $this->assertEquals('http://www.test.com/', $c->getRequest()->getUrl()); } /** * @covers Guzzle\Service\Command\ClosureCommand * @expectedException UnexpectedValueException * @expectedExceptionMessage Closure command did not return a RequestInterface object */ public function testMustReturnRequest() { $c = new ClosureCommand(array( 'closure' => function($command, $api) { return false; } )); $client = $this->getServiceBuilder()->get('mock'); $c->setClient($client)->prepare(); } } tests/Guzzle/Tests/Service/Command/CommandTest.php000064400000041271151742734620016215 0ustar00assertEquals('123', $command->get('test')); $this->assertFalse($command->isPrepared()); $this->assertFalse($command->isExecuted()); } /** * @covers Guzzle\Service\Command\AbstractCommand::getName */ public function testDeterminesShortName() { $api = new Operation(array('name' => 'foobar')); $command = new MockCommand(array(), $api); $this->assertEquals('foobar', $command->getName()); $command = new MockCommand(); $this->assertEquals('mock_command', $command->getName()); $command = new Sub(); $this->assertEquals('sub.sub', $command->getName()); } /** * @covers Guzzle\Service\Command\AbstractCommand::getRequest * @expectedException RuntimeException */ public function testGetRequestThrowsExceptionBeforePreparation() { $command = new MockCommand(); $command->getRequest(); } /** * @covers Guzzle\Service\Command\AbstractCommand::getResponse */ public function testGetResponseExecutesCommandsWhenNeeded() { $response = new Response(200); $client = $this->getClient(); $this->setMockResponse($client, array($response)); $command = new MockCommand(); $command->setClient($client); $this->assertSame($response, $command->getResponse()); $this->assertSame($response, $command->getResponse()); } /** * @covers Guzzle\Service\Command\AbstractCommand::getResult */ public function testGetResultExecutesCommandsWhenNeeded() { $response = new Response(200); $client = $this->getClient(); $this->setMockResponse($client, array($response)); $command = new MockCommand(); $command->setClient($client); $this->assertSame($response, $command->getResult()); $this->assertSame($response, $command->getResult()); } /** * @covers Guzzle\Service\Command\AbstractCommand::setClient * @covers Guzzle\Service\Command\AbstractCommand::getClient * @covers Guzzle\Service\Command\AbstractCommand::prepare * @covers Guzzle\Service\Command\AbstractCommand::isPrepared */ public function testSetClient() { $command = new MockCommand(); $client = $this->getClient(); $command->setClient($client); $this->assertEquals($client, $command->getClient()); unset($client); unset($command); $command = new MockCommand(); $client = $this->getClient(); $command->setClient($client)->prepare(); $this->assertEquals($client, $command->getClient()); $this->assertTrue($command->isPrepared()); } /** * @covers Guzzle\Service\Command\AbstractCommand::execute * @covers Guzzle\Service\Command\AbstractCommand::setClient * @covers Guzzle\Service\Command\AbstractCommand::getRequest * @covers Guzzle\Service\Command\AbstractCommand::getResponse * @covers Guzzle\Service\Command\AbstractCommand::getResult * @covers Guzzle\Service\Command\AbstractCommand::prepare * @covers Guzzle\Service\Command\AbstractCommand::process * @covers Guzzle\Service\Command\AbstractCommand::prepare * @covers Guzzle\Service\Client::execute */ public function testExecute() { $client = $this->getClient(); $response = new Response(200, array( 'Content-Type' => 'application/xml' ), '123'); $this->setMockResponse($client, array($response)); $command = new MockCommand(); $this->assertSame($command, $command->setClient($client)); // Returns the result of the command $this->assertInstanceOf('SimpleXMLElement', $command->execute()); $this->assertTrue($command->isPrepared()); $this->assertTrue($command->isExecuted()); $this->assertSame($response, $command->getResponse()); $this->assertInstanceOf('Guzzle\\Http\\Message\\Request', $command->getRequest()); // Make sure that the result was automatically set to a SimpleXMLElement $this->assertInstanceOf('SimpleXMLElement', $command->getResult()); $this->assertEquals('123', (string)$command->getResult()->data); } /** * @covers Guzzle\Service\Command\AbstractCommand::process */ public function testConvertsJsonResponsesToArray() { $client = $this->getClient(); $this->setMockResponse($client, array( new \Guzzle\Http\Message\Response(200, array( 'Content-Type' => 'application/json' ), '{ "key": "Hi!" }' ) )); $command = new MockCommand(); $command->setClient($client); $command->execute(); $this->assertEquals(array( 'key' => 'Hi!' ), $command->getResult()); } /** * @covers Guzzle\Service\Command\AbstractCommand::process * @expectedException \Guzzle\Common\Exception\RuntimeException */ public function testConvertsInvalidJsonResponsesToArray() { $client = $this->getClient(); $this->setMockResponse($client, array( new \Guzzle\Http\Message\Response(200, array( 'Content-Type' => 'application/json' ), '{ "key": "Hi!" }invalid' ) )); $command = new MockCommand(); $command->setClient($client); $command->execute(); } /** * @covers Guzzle\Service\Command\AbstractCommand::process */ public function testProcessResponseIsNotXml() { $client = $this->getClient(); $this->setMockResponse($client, array( new Response(200, array( 'Content-Type' => 'application/octet-stream' ), 'abc,def,ghi') )); $command = new MockCommand(); $client->execute($command); // Make sure that the result was not converted to XML $this->assertFalse($command->getResult() instanceof \SimpleXMLElement); } /** * @covers Guzzle\Service\Command\AbstractCommand::execute * @expectedException RuntimeException */ public function testExecuteThrowsExceptionWhenNoClientIsSet() { $command = new MockCommand(); $command->execute(); } /** * @covers Guzzle\Service\Command\AbstractCommand::prepare * @expectedException RuntimeException */ public function testPrepareThrowsExceptionWhenNoClientIsSet() { $command = new MockCommand(); $command->prepare(); } /** * @covers Guzzle\Service\Command\AbstractCommand::prepare * @covers Guzzle\Service\Command\AbstractCommand::getRequestHeaders */ public function testCommandsAllowsCustomRequestHeaders() { $command = new MockCommand(); $command->getRequestHeaders()->set('test', '123'); $this->assertInstanceOf('Guzzle\Common\Collection', $command->getRequestHeaders()); $this->assertEquals('123', $command->getRequestHeaders()->get('test')); $command->setClient($this->getClient())->prepare(); $this->assertEquals('123', (string) $command->getRequest()->getHeader('test')); } /** * @covers Guzzle\Service\Command\AbstractCommand::__construct */ public function testCommandsAllowsCustomRequestHeadersAsArray() { $command = new MockCommand(array(AbstractCommand::HEADERS_OPTION => array('Foo' => 'Bar'))); $this->assertInstanceOf('Guzzle\Common\Collection', $command->getRequestHeaders()); $this->assertEquals('Bar', $command->getRequestHeaders()->get('Foo')); } private function getOperation() { return new Operation(array( 'name' => 'foobar', 'httpMethod' => 'POST', 'class' => 'Guzzle\\Tests\\Service\\Mock\\Command\\MockCommand', 'parameters' => array( 'test' => array( 'default' => '123', 'type' => 'string' ) ))); } /** * @covers Guzzle\Service\Command\AbstractCommand */ public function testCommandsUsesOperation() { $api = $this->getOperation(); $command = new MockCommand(array(), $api); $this->assertSame($api, $command->getOperation()); $command->setClient($this->getClient())->prepare(); $this->assertEquals('123', $command->get('test')); $this->assertSame($api, $command->getOperation($api)); } /** * @covers Guzzle\Service\Command\AbstractCommand::__clone */ public function testCloneMakesNewRequest() { $client = $this->getClient(); $command = new MockCommand(array(), $this->getOperation()); $command->setClient($client); $command->prepare(); $this->assertTrue($command->isPrepared()); $command2 = clone $command; $this->assertFalse($command2->isPrepared()); } /** * @covers Guzzle\Service\Command\AbstractCommand::setOnComplete * @covers Guzzle\Service\Command\AbstractCommand::__construct * @covers Guzzle\Service\Command\AbstractCommand::getResult */ public function testHasOnCompleteMethod() { $that = $this; $called = 0; $testFunction = function($command) use (&$called, $that) { $called++; $that->assertInstanceOf('Guzzle\Service\Command\CommandInterface', $command); }; $client = $this->getClient(); $command = new MockCommand(array( 'command.on_complete' => $testFunction ), $this->getOperation()); $command->setClient($client); $command->prepare()->setResponse(new Response(200), true); $command->execute(); $this->assertEquals(1, $called); } /** * @covers Guzzle\Service\Command\AbstractCommand::setOnComplete * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testOnCompleteMustBeCallable() { $client = $this->getClient(); $command = new MockCommand(); $command->setOnComplete('foo'); } /** * @covers Guzzle\Service\Command\AbstractCommand::setResult */ public function testCanSetResultManually() { $client = $this->getClient(); $client->getEventDispatcher()->addSubscriber(new MockPlugin(array( new Response(200) ))); $command = new MockCommand(); $client->execute($command); $command->setResult('foo!'); $this->assertEquals('foo!', $command->getResult()); } /** * @covers Guzzle\Service\Command\AbstractCommand */ public function testCanInitConfig() { $command = $this->getMockBuilder('Guzzle\\Service\\Command\\AbstractCommand') ->setConstructorArgs(array(array( 'foo' => 'bar' ), new Operation(array( 'parameters' => array( 'baz' => new Parameter(array( 'default' => 'baaar' )) ) )))) ->getMockForAbstractClass(); $this->assertEquals('bar', $command['foo']); $this->assertEquals('baaar', $command['baz']); } /** * @covers Guzzle\Service\Command\AbstractCommand::prepare */ public function testAddsCurlOptionsToRequestsWhenPreparing() { $command = new MockCommand(array( 'foo' => 'bar', 'curl.options' => array('CURLOPT_PROXYPORT' => 8080) )); $client = new Client(); $command->setClient($client); $request = $command->prepare(); $this->assertEquals(8080, $request->getCurlOptions()->get(CURLOPT_PROXYPORT)); } /** * @covers Guzzle\Service\Command\AbstractCommand::__invoke */ public function testIsInvokable() { $client = $this->getClient(); $response = new Response(200); $this->setMockResponse($client, array($response)); $command = new MockCommand(); $command->setClient($client); // Returns the result of the command $this->assertSame($response, $command()); } /** * @covers Guzzle\Service\Command\AbstractCommand::__construct * @covers Guzzle\Service\Command\AbstractCommand::createOperation */ public function testCreatesDefaultOperation() { $command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')->getMockForAbstractClass(); $this->assertInstanceOf('Guzzle\Service\Description\Operation', $command->getOperation()); } public function testAllowsValidatorToBeInjected() { $command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')->getMockForAbstractClass(); $v = new SchemaValidator(); $command->setValidator($v); $this->assertSame($v, $this->readAttribute($command, 'validator')); } public function testCanDisableValidation() { $command = new MockCommand(); $command->setClient(new \Guzzle\Service\Client()); $v = $this->getMockBuilder('Guzzle\Service\Description\SchemaValidator') ->setMethods(array('validate')) ->getMock(); $v->expects($this->never())->method('validate'); $command->setValidator($v); $command->set(AbstractCommand::DISABLE_VALIDATION, true); $command->prepare(); } public function testValidatorDoesNotUpdateNonDefaultValues() { $command = new MockCommand(array('test' => 123, 'foo' => 'bar')); $command->setClient(new \Guzzle\Service\Client()); $command->prepare(); $this->assertEquals(123, $command->get('test')); $this->assertEquals('bar', $command->get('foo')); } public function testValidatorUpdatesDefaultValues() { $command = new MockCommand(); $command->setClient(new \Guzzle\Service\Client()); $command->prepare(); $this->assertEquals(123, $command->get('test')); $this->assertEquals('abc', $command->get('_internal')); } /** * @expectedException \Guzzle\Service\Exception\ValidationException * @expectedExceptionMessage [Foo] Baz */ public function testValidatesCommandBeforeSending() { $command = new MockCommand(); $command->setClient(new \Guzzle\Service\Client()); $v = $this->getMockBuilder('Guzzle\Service\Description\SchemaValidator') ->setMethods(array('validate', 'getErrors')) ->getMock(); $v->expects($this->any())->method('validate')->will($this->returnValue(false)); $v->expects($this->any())->method('getErrors')->will($this->returnValue(array('[Foo] Baz', '[Bar] Boo'))); $command->setValidator($v); $command->prepare(); } /** * @expectedException \Guzzle\Service\Exception\ValidationException * @expectedExceptionMessage Validation errors: [abc] must be of type string */ public function testValidatesAdditionalProperties() { $description = ServiceDescription::factory(array( 'operations' => array( 'foo' => array( 'parameters' => array( 'baz' => array('type' => 'integer') ), 'additionalParameters' => array( 'type' => 'string' ) ) ) )); $client = new Client(); $client->setDescription($description); $command = $client->getCommand('foo', array('abc' => false)); $command->prepare(); } public function testCanChangeResponseBody() { $body = EntityBody::factory(); $command = new MockCommand(); $command->setClient(new \Guzzle\Service\Client()); $command->set(AbstractCommand::RESPONSE_BODY, $body); $request = $command->prepare(); $this->assertSame($body, $this->readAttribute($request, 'responseBody')); } } tests/Guzzle/Tests/Service/Command/DefaultRequestSerializerTest.php000064400000010341151742734620021620 0ustar00serializer = DefaultRequestSerializer::getInstance(); $this->client = new Client('http://foo.com/baz'); $this->operation = new Operation(array('httpMethod' => 'POST')); $this->command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand') ->setConstructorArgs(array(array(), $this->operation)) ->getMockForAbstractClass(); $this->command->setClient($this->client); } public function testAllowsCustomVisitor() { $this->serializer->addVisitor('custom', new HeaderVisitor()); $this->command['test'] = '123'; $this->operation->addParam(new Parameter(array('name' => 'test', 'location' => 'custom'))); $request = $this->serializer->prepare($this->command); $this->assertEquals('123', (string) $request->getHeader('test')); } public function testUsesRelativePath() { $this->operation->setUri('bar'); $request = $this->serializer->prepare($this->command); $this->assertEquals('http://foo.com/baz/bar', (string) $request->getUrl()); } public function testUsesRelativePathWithUriLocations() { $this->command['test'] = '123'; $this->operation->setUri('bar/{test}'); $this->operation->addParam(new Parameter(array('name' => 'test', 'location' => 'uri'))); $request = $this->serializer->prepare($this->command); $this->assertEquals('http://foo.com/baz/bar/123', (string) $request->getUrl()); } public function testAllowsCustomFactory() { $f = new VisitorFlyweight(); $serializer = new DefaultRequestSerializer($f); $this->assertSame($f, $this->readAttribute($serializer, 'factory')); } public function testMixedParams() { $this->operation->setUri('bar{?limit,fields}'); $this->operation->addParam(new Parameter(array( 'name' => 'limit', 'location' => 'uri', 'required' => false, ))); $this->operation->addParam(new Parameter(array( 'name' => 'fields', 'location' => 'uri', 'required' => true, ))); $this->command['fields'] = array('id', 'name'); $request = $this->serializer->prepare($this->command); $this->assertEquals('http://foo.com/baz/bar?fields='.urlencode('id,name'), (string) $request->getUrl()); } public function testValidatesAdditionalParameters() { $description = ServiceDescription::factory(array( 'operations' => array( 'foo' => array( 'httpMethod' => 'PUT', 'parameters' => array( 'bar' => array('location' => 'header') ), 'additionalParameters' => array( 'location' => 'json' ) ) ) )); $client = new Client(); $client->setDescription($description); $command = $client->getCommand('foo'); $command['bar'] = 'test'; $command['hello'] = 'abc'; $request = $command->prepare(); $this->assertEquals('test', (string) $request->getHeader('bar')); $this->assertEquals('{"hello":"abc"}', (string) $request->getBody()); } } tests/Guzzle/Tests/Service/Command/DefaultResponseParserTest.php000064400000003777151742734620021130 0ustar00setClient(new Client()); $request = $op->prepare(); $request->setResponse(new Response(200, array( 'Content-Type' => 'application/xml' ), 'Bar'), true); $this->assertInstanceOf('SimpleXMLElement', $op->execute()); } public function testParsesJsonResponses() { $op = new OperationCommand(array(), new Operation()); $op->setClient(new Client()); $request = $op->prepare(); $request->setResponse(new Response(200, array( 'Content-Type' => 'application/json' ), '{"Baz":"Bar"}'), true); $this->assertEquals(array('Baz' => 'Bar'), $op->execute()); } /** * @expectedException \Guzzle\Common\Exception\RuntimeException */ public function testThrowsExceptionWhenParsingJsonFails() { $op = new OperationCommand(array(), new Operation()); $op->setClient(new Client()); $request = $op->prepare(); $request->setResponse(new Response(200, array('Content-Type' => 'application/json'), '{"Baz":ddw}'), true); $op->execute(); } public function testAddsContentTypeWhenExpectsIsSetOnCommand() { $op = new OperationCommand(array(), new Operation()); $op['command.expects'] = 'application/json'; $op->setClient(new Client()); $request = $op->prepare(); $request->setResponse(new Response(200, null, '{"Baz":"Bar"}'), true); $this->assertEquals(array('Baz' => 'Bar'), $op->execute()); } } tests/Guzzle/Tests/Service/Command/Factory/AliasFactoryTest.php000064400000004537151742734620020633 0ustar00client = new Client(); $map = new MapFactory(array( 'test' => 'Guzzle\Tests\Service\Mock\Command\MockCommand', 'test1' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand' )); $this->factory = new AliasFactory($this->client, array( 'foo' => 'test', 'bar' => 'sub', 'sub' => 'test1', 'krull' => 'test3', 'krull_2' => 'krull', 'sub_2' => 'bar', 'bad_link' => 'jarjar' )); $map2 = new MapFactory(array( 'test3' => 'Guzzle\Tests\Service\Mock\Command\Sub\Sub' )); $this->client->setCommandFactory(new CompositeFactory(array($map, $this->factory, $map2))); } public function aliasProvider() { return array( array('foo', 'Guzzle\Tests\Service\Mock\Command\MockCommand', false), array('bar', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', false), array('sub', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', false), array('sub_2', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', false), array('krull', 'Guzzle\Tests\Service\Mock\Command\Sub\Sub', false), array('krull_2', 'Guzzle\Tests\Service\Mock\Command\Sub\Sub', false), array('missing', null, true), array('bad_link', null, true) ); } /** * @covers Guzzle\Service\Command\Factory\AliasFactory * @dataProvider aliasProvider */ public function testAliasesCommands($key, $result, $exception) { try { $command = $this->client->getCommand($key); if (is_null($result)) { $this->assertNull($command); } else { $this->assertInstanceof($result, $command); } } catch (\Exception $e) { if (!$exception) { $this->fail('Got exception when it was not expected'); } } } } tests/Guzzle/Tests/Service/Command/Factory/CompositeFactoryTest.php000064400000013055151742734620021537 0ustar00getMockBuilder($class) ->disableOriginalConstructor() ->getMock(); } /** * @covers Guzzle\Service\Command\Factory\CompositeFactory::getIterator * @covers Guzzle\Service\Command\Factory\CompositeFactory::count */ public function testIsIterable() { $factory = new CompositeFactory(array($this->getFactory(), $this->getFactory())); $this->assertEquals(2, count($factory)); $this->assertEquals(2, count(iterator_to_array($factory->getIterator()))); } /** * @covers Guzzle\Service\Command\Factory\CompositeFactory::find * @covers Guzzle\Service\Command\Factory\CompositeFactory::has */ public function testFindsFactories() { $f1 = $this->getFactory(); $f2 = $this->getFactory('Guzzle\\Service\\Command\\Factory\\CompositeFactory'); $factory = new CompositeFactory(array($f1, $f2)); $this->assertNull($factory->find('foo')); $this->assertNull($factory->find($this->getFactory())); $this->assertSame($f1, $factory->find('Guzzle\\Service\\Command\\Factory\\MapFactory')); $this->assertSame($f2, $factory->find('Guzzle\\Service\\Command\\Factory\\CompositeFactory')); $this->assertSame($f1, $factory->find($f1)); $this->assertSame($f2, $factory->find($f2)); $this->assertFalse($factory->has('foo')); $this->assertTrue($factory->has('Guzzle\\Service\\Command\\Factory\\MapFactory')); $this->assertTrue($factory->has('Guzzle\\Service\\Command\\Factory\\CompositeFactory')); } /** * @covers Guzzle\Service\Command\Factory\CompositeFactory::factory * @covers Guzzle\Service\Command\Factory\CompositeFactory::__construct */ public function testCreatesCommands() { $factory = new CompositeFactory(); $this->assertNull($factory->factory('foo')); $f1 = $this->getFactory(); $mockCommand1 = $this->getMockForAbstractClass('Guzzle\\Service\\Command\\AbstractCommand'); $f1->expects($this->once()) ->method('factory') ->with($this->equalTo('foo')) ->will($this->returnValue($mockCommand1)); $factory = new CompositeFactory(array($f1)); $this->assertSame($mockCommand1, $factory->factory('foo')); } /** * @covers Guzzle\Service\Command\Factory\CompositeFactory::remove */ public function testAllowsRemovalOfFactories() { $f1 = $this->getFactory(); $f2 = $this->getFactory(); $f3 = $this->getFactory('Guzzle\\Service\\Command\\Factory\\CompositeFactory'); $factories = array($f1, $f2, $f3); $factory = new CompositeFactory($factories); $factory->remove('foo'); $this->assertEquals($factories, $factory->getIterator()->getArrayCopy()); $factory->remove($f1); $this->assertEquals(array($f2, $f3), $factory->getIterator()->getArrayCopy()); $factory->remove('Guzzle\\Service\\Command\\Factory\\MapFactory'); $this->assertEquals(array($f3), $factory->getIterator()->getArrayCopy()); $factory->remove('Guzzle\\Service\\Command\\Factory\\CompositeFactory'); $this->assertEquals(array(), $factory->getIterator()->getArrayCopy()); $factory->remove('foo'); $this->assertEquals(array(), $factory->getIterator()->getArrayCopy()); } /** * @covers Guzzle\Service\Command\Factory\CompositeFactory::add */ public function testAddsFactoriesBeforeAndAtEnd() { $f1 = $this->getFactory(); $f2 = $this->getFactory(); $f3 = $this->getFactory('Guzzle\\Service\\Command\\Factory\\CompositeFactory'); $f4 = $this->getFactory(); $factory = new CompositeFactory(); $factory->add($f1); $this->assertEquals(array($f1), $factory->getIterator()->getArrayCopy()); $factory->add($f2); $this->assertEquals(array($f1, $f2), $factory->getIterator()->getArrayCopy()); $factory->add($f3, $f2); $this->assertEquals(array($f1, $f3, $f2), $factory->getIterator()->getArrayCopy()); $factory->add($f4, 'Guzzle\\Service\\Command\\Factory\\CompositeFactory'); $this->assertEquals(array($f1, $f4, $f3, $f2), $factory->getIterator()->getArrayCopy()); } /** * @covers Guzzle\Service\Command\Factory\CompositeFactory::getDefaultChain */ public function testProvidesDefaultChainForClients() { $client = $this->getMock('Guzzle\\Service\\Client'); $chain = CompositeFactory::getDefaultChain($client); $a = $chain->getIterator()->getArrayCopy(); $this->assertEquals(1, count($a)); $this->assertInstanceOf('Guzzle\\Service\\Command\\Factory\\ConcreteClassFactory', $a[0]); $description = $this->getMock('Guzzle\\Service\\Description\\ServiceDescription'); $client->expects($this->once()) ->method('getDescription') ->will($this->returnValue($description)); $chain = CompositeFactory::getDefaultChain($client); $a = $chain->getIterator()->getArrayCopy(); $this->assertEquals(2, count($a)); $this->assertInstanceOf('Guzzle\\Service\\Command\\Factory\\ServiceDescriptionFactory', $a[0]); $this->assertInstanceOf('Guzzle\\Service\\Command\\Factory\\ConcreteClassFactory', $a[1]); } } tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php000064400000003321151742734620022320 0ustar00 $prefix )); } $factory = new ConcreteClassFactory($client); if (is_null($result)) { $this->assertNull($factory->factory($key)); } else { $this->assertInstanceof($result, $factory->factory($key)); } } } tests/Guzzle/Tests/Service/Command/Factory/MapFactoryTest.php000064400000001741151742734620020311 0ustar00 'Guzzle\Tests\Service\Mock\Command\MockCommand', 'test1' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand' )); if (is_null($result)) { $this->assertNull($factory->factory($key)); } else { $this->assertInstanceof($result, $factory->factory($key)); } } } tests/Guzzle/Tests/Service/Command/Factory/ServiceDescriptionFactoryTest.php000064400000004154151742734620023401 0ustar00getDescription(); $factory = new ServiceDescriptionFactory($d); $this->assertSame($d, $factory->getServiceDescription()); if (is_null($result)) { $this->assertNull($factory->factory($key)); } else { $this->assertInstanceof($result, $factory->factory($key)); } } public function testUsesInflectionIfNoExactMatch() { $d = $this->getDescription(); $factory = new ServiceDescriptionFactory($d, new Inflector()); $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\OtherCommand', $factory->factory('Binks')); $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\OtherCommand', $factory->factory('binks')); $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\MockCommand', $factory->factory('JarJar')); $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\MockCommand', $factory->factory('jar_jar')); } protected function getDescription() { return ServiceDescription::factory(array( 'operations' => array( 'jar_jar' => array( 'class' => 'Guzzle\Tests\Service\Mock\Command\MockCommand' ), 'binks' => array( 'class' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand' ) ) )); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/AbstractVisitorTestCase.php000064400000007566151742734620025347 0ustar00command = new MockCommand(); $this->request = new EntityEnclosingRequest('POST', 'http://www.test.com'); $this->validator = new SchemaValidator(); } protected function getCommand($location) { $command = new OperationCommand(array(), $this->getNestedCommand($location)); $command->setClient(new MockClient()); return $command; } protected function getNestedCommand($location) { return new Operation(array( 'httpMethod' => 'POST', 'parameters' => array( 'foo' => new Parameter(array( 'type' => 'object', 'location' => $location, 'sentAs' => 'Foo', 'required' => true, 'properties' => array( 'test' => array( 'type' => 'object', 'required' => true, 'properties' => array( 'baz' => array( 'type' => 'boolean', 'default' => true ), 'jenga' => array( 'type' => 'string', 'default' => 'hello', 'sentAs' => 'Jenga_Yall!', 'filters' => array('strtoupper') ) ) ), 'bar' => array('default' => 123) ), 'additionalProperties' => array( 'type' => 'string', 'filters' => array('strtoupper'), 'location' => $location ) )), 'arr' => new Parameter(array( 'type' => 'array', 'location' => $location, 'items' => array( 'type' => 'string', 'filters' => array('strtoupper') ) )), ) )); } protected function getCommandWithArrayParamAndFilters() { $operation = new Operation(array( 'httpMethod' => 'POST', 'parameters' => array( 'foo' => new Parameter(array( 'type' => 'string', 'location' => 'query', 'sentAs' => 'Foo', 'required' => true, 'default' => 'bar', 'filters' => array('strtoupper') )), 'arr' => new Parameter(array( 'type' => 'array', 'location' => 'query', 'sentAs' => 'Arr', 'required' => true, 'default' => array(123, 456, 789), 'filters' => array(array('method' => 'implode', 'args' => array(',', '@value'))) )) ) )); $command = new OperationCommand(array(), $operation); $command->setClient(new MockClient()); return $command; } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/BodyVisitorTest.php000064400000004764151742734620023702 0ustar00getNestedCommand('body')->getParam('foo')->setSentAs('Foo'); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertEquals('123', (string) $this->request->getBody()); $this->assertNull($this->request->getHeader('Expect')); } public function testAddsExpectHeaderWhenSetToTrue() { $visitor = new Visitor(); $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo'); $param->setData('expect_header', true); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertEquals('123', (string) $this->request->getBody()); } public function testCanDisableExpectHeader() { $visitor = new Visitor(); $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo'); $param->setData('expect_header', false); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertNull($this->request->getHeader('Expect')); } public function testCanSetExpectHeaderBasedOnSize() { $visitor = new Visitor(); $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo'); // The body is less than the cutoff $param->setData('expect_header', 5); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertNull($this->request->getHeader('Expect')); // Now check when the body is greater than the cutoff $param->setData('expect_header', 2); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertEquals('100-Continue', (string) $this->request->getHeader('Expect')); } public function testAddsContentEncodingWhenSetOnBody() { $visitor = new Visitor(); $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo'); $body = EntityBody::factory('foo'); $body->compress(); $visitor->visit($this->command, $this->request, $param, $body); $this->assertEquals('gzip', (string) $this->request->getHeader('Content-Encoding')); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/HeaderVisitorTest.php000064400000003346151742734620024170 0ustar00getNestedCommand('header')->getParam('foo')->setSentAs('test'); $param->setAdditionalProperties(new Parameter(array())); $visitor->visit($this->command, $this->request, $param, 'test'); } public function testVisitsLocation() { $visitor = new Visitor(); $param = $this->getNestedCommand('header')->getParam('foo')->setSentAs('test'); $param->setAdditionalProperties(false); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertEquals('123', (string) $this->request->getHeader('test')); } public function testVisitsMappedPrefixHeaders() { $visitor = new Visitor(); $param = $this->getNestedCommand('header')->getParam('foo')->setSentAs('test'); $param->setSentAs('x-foo-'); $param->setAdditionalProperties(new Parameter(array( 'type' => 'string' ))); $visitor->visit($this->command, $this->request, $param, array( 'bar' => 'test', 'baz' => '123' )); $this->assertEquals('test', (string) $this->request->getHeader('x-foo-bar')); $this->assertEquals('123', (string) $this->request->getHeader('x-foo-baz')); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/JsonVisitorTest.php000064400000005266151742734620023714 0ustar00after($this->command, $this->request); $param = $this->getNestedCommand('json')->getParam('foo'); $visitor->visit($this->command, $this->request, $param->setSentAs('test'), '123'); $visitor->visit($this->command, $this->request, $param->setSentAs('test2'), 'abc'); $visitor->after($this->command, $this->request); $this->assertEquals('{"test":"123","test2":"abc"}', (string) $this->request->getBody()); } public function testAddsJsonHeader() { $visitor = new Visitor(); $visitor->setContentTypeHeader('application/json-foo'); $param = $this->getNestedCommand('json')->getParam('foo'); $visitor->visit($this->command, $this->request, $param->setSentAs('test'), '123'); $visitor->after($this->command, $this->request); $this->assertEquals('application/json-foo', (string) $this->request->getHeader('Content-Type')); } /** * @covers Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively */ public function testRecursivelyBuildsJsonBodies() { $command = $this->getCommand('json'); $request = $command->prepare(); $this->assertEquals('{"Foo":{"test":{"baz":true,"Jenga_Yall!":"HELLO"},"bar":123}}', (string) $request->getBody()); } /** * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively */ public function testAppliesFiltersToAdditionalProperties() { $command = $this->getCommand('json'); $command->set('foo', array('not_set' => 'abc')); $request = $command->prepare(); $result = json_decode($request->getBody(), true); $this->assertEquals('ABC', $result['Foo']['not_set']); } /** * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively */ public function testAppliesFiltersToArrayItemValues() { $command = $this->getCommand('json'); $command->set('arr', array('a', 'b')); $request = $command->prepare(); $result = json_decode($request->getBody(), true); $this->assertEquals(array('A', 'B'), $result['arr']); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFieldVisitorTest.php000064400000002226151742734620024665 0ustar00getNestedCommand('postField')->getParam('foo'); $visitor->visit($this->command, $this->request, $param->setSentAs('test'), '123'); $this->assertEquals('123', (string) $this->request->getPostField('test')); } public function testRecursivelyBuildsPostFields() { $command = $this->getCommand('postField'); $request = $command->prepare(); $visitor = new Visitor(); $param = $command->getOperation()->getParam('foo'); $visitor->visit($command, $request, $param, $command['foo']); $visitor->after($command, $request); $this->assertEquals( 'Foo[test][baz]=1&Foo[test][Jenga_Yall!]=HELLO&Foo[bar]=123', rawurldecode((string) $request->getPostFields()) ); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFileVisitorTest.php000064400000001645151742734620024525 0ustar00getNestedCommand('postFile')->getParam('foo'); // Test using a path to a file $visitor->visit($this->command, $this->request, $param->setSentAs('test_3'), __FILE__); $this->assertInternalType('array', $this->request->getPostFile('test_3')); // Test with a PostFile $visitor->visit($this->command, $this->request, $param->setSentAs(null), new PostFile('baz', __FILE__)); $this->assertInternalType('array', $this->request->getPostFile('baz')); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/QueryVisitorTest.php000064400000003256151742734620024105 0ustar00getNestedCommand('query')->getParam('foo')->setSentAs('test'); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertEquals('123', $this->request->getQuery()->get('test')); } /** * @covers Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively */ public function testRecursivelyBuildsQueryStrings() { $command = $this->getCommand('query'); $command->getOperation()->getParam('foo')->setSentAs('Foo'); $request = $command->prepare(); $this->assertEquals( 'Foo[test][baz]=1&Foo[test][Jenga_Yall!]=HELLO&Foo[bar]=123', rawurldecode($request->getQuery()) ); } /** * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively */ public function testFiltersAreAppliedToArrayParamType() { $command = $this->getCommandWithArrayParamAndFilters(); $request = $command->prepare(); $query = $request->getQuery(); // param type 'string' $this->assertEquals('BAR', $query->get('Foo')); // param type 'array' $this->assertEquals('123,456,789', $query->get('Arr')); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/ResponseBodyVisitorTest.php000064400000001273151742734620025411 0ustar00getNestedCommand('response_body')->getParam('foo'); $visitor->visit($this->command, $this->request, $param, sys_get_temp_dir() . '/foo.txt'); $body = $this->readAttribute($this->request, 'responseBody'); $this->assertContains('/foo.txt', $body->getUri()); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php000064400000047334151742734620023545 0ustar00 array( 'xmlRoot' => array( 'name' => 'test', 'namespaces' => 'http://foo.com' ) ), 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string'), 'Baz' => array('location' => 'xml', 'type' => 'string') ) ), array('Foo' => 'test', 'Baz' => 'bar'), 'testbar' ), // Ensure that the content-type is not added array(array('parameters' => array('Foo' => array('location' => 'xml', 'type' => 'string'))), array(), ''), // Test with adding attributes and no namespace array( array( 'data' => array( 'xmlRoot' => array( 'name' => 'test' ) ), 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string', 'data' => array('xmlAttribute' => true)) ) ), array('Foo' => 'test', 'Baz' => 'bar'), '' ), // Test adding with an array array( array( 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string'), 'Baz' => array( 'type' => 'array', 'location' => 'xml', 'items' => array( 'type' => 'numeric', 'sentAs' => 'Bar' ) ) ) ), array('Foo' => 'test', 'Baz' => array(1, 2)), 'test12' ), // Test adding an object array( array( 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string'), 'Baz' => array( 'type' => 'object', 'location' => 'xml', 'properties' => array( 'Bar' => array('type' => 'string'), 'Bam' => array() ) ) ) ), array('Foo' => 'test', 'Baz' => array('Bar' => 'abc', 'Bam' => 'foo')), 'testabcfoo' ), // Add an array that contains an object array( array( 'parameters' => array( 'Baz' => array( 'type' => 'array', 'location' => 'xml', 'items' => array( 'type' => 'object', 'sentAs' => 'Bar', 'properties' => array('A' => array(), 'B' => array()) ) ) ) ), array('Baz' => array( array('A' => '1', 'B' => '2'), array('A' => '3', 'B' => '4') )), '1234' ), // Add an object of attributes array( array( 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string'), 'Baz' => array( 'type' => 'object', 'location' => 'xml', 'properties' => array( 'Bar' => array('type' => 'string', 'data' => array('xmlAttribute' => true)), 'Bam' => array() ) ) ) ), array('Foo' => 'test', 'Baz' => array('Bar' => 'abc', 'Bam' => 'foo')), 'testfoo' ), // Add values with custom namespaces array( array( 'parameters' => array( 'Foo' => array( 'location' => 'xml', 'type' => 'string', 'data' => array( 'xmlNamespace' => 'http://foo.com' ) ) ) ), array('Foo' => 'test'), 'test' ), // Add attributes with custom namespace prefix array( array( 'parameters' => array( 'Wrap' => array( 'type' => 'object', 'location' => 'xml', 'properties' => array( 'Foo' => array( 'type' => 'string', 'sentAs' => 'xsi:baz', 'data' => array( 'xmlNamespace' => 'http://foo.com', 'xmlAttribute' => true ) ) ) ), ) ), array('Wrap' => array( 'Foo' => 'test' )), '' ), // Add nodes with custom namespace prefix array( array( 'parameters' => array( 'Wrap' => array( 'type' => 'object', 'location' => 'xml', 'properties' => array( 'Foo' => array( 'type' => 'string', 'sentAs' => 'xsi:Foo', 'data' => array( 'xmlNamespace' => 'http://foobar.com' ) ) ) ), ) ), array('Wrap' => array( 'Foo' => 'test' )), 'test' ), // Flat array at top level array( array( 'parameters' => array( 'Bars' => array( 'type' => 'array', 'data' => array('xmlFlattened' => true), 'location' => 'xml', 'items' => array( 'type' => 'object', 'sentAs' => 'Bar', 'properties' => array( 'A' => array(), 'B' => array() ) ) ), 'Boos' => array( 'type' => 'array', 'data' => array('xmlFlattened' => true), 'location' => 'xml', 'items' => array( 'sentAs' => 'Boo', 'type' => 'string' ) ) ) ), array( 'Bars' => array( array('A' => '1', 'B' => '2'), array('A' => '3', 'B' => '4') ), 'Boos' => array('test', '123') ), '1234test123' ), // Nested flat arrays array( array( 'parameters' => array( 'Delete' => array( 'type' => 'object', 'location' => 'xml', 'properties' => array( 'Items' => array( 'type' => 'array', 'data' => array('xmlFlattened' => true), 'items' => array( 'type' => 'object', 'sentAs' => 'Item', 'properties' => array( 'A' => array(), 'B' => array() ) ) ) ) ) ) ), array( 'Delete' => array( 'Items' => array( array('A' => '1', 'B' => '2'), array('A' => '3', 'B' => '4') ) ) ), '1234' ) ); } /** * @dataProvider xmlProvider */ public function testSerializesXml(array $operation, array $input, $xml) { $operation = new Operation($operation); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array($input, $operation)) ->getMockForAbstractClass(); $command->setClient(new Client()); $request = $command->prepare(); if (!empty($input)) { $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type')); } else { $this->assertNull($request->getHeader('Content-Type')); } $body = str_replace(array("\n", ""), '', (string) $request->getBody()); $this->assertEquals($xml, $body); } public function testAddsContentTypeAndTopLevelValues() { $operation = new Operation(array( 'data' => array( 'xmlRoot' => array( 'name' => 'test', 'namespaces' => array( 'xsi' => 'http://foo.com' ) ) ), 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string'), 'Baz' => array('location' => 'xml', 'type' => 'string') ) )); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array(array( 'Foo' => 'test', 'Baz' => 'bar' ), $operation)) ->getMockForAbstractClass(); $command->setClient(new Client()); $request = $command->prepare(); $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type')); $this->assertEquals( '' . "\n" . 'testbar' . "\n", (string) $request->getBody() ); } public function testCanChangeContentType() { $visitor = new XmlVisitor(); $visitor->setContentTypeHeader('application/foo'); $this->assertEquals('application/foo', $this->readAttribute($visitor, 'contentType')); } public function testCanAddArrayOfSimpleTypes() { $request = new EntityEnclosingRequest('POST', 'http://foo.com'); $visitor = new XmlVisitor(); $param = new Parameter(array( 'type' => 'object', 'location' => 'xml', 'name' => 'Out', 'properties' => array( 'Nodes' => array( 'required' => true, 'type' => 'array', 'min' => 1, 'items' => array('type' => 'string', 'sentAs' => 'Node') ) ) )); $param->setParent(new Operation(array( 'data' => array( 'xmlRoot' => array( 'name' => 'Test', 'namespaces' => array( 'https://foo/' ) ) ) ))); $value = array('Nodes' => array('foo', 'baz')); $this->assertTrue($this->validator->validate($param, $value)); $visitor->visit($this->command, $request, $param, $value); $visitor->after($this->command, $request); $this->assertEquals( "\n" . "foobaz\n", (string) $request->getBody() ); } public function testCanAddMultipleNamespacesToRoot() { $operation = new Operation(array( 'data' => array( 'xmlRoot' => array( 'name' => 'Hi', 'namespaces' => array( 'xsi' => 'http://foo.com', 'foo' => 'http://foobar.com' ) ) ), 'parameters' => array( 'Foo' => array('location' => 'xml', 'type' => 'string') ) )); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array(array( 'Foo' => 'test' ), $operation)) ->getMockForAbstractClass(); $command->setClient(new Client()); $request = $command->prepare(); $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type')); $this->assertEquals( '' . "\n" . 'test' . "\n", (string) $request->getBody() ); } public function testValuesAreFiltered() { $operation = new Operation(array( 'parameters' => array( 'Foo' => array( 'location' => 'xml', 'type' => 'string', 'filters' => array('strtoupper') ), 'Bar' => array( 'location' => 'xml', 'type' => 'object', 'properties' => array( 'Baz' => array( 'filters' => array('strtoupper') ) ) ) ) )); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array(array( 'Foo' => 'test', 'Bar' => array( 'Baz' => 'abc' ) ), $operation)) ->getMockForAbstractClass(); $command->setClient(new Client()); $request = $command->prepare(); $this->assertEquals( '' . "\n" . 'TESTABC' . "\n", (string) $request->getBody() ); } public function testSkipsNullValues() { $operation = new Operation(array( 'parameters' => array( 'Foo' => array( 'location' => 'xml', 'type' => 'string' ), 'Bar' => array( 'location' => 'xml', 'type' => 'object', 'properties' => array( 'Baz' => array(), 'Bam' => array(), ) ), 'Arr' => array( 'type' => 'array', 'items' => array( 'type' => 'string' ) ) ) )); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array(array( 'Foo' => null, 'Bar' => array( 'Bar' => null, 'Bam' => 'test' ), 'Arr' => array(null) ), $operation)) ->getMockForAbstractClass(); $command->setClient(new Client()); $request = $command->prepare(); $this->assertEquals( '' . "\n" . 'test' . "\n", (string) $request->getBody() ); } public function testAllowsXmlEncoding() { $operation = new Operation(array( 'data' => array( 'xmlEncoding' => 'utf8' ), 'parameters' => array( 'Foo' => array('location' => 'xml') ) )); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array(array('Foo' => 'test'), $operation)) ->getMockForAbstractClass(); $command->setClient(new Client()); $request = $command->prepare(); $this->assertEquals( '' . "\n" . 'test' . "\n", (string) $request->getBody() ); } public function testAllowsSendingXmlPayloadIfNoXmlParamsWereSet() { $operation = new Operation(array( 'httpMethod' => 'POST', 'data' => array('xmlAllowEmpty' => true), 'parameters' => array('Foo' => array('location' => 'xml')) )); $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array(array(), $operation)) ->getMockForAbstractClass(); $command->setClient(new Client('http://foo.com')); $request = $command->prepare(); $this->assertEquals( '' . "\n" . '' . "\n", (string) $request->getBody() ); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/AbstractResponseVisitorTest.php000064400000001335151742734620026424 0ustar00value = array(); $this->command = new MockCommand(); $this->response = new Response(200, array( 'X-Foo' => 'bar', 'Content-Length' => 3, 'Content-Type' => 'text/plain' ), 'Foo'); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/BodyVisitorTest.php000064400000001246151742734620024040 0ustar00 'body', 'name' => 'foo')); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals('Foo', (string) $this->value['foo']); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/HeaderVisitorTest.php000064400000004056151742734620024335 0ustar00 'header', 'name' => 'ContentType', 'sentAs' => 'Content-Type' )); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals('text/plain', $this->value['ContentType']); } public function testVisitsLocationWithFilters() { $visitor = new Visitor(); $param = new Parameter(array( 'location' => 'header', 'name' => 'Content-Type', 'filters' => array('strtoupper') )); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals('TEXT/PLAIN', $this->value['Content-Type']); } public function testVisitsMappedPrefixHeaders() { $visitor = new Visitor(); $param = new Parameter(array( 'location' => 'header', 'name' => 'Metadata', 'sentAs' => 'X-Baz-', 'type' => 'object', 'additionalProperties' => array( 'type' => 'string' ) )); $response = new Response(200, array( 'X-Baz-Test' => 'ABC', 'X-Baz-Bar' => array('123', '456'), 'Content-Length' => 3 ), 'Foo'); $visitor->visit($this->command, $response, $param, $this->value); $this->assertEquals(array( 'Metadata' => array( 'Test' => 'ABC', 'Bar' => array('123', '456') ) ), $this->value); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/JsonVisitorTest.php000064400000004746151742734620024064 0ustar00getMockBuilder('Guzzle\Service\Command\AbstractCommand') ->setMethods(array('getResponse')) ->getMockForAbstractClass(); $command->expects($this->once()) ->method('getResponse') ->will($this->returnValue(new Response(200, null, '{"foo":"bar"}'))); $result = array(); $visitor->before($command, $result); $this->assertEquals(array('foo' => 'bar'), $result); } public function testVisitsLocation() { $visitor = new Visitor(); $param = new Parameter(array( 'name' => 'foo', 'type' => 'array', 'items' => array( 'filters' => 'strtoupper', 'type' => 'string' ) )); $this->value = array('foo' => array('a', 'b', 'c')); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals(array('A', 'B', 'C'), $this->value['foo']); } public function testRenamesTopLevelValues() { $visitor = new Visitor(); $param = new Parameter(array( 'name' => 'foo', 'sentAs' => 'Baz', 'type' => 'string', )); $this->value = array('Baz' => 'test'); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals(array('foo' => 'test'), $this->value); } public function testTraversesObjectsAndAppliesFilters() { $visitor = new Visitor(); $param = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'properties' => array( 'foo' => array('filters' => 'strtoupper'), 'bar' => array('filters' => 'strtolower') ) )); $this->value = array('foo' => array('foo' => 'hello', 'bar' => 'THERE')); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals(array('foo' => 'HELLO', 'bar' => 'there'), $this->value['foo']); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/ReasonPhraseVisitorTest.php000064400000001302151742734620025526 0ustar00 'reasonPhrase', 'name' => 'phrase')); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals('OK', $this->value['phrase']); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/StatusCodeVisitorTest.php000064400000001265151742734620025222 0ustar00 'statusCode', 'name' => 'code')); $visitor->visit($this->command, $this->response, $param, $this->value); $this->assertEquals(200, $this->value['code']); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/XmlVisitorTest.php000064400000027160151742734620023706 0ustar00getMockBuilder('Guzzle\Service\Command\AbstractCommand') ->setMethods(array('getResponse')) ->getMockForAbstractClass(); $command->expects($this->once()) ->method('getResponse') ->will($this->returnValue(new Response(200, null, 'test'))); $result = array(); $visitor->before($command, $result); $this->assertEquals(array('Bar' => 'test'), $result); } public function testCanExtractAndRenameTopLevelXmlValues() { $visitor = new Visitor(); $param = new Parameter(array( 'location' => 'xml', 'name' => 'foo', 'sentAs' => 'Bar' )); $value = array('Bar' => 'test'); $visitor->visit($this->command, $this->response, $param, $value); $this->assertArrayHasKey('foo', $value); $this->assertEquals('test', $value['foo']); } public function testEnsuresRepeatedArraysAreInCorrectLocations() { $visitor = new Visitor(); $param = new Parameter(array( 'location' => 'xml', 'name' => 'foo', 'sentAs' => 'Foo', 'type' => 'array', 'items' => array( 'type' => 'object', 'properties' => array( 'Bar' => array('type' => 'string'), 'Baz' => array('type' => 'string'), 'Bam' => array('type' => 'string') ) ) )); $xml = new \SimpleXMLElement('12'); $value = json_decode(json_encode($xml), true); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals(array( 'foo' => array( array ( 'Bar' => '1', 'Baz' => '2' ) ) ), $value); } public function testEnsuresFlatArraysAreFlat() { $visitor = new Visitor(); $param = new Parameter(array( 'location' => 'xml', 'name' => 'foo', 'type' => 'array', 'items' => array('type' => 'string') )); $value = array('foo' => array('bar', 'baz')); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals(array('foo' => array('bar', 'baz')), $value); $value = array('foo' => 'bar'); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals(array('foo' => array('bar')), $value); } public function xmlDataProvider() { $param = new Parameter(array( 'location' => 'xml', 'name' => 'Items', 'type' => 'array', 'items' => array( 'type' => 'object', 'name' => 'Item', 'properties' => array( 'Bar' => array('type' => 'string'), 'Baz' => array('type' => 'string') ) ) )); return array( array($param, '12', array( 'Items' => array( array('Bar' => 1), array('Bar' => 2) ) )), array($param, '1', array( 'Items' => array( array('Bar' => 1) ) )), array($param, '', array( 'Items' => array() )) ); } /** * @dataProvider xmlDataProvider */ public function testEnsuresWrappedArraysAreInCorrectLocations($param, $xml, $result) { $visitor = new Visitor(); $xml = new \SimpleXMLElement($xml); $value = json_decode(json_encode($xml), true); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals($result, $value); } public function testCanRenameValues() { $visitor = new Visitor(); $param = new Parameter(array( 'name' => 'TerminatingInstances', 'type' => 'array', 'location' => 'xml', 'sentAs' => 'instancesSet', 'items' => array( 'name' => 'item', 'type' => 'object', 'sentAs' => 'item', 'properties' => array( 'InstanceId' => array( 'type' => 'string', 'sentAs' => 'instanceId', ), 'CurrentState' => array( 'type' => 'object', 'sentAs' => 'currentState', 'properties' => array( 'Code' => array( 'type' => 'numeric', 'sentAs' => 'code', ), 'Name' => array( 'type' => 'string', 'sentAs' => 'name', ), ), ), 'PreviousState' => array( 'type' => 'object', 'sentAs' => 'previousState', 'properties' => array( 'Code' => array( 'type' => 'numeric', 'sentAs' => 'code', ), 'Name' => array( 'type' => 'string', 'sentAs' => 'name', ), ), ), ), ) )); $value = array( 'instancesSet' => array ( 'item' => array ( 'instanceId' => 'i-3ea74257', 'currentState' => array( 'code' => '32', 'name' => 'shutting-down', ), 'previousState' => array( 'code' => '16', 'name' => 'running', ), ), ) ); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals(array( 'TerminatingInstances' => array( array( 'InstanceId' => 'i-3ea74257', 'CurrentState' => array( 'Code' => '32', 'Name' => 'shutting-down', ), 'PreviousState' => array( 'Code' => '16', 'Name' => 'running', ) ) ) ), $value); } public function testCanRenameAttributes() { $visitor = new Visitor(); $param = new Parameter(array( 'name' => 'RunningQueues', 'type' => 'array', 'location' => 'xml', 'items' => array( 'type' => 'object', 'sentAs' => 'item', 'properties' => array( 'QueueId' => array( 'type' => 'string', 'sentAs' => 'queue_id', 'data' => array( 'xmlAttribute' => true, ), ), 'CurrentState' => array( 'type' => 'object', 'properties' => array( 'Code' => array( 'type' => 'numeric', 'sentAs' => 'code', 'data' => array( 'xmlAttribute' => true, ), ), 'Name' => array( 'sentAs' => 'name', 'data' => array( 'xmlAttribute' => true, ), ), ), ), 'PreviousState' => array( 'type' => 'object', 'properties' => array( 'Code' => array( 'type' => 'numeric', 'sentAs' => 'code', 'data' => array( 'xmlAttribute' => true, ), ), 'Name' => array( 'sentAs' => 'name', 'data' => array( 'xmlAttribute' => true, ), ), ), ), ), ) )); $xml = ''; $value = json_decode(json_encode(new \SimpleXMLElement($xml)), true); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals(array( 'RunningQueues' => array( array( 'QueueId' => 'q-3ea74257', 'CurrentState' => array( 'Code' => '32', 'Name' => 'processing', ), 'PreviousState' => array( 'Code' => '16', 'Name' => 'wait', ), ), ) ), $value); } public function testAddsEmptyArraysWhenValueIsMissing() { $visitor = new Visitor(); $param = new Parameter(array( 'name' => 'Foo', 'type' => 'array', 'location' => 'xml', 'items' => array( 'type' => 'object', 'properties' => array( 'Baz' => array('type' => 'array'), 'Bar' => array( 'type' => 'object', 'properties' => array( 'Baz' => array('type' => 'array'), ) ) ) ) )); $value = array(); $visitor->visit($this->command, $this->response, $param, $value); $value = array( 'Foo' => array( 'Bar' => array() ) ); $visitor->visit($this->command, $this->response, $param, $value); $this->assertEquals(array( 'Foo' => array( array( 'Bar' => array() ) ) ), $value); } } tests/Guzzle/Tests/Service/Command/LocationVisitor/VisitorFlyweightTest.php000064400000003513151742734620023306 0ustar00assertInstanceOf('Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor', $f->getRequestVisitor('json')); $this->assertInstanceOf('Guzzle\Service\Command\LocationVisitor\Response\JsonVisitor', $f->getResponseVisitor('json')); } public function testCanUseCustomMappings() { $f = new VisitorFlyweight(array()); $this->assertEquals(array(), $this->readAttribute($f, 'mappings')); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage No request visitor has been mapped for foo */ public function testThrowsExceptionWhenRetrievingUnknownVisitor() { VisitorFlyweight::getInstance()->getRequestVisitor('foo'); } public function testCachesVisitors() { $f = new VisitorFlyweight(); $v1 = $f->getRequestVisitor('json'); $this->assertSame($v1, $f->getRequestVisitor('json')); } public function testAllowsAddingVisitors() { $f = new VisitorFlyweight(); $j1 = new JsonRequestVisitor(); $j2 = new JsonResponseVisitor(); $f->addRequestVisitor('json', $j1); $f->addResponseVisitor('json', $j2); $this->assertSame($j1, $f->getRequestVisitor('json')); $this->assertSame($j2, $f->getResponseVisitor('json')); } } tests/Guzzle/Tests/Service/Command/OperationCommandTest.php000064400000007524151742734620020101 0ustar00getRequestSerializer(); $b = new DefaultRequestSerializer(VisitorFlyweight::getInstance()); $operation->setRequestSerializer($b); $this->assertNotSame($a, $operation->getRequestSerializer()); } public function testPreparesRequestUsingSerializer() { $op = new OperationCommand(array(), new Operation()); $op->setClient(new Client()); $s = $this->getMockBuilder('Guzzle\Service\Command\RequestSerializerInterface') ->setMethods(array('prepare')) ->getMockForAbstractClass(); $s->expects($this->once()) ->method('prepare') ->will($this->returnValue(new EntityEnclosingRequest('POST', 'http://foo.com'))); $op->setRequestSerializer($s); $op->prepare(); } public function testParsesResponsesWithResponseParser() { $op = new OperationCommand(array(), new Operation()); $p = $this->getMockBuilder('Guzzle\Service\Command\ResponseParserInterface') ->setMethods(array('parse')) ->getMockForAbstractClass(); $p->expects($this->once()) ->method('parse') ->will($this->returnValue(array('foo' => 'bar'))); $op->setResponseParser($p); $op->setClient(new Client()); $request = $op->prepare(); $request->setResponse(new Response(200), true); $this->assertEquals(array('foo' => 'bar'), $op->execute()); } public function testParsesResponsesUsingModelParserWhenMatchingModelIsFound() { $description = ServiceDescription::factory(array( 'operations' => array( 'foo' => array('responseClass' => 'bar', 'responseType' => 'model') ), 'models' => array( 'bar' => array( 'type' => 'object', 'properties' => array( 'Baz' => array('type' => 'string', 'location' => 'xml') ) ) ) )); $op = new OperationCommand(array(), $description->getOperation('foo')); $op->setClient(new Client()); $request = $op->prepare(); $request->setResponse(new Response(200, array( 'Content-Type' => 'application/xml' ), 'Bar'), true); $result = $op->execute(); $this->assertEquals(new Model(array('Baz' => 'Bar'), $description->getModel('bar')), $result); } public function testAllowsRawResponses() { $description = new ServiceDescription(array( 'operations' => array('foo' => array('responseClass' => 'bar', 'responseType' => 'model')), 'models' => array('bar' => array()) )); $op = new OperationCommand(array( OperationCommand::RESPONSE_PROCESSING => OperationCommand::TYPE_RAW ), $description->getOperation('foo')); $op->setClient(new Client()); $request = $op->prepare(); $response = new Response(200, array( 'Content-Type' => 'application/xml' ), 'Bar'); $request->setResponse($response, true); $this->assertSame($response, $op->execute()); } } tests/Guzzle/Tests/Service/Command/OperationResponseParserTest.php000064400000022772151742734620021500 0ustar00addVisitor('foo', $visitor); $this->assertSame($visitor, $this->readAttribute($p, 'factory')->getResponseVisitor('foo')); } public function testUsesParentParser() { $p = new OperationResponseParser(new VisitorFlyweight()); $operation = new Operation(); $operation->setServiceDescription(new ServiceDescription()); $op = new OperationCommand(array(), $operation); $op->setResponseParser($p)->setClient(new Client()); $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/xml'), 'C'), true); $this->assertInstanceOf('SimpleXMLElement', $op->execute()); } public function testVisitsLocations() { $parser = new OperationResponseParser(new VisitorFlyweight(array())); $parser->addVisitor('statusCode', new StatusCodeVisitor()); $parser->addVisitor('reasonPhrase', new ReasonPhraseVisitor()); $parser->addVisitor('json', new JsonVisitor()); $op = new OperationCommand(array(), $this->getDescription()->getOperation('test')); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(201), true); $result = $op->execute(); $this->assertEquals(201, $result['code']); $this->assertEquals('Created', $result['phrase']); } public function testVisitsLocationsForJsonResponse() { $parser = OperationResponseParser::getInstance(); $operation = $this->getDescription()->getOperation('test'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(200, array( 'Content-Type' => 'application/json' ), '{"baz":"bar","enigma":"123"}'), true); $result = $op->execute(); $this->assertEquals(array( 'baz' => 'bar', 'enigma' => '123', 'code' => 200, 'phrase' => 'OK' ), $result->toArray()); } public function testSkipsUnkownModels() { $parser = OperationResponseParser::getInstance(); $operation = $this->getDescription()->getOperation('test'); $operation->setResponseClass('Baz')->setResponseType('model'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(201), true); $this->assertInstanceOf('Guzzle\Http\Message\Response', $op->execute()); } public function testAllowsModelProcessingToBeDisabled() { $parser = OperationResponseParser::getInstance(); $operation = $this->getDescription()->getOperation('test'); $op = new OperationCommand(array('command.response_processing' => 'native'), $operation); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(200, array( 'Content-Type' => 'application/json' ), '{"baz":"bar","enigma":"123"}'), true); $result = $op->execute(); $this->assertInstanceOf('Guzzle\Service\Resource\Model', $result); $this->assertEquals(array( 'baz' => 'bar', 'enigma' => '123' ), $result->toArray()); } public function testDoesNotParseXmlWhenNotUsingXmlVisitor() { $parser = OperationResponseParser::getInstance(); $description = ServiceDescription::factory(array( 'operations' => array('test' => array('responseClass' => 'Foo')), 'models' => array( 'Foo' => array( 'type' => 'object', 'properties' => array('baz' => array('location' => 'body')) ) ) )); $operation = $description->getOperation('test'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $brokenXml = '<><><>>>>'; $op->prepare()->setResponse(new Response(200, array( 'Content-Type' => 'application/xml' ), $brokenXml), true); $result = $op->execute(); $this->assertEquals(array('baz'), $result->getKeys()); $this->assertEquals($brokenXml, (string) $result['baz']); } public function testVisitsAdditionalProperties() { $parser = OperationResponseParser::getInstance(); $description = ServiceDescription::factory(array( 'operations' => array('test' => array('responseClass' => 'Foo')), 'models' => array( 'Foo' => array( 'type' => 'object', 'properties' => array( 'code' => array('location' => 'statusCode') ), 'additionalProperties' => array( 'location' => 'json', 'type' => 'object', 'properties' => array( 'a' => array( 'type' => 'string', 'filters' => 'strtoupper' ) ) ) ) ) )); $operation = $description->getOperation('test'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $json = '[{"a":"test"},{"a":"baz"}]'; $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), $json), true); $result = $op->execute()->toArray(); $this->assertEquals(array( 'code' => 200, array('a' => 'TEST'), array('a' => 'BAZ') ), $result); } public function testCreatesCustomResponseClassInterface() { $parser = OperationResponseParser::getInstance(); $description = ServiceDescription::factory(array( 'operations' => array('test' => array('responseClass' => 'Guzzle\Tests\Mock\CustomResponseModel')) )); $operation = $description->getOperation('test'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), 'hi!'), true); $result = $op->execute(); $this->assertInstanceOf('Guzzle\Tests\Mock\CustomResponseModel', $result); $this->assertSame($op, $result->command); } /** * @expectedException \Guzzle\Service\Exception\ResponseClassException * @expectedExceptionMessage does not exist */ public function testEnsuresResponseClassExists() { $parser = OperationResponseParser::getInstance(); $description = ServiceDescription::factory(array( 'operations' => array('test' => array('responseClass' => 'Foo\Baz\Bar')) )); $operation = $description->getOperation('test'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), 'hi!'), true); $op->execute(); } /** * @expectedException \Guzzle\Service\Exception\ResponseClassException * @expectedExceptionMessage must implement */ public function testEnsuresResponseClassImplementsResponseClassInterface() { $parser = OperationResponseParser::getInstance(); $description = ServiceDescription::factory(array( 'operations' => array('test' => array('responseClass' => __CLASS__)) )); $operation = $description->getOperation('test'); $op = new OperationCommand(array(), $operation); $op->setResponseParser($parser)->setClient(new Client()); $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), 'hi!'), true); $op->execute(); } protected function getDescription() { return ServiceDescription::factory(array( 'operations' => array('test' => array('responseClass' => 'Foo')), 'models' => array( 'Foo' => array( 'type' => 'object', 'properties' => array( 'baz' => array('type' => 'string', 'location' => 'json'), 'code' => array('location' => 'statusCode'), 'phrase' => array('location' => 'reasonPhrase'), ) ) ) )); } } tests/Guzzle/Tests/Service/Description/OperationTest.php000064400000025646151742734620017514 0ustar00 'test', 'summary' => 'doc', 'notes' => 'notes', 'documentationUrl' => 'http://www.example.com', 'httpMethod' => 'POST', 'uri' => '/api/v1', 'responseClass' => 'array', 'responseNotes' => 'returns the json_decoded response', 'deprecated' => true, 'parameters' => array( 'key' => array( 'required' => true, 'type' => 'string', 'maxLength' => 10 ), 'key_2' => array( 'required' => true, 'type' => 'integer', 'default' => 10 ) ) )); $this->assertEquals('test', $c->getName()); $this->assertEquals('doc', $c->getSummary()); $this->assertEquals('http://www.example.com', $c->getDocumentationUrl()); $this->assertEquals('POST', $c->getHttpMethod()); $this->assertEquals('/api/v1', $c->getUri()); $this->assertEquals('array', $c->getResponseClass()); $this->assertEquals('returns the json_decoded response', $c->getResponseNotes()); $this->assertTrue($c->getDeprecated()); $this->assertEquals('Guzzle\\Service\\Command\\OperationCommand', $c->getClass()); $this->assertEquals(array( 'key' => new Parameter(array( 'name' => 'key', 'required' => true, 'type' => 'string', 'maxLength' => 10, 'parent' => $c )), 'key_2' => new Parameter(array( 'name' => 'key_2', 'required' => true, 'type' => 'integer', 'default' => 10, 'parent' => $c )) ), $c->getParams()); $this->assertEquals(new Parameter(array( 'name' => 'key_2', 'required' => true, 'type' => 'integer', 'default' => 10, 'parent' => $c )), $c->getParam('key_2')); $this->assertNull($c->getParam('afefwef')); $this->assertArrayNotHasKey('parent', $c->getParam('key_2')->toArray()); } public function testAllowsConcreteCommands() { $c = new Operation(array( 'name' => 'test', 'class' => 'Guzzle\\Service\\Command\ClosureCommand', 'parameters' => array( 'p' => new Parameter(array( 'name' => 'foo' )) ) )); $this->assertEquals('Guzzle\\Service\\Command\ClosureCommand', $c->getClass()); } public function testConvertsToArray() { $data = array( 'name' => 'test', 'class' => 'Guzzle\\Service\\Command\ClosureCommand', 'summary' => 'test', 'documentationUrl' => 'http://www.example.com', 'httpMethod' => 'PUT', 'uri' => '/', 'parameters' => array('p' => array('name' => 'foo')) ); $c = new Operation($data); $toArray = $c->toArray(); unset($data['name']); $this->assertArrayHasKey('parameters', $toArray); $this->assertInternalType('array', $toArray['parameters']); // Normalize the array unset($data['parameters']); unset($toArray['parameters']); $data['responseType'] = 'primitive'; $data['responseClass'] = 'array'; $this->assertEquals($data, $toArray); } public function testDeterminesIfHasParam() { $command = $this->getTestCommand(); $this->assertTrue($command->hasParam('data')); $this->assertFalse($command->hasParam('baz')); } public function testReturnsParamNames() { $command = $this->getTestCommand(); $this->assertEquals(array('data'), $command->getParamNames()); } protected function getTestCommand() { return new Operation(array( 'parameters' => array( 'data' => new Parameter(array( 'type' => 'string' )) ) )); } public function testCanBuildUpCommands() { $c = new Operation(array()); $c->setName('foo') ->setClass('Baz') ->setDeprecated(false) ->setSummary('summary') ->setDocumentationUrl('http://www.foo.com') ->setHttpMethod('PUT') ->setResponseNotes('oh') ->setResponseClass('string') ->setUri('/foo/bar') ->addParam(new Parameter(array( 'name' => 'test' ))); $this->assertEquals('foo', $c->getName()); $this->assertEquals('Baz', $c->getClass()); $this->assertEquals(false, $c->getDeprecated()); $this->assertEquals('summary', $c->getSummary()); $this->assertEquals('http://www.foo.com', $c->getDocumentationUrl()); $this->assertEquals('PUT', $c->getHttpMethod()); $this->assertEquals('oh', $c->getResponseNotes()); $this->assertEquals('string', $c->getResponseClass()); $this->assertEquals('/foo/bar', $c->getUri()); $this->assertEquals(array('test'), $c->getParamNames()); } public function testCanRemoveParams() { $c = new Operation(array()); $c->addParam(new Parameter(array('name' => 'foo'))); $this->assertTrue($c->hasParam('foo')); $c->removeParam('foo'); $this->assertFalse($c->hasParam('foo')); } public function testAddsNameToParametersIfNeeded() { $command = new Operation(array('parameters' => array('foo' => new Parameter(array())))); $this->assertEquals('foo', $command->getParam('foo')->getName()); } public function testContainsApiErrorInformation() { $command = $this->getOperation(); $this->assertEquals(1, count($command->getErrorResponses())); $arr = $command->toArray(); $this->assertEquals(1, count($arr['errorResponses'])); $command->addErrorResponse(400, 'Foo', 'Baz\\Bar'); $this->assertEquals(2, count($command->getErrorResponses())); $command->setErrorResponses(array()); $this->assertEquals(0, count($command->getErrorResponses())); } public function testHasNotes() { $o = new Operation(array('notes' => 'foo')); $this->assertEquals('foo', $o->getNotes()); $o->setNotes('bar'); $this->assertEquals('bar', $o->getNotes()); } public function testHasData() { $o = new Operation(array('data' => array('foo' => 'baz', 'bar' => 123))); $o->setData('test', false); $this->assertEquals('baz', $o->getData('foo')); $this->assertEquals(123, $o->getData('bar')); $this->assertNull($o->getData('wfefwe')); $this->assertEquals(array( 'parameters' => array(), 'class' => 'Guzzle\Service\Command\OperationCommand', 'data' => array('foo' => 'baz', 'bar' => 123, 'test' => false), 'responseClass' => 'array', 'responseType' => 'primitive' ), $o->toArray()); } public function testHasServiceDescription() { $s = new ServiceDescription(); $o = new Operation(array(), $s); $this->assertSame($s, $o->getServiceDescription()); } /** * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testValidatesResponseType() { $o = new Operation(array('responseClass' => 'array', 'responseType' => 'foo')); } public function testInfersResponseType() { $o = $this->getOperation(); $o->setServiceDescription(new ServiceDescription(array('models' => array('Foo' => array())))); $this->assertEquals('primitive', $o->getResponseType()); $this->assertEquals('primitive', $o->setResponseClass('foo')->getResponseType()); $this->assertEquals('primitive', $o->setResponseClass('boolean')->getResponseType()); $this->assertEquals('class', $o->setResponseClass(__CLASS__)->getResponseType()); $this->assertEquals('model', $o->setResponseClass('Foo')->getResponseType()); } public function testHasResponseType() { // infers in the constructor $o = new Operation(array('responseClass' => 'array')); $this->assertEquals('primitive', $o->getResponseType()); // Infers when set $o = new Operation(); $this->assertEquals('primitive', $o->getResponseType()); $this->assertEquals('model', $o->setResponseType('model')->getResponseType()); } public function testHasAdditionalParameters() { $o = new Operation(array( 'additionalParameters' => array( 'type' => 'string', 'name' => 'binks' ), 'parameters' => array( 'foo' => array('type' => 'integer') ) )); $this->assertEquals('string', $o->getAdditionalParameters()->getType()); $arr = $o->toArray(); $this->assertEquals(array( 'type' => 'string' ), $arr['additionalParameters']); } /** * @return Operation */ protected function getOperation() { return new Operation(array( 'name' => 'OperationTest', 'class' => get_class($this), 'parameters' => array( 'test' => array('type' => 'object'), 'bool_1' => array('default' => true, 'type' => 'boolean'), 'bool_2' => array('default' => false), 'float' => array('type' => 'numeric'), 'int' => array('type' => 'integer'), 'date' => array('type' => 'string'), 'timestamp' => array('type' => 'string'), 'string' => array('type' => 'string'), 'username' => array('type' => 'string', 'required' => true, 'filters' => 'strtolower'), 'test_function' => array('type' => 'string', 'filters' => __CLASS__ . '::strtoupper') ), 'errorResponses' => array( array('code' => 503, 'reason' => 'InsufficientCapacity', 'class' => 'Guzzle\\Exception\\RuntimeException') ) )); } } tests/Guzzle/Tests/Service/Description/ParameterTest.php000064400000033154151742734620017465 0ustar00 'foo', 'type' => 'bar', 'required' => true, 'default' => '123', 'description' => '456', 'minLength' => 2, 'maxLength' => 5, 'location' => 'body', 'static' => 'static!', 'filters' => array('trim', 'json_encode') ); public function testCreatesParamFromArray() { $p = new Parameter($this->data); $this->assertEquals('foo', $p->getName()); $this->assertEquals('bar', $p->getType()); $this->assertEquals(true, $p->getRequired()); $this->assertEquals('123', $p->getDefault()); $this->assertEquals('456', $p->getDescription()); $this->assertEquals(2, $p->getMinLength()); $this->assertEquals(5, $p->getMaxLength()); $this->assertEquals('body', $p->getLocation()); $this->assertEquals('static!', $p->getStatic()); $this->assertEquals(array('trim', 'json_encode'), $p->getFilters()); } public function testCanConvertToArray() { $p = new Parameter($this->data); unset($this->data['name']); $this->assertEquals($this->data, $p->toArray()); } public function testUsesStatic() { $d = $this->data; $d['default'] = 'booboo'; $d['static'] = true; $p = new Parameter($d); $this->assertEquals('booboo', $p->getValue('bar')); } public function testUsesDefault() { $d = $this->data; $d['default'] = 'foo'; $d['static'] = null; $p = new Parameter($d); $this->assertEquals('foo', $p->getValue(null)); } public function testReturnsYourValue() { $d = $this->data; $d['static'] = null; $p = new Parameter($d); $this->assertEquals('foo', $p->getValue('foo')); } public function testFiltersValues() { $d = $this->data; $d['static'] = null; $d['filters'] = 'strtoupper'; $p = new Parameter($d); $this->assertEquals('FOO', $p->filter('foo')); } public function testConvertsBooleans() { $p = new Parameter(array('type' => 'boolean')); $this->assertEquals(true, $p->filter('true')); $this->assertEquals(false, $p->filter('false')); } public function testUsesArrayByDefaultForFilters() { $d = $this->data; $d['filters'] = null; $p = new Parameter($d); $this->assertEquals(array(), $p->getFilters()); } public function testAllowsSimpleLocationValue() { $p = new Parameter(array('name' => 'myname', 'location' => 'foo', 'sentAs' => 'Hello')); $this->assertEquals('foo', $p->getLocation()); $this->assertEquals('Hello', $p->getSentAs()); } public function testParsesTypeValues() { $p = new Parameter(array('type' => 'foo')); $this->assertEquals('foo', $p->getType()); } /** * @expectedException InvalidArgumentException * @expectedExceptionMessage A [method] value must be specified for each complex filter */ public function testValidatesComplexFilters() { $p = new Parameter(array('filters' => array(array('args' => 'foo')))); } public function testCanBuildUpParams() { $p = new Parameter(array()); $p->setName('foo') ->setDescription('c') ->setFilters(array('d')) ->setLocation('e') ->setSentAs('f') ->setMaxLength(1) ->setMinLength(1) ->setMinimum(2) ->setMaximum(2) ->setMinItems(3) ->setMaxItems(3) ->setRequired(true) ->setStatic(true) ->setDefault('h') ->setType('i'); $p->addFilter('foo'); $this->assertEquals('foo', $p->getName()); $this->assertEquals('h', $p->getDefault()); $this->assertEquals('c', $p->getDescription()); $this->assertEquals(array('d', 'foo'), $p->getFilters()); $this->assertEquals('e', $p->getLocation()); $this->assertEquals('f', $p->getSentAs()); $this->assertEquals(1, $p->getMaxLength()); $this->assertEquals(1, $p->getMinLength()); $this->assertEquals(2, $p->getMaximum()); $this->assertEquals(2, $p->getMinimum()); $this->assertEquals(3, $p->getMaxItems()); $this->assertEquals(3, $p->getMinItems()); $this->assertEquals(true, $p->getRequired()); $this->assertEquals(true, $p->getStatic()); $this->assertEquals('i', $p->getType()); } public function testAllowsNestedShape() { $command = $this->getServiceBuilder()->get('mock')->getCommand('mock_command')->getOperation(); $param = new Parameter(array( 'parent' => $command, 'name' => 'foo', 'type' => 'object', 'location' => 'query', 'properties' => array( 'foo' => array( 'type' => 'object', 'required' => true, 'properties' => array( 'baz' => array( 'name' => 'baz', 'type' => 'bool', ) ) ), 'bar' => array( 'name' => 'bar', 'default' => '123' ) ) )); $this->assertSame($command, $param->getParent()); $this->assertNotEmpty($param->getProperties()); $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $param->getProperty('foo')); $this->assertSame($param, $param->getProperty('foo')->getParent()); $this->assertSame($param->getProperty('foo'), $param->getProperty('foo')->getProperty('baz')->getParent()); $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $param->getProperty('bar')); $this->assertSame($param, $param->getProperty('bar')->getParent()); $array = $param->toArray(); $this->assertInternalType('array', $array['properties']); $this->assertArrayHasKey('foo', $array['properties']); $this->assertArrayHasKey('bar', $array['properties']); } public function testAllowsComplexFilters() { $that = $this; $param = new Parameter(array()); $param->setFilters(array(array('method' => function ($a, $b, $c, $d) use ($that, $param) { $that->assertEquals('test', $a); $that->assertEquals('my_value!', $b); $that->assertEquals('bar', $c); $that->assertSame($param, $d); return 'abc' . $b; }, 'args' => array('test', '@value', 'bar', '@api')))); $this->assertEquals('abcmy_value!', $param->filter('my_value!')); } public function testCanChangeParentOfNestedParameter() { $param1 = new Parameter(array('name' => 'parent')); $param2 = new Parameter(array('name' => 'child')); $param2->setParent($param1); $this->assertSame($param1, $param2->getParent()); } public function testCanRemoveFromNestedStructure() { $param1 = new Parameter(array('name' => 'parent')); $param2 = new Parameter(array('name' => 'child')); $param1->addProperty($param2); $this->assertSame($param1, $param2->getParent()); $this->assertSame($param2, $param1->getProperty('child')); // Remove a single child from the structure $param1->removeProperty('child'); $this->assertNull($param1->getProperty('child')); // Remove the entire structure $param1->addProperty($param2); $param1->removeProperty('child'); $this->assertNull($param1->getProperty('child')); } public function testAddsAdditionalProperties() { $p = new Parameter(array( 'type' => 'object', 'additionalProperties' => array('type' => 'string') )); $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $p->getAdditionalProperties()); $this->assertNull($p->getAdditionalProperties()->getAdditionalProperties()); $p = new Parameter(array('type' => 'object')); $this->assertTrue($p->getAdditionalProperties()); } public function testAddsItems() { $p = new Parameter(array( 'type' => 'array', 'items' => array('type' => 'string') )); $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $p->getItems()); $out = $p->toArray(); $this->assertEquals('array', $out['type']); $this->assertInternalType('array', $out['items']); } public function testHasExtraProperties() { $p = new Parameter(); $this->assertEquals(array(), $p->getData()); $p->setData(array('foo' => 'bar')); $this->assertEquals('bar', $p->getData('foo')); $p->setData('baz', 'boo'); $this->assertEquals(array('foo' => 'bar', 'baz' => 'boo'), $p->getData()); } public function testCanRetrieveKnownPropertiesUsingDataMethod() { $p = new Parameter(); $this->assertEquals(null, $p->getData('foo')); $p->setName('test'); $this->assertEquals('test', $p->getData('name')); } public function testHasInstanceOf() { $p = new Parameter(); $this->assertNull($p->getInstanceOf()); $p->setInstanceOf('Foo'); $this->assertEquals('Foo', $p->getInstanceOf()); } public function testHasPattern() { $p = new Parameter(); $this->assertNull($p->getPattern()); $p->setPattern('/[0-9]+/'); $this->assertEquals('/[0-9]+/', $p->getPattern()); } public function testHasEnum() { $p = new Parameter(); $this->assertNull($p->getEnum()); $p->setEnum(array('foo', 'bar')); $this->assertEquals(array('foo', 'bar'), $p->getEnum()); } public function testSerializesItems() { $p = new Parameter(array( 'type' => 'object', 'additionalProperties' => array('type' => 'string') )); $this->assertEquals(array( 'type' => 'object', 'additionalProperties' => array('type' => 'string') ), $p->toArray()); } public function testResolvesRefKeysRecursively() { $jarJar = array('type' => 'string', 'default' => 'Mesa address tha senate!'); $anakin = array('type' => 'array', 'items' => array('$ref' => 'JarJar')); $description = new ServiceDescription(array( 'models' => array( 'JarJar' => $jarJar, 'Anakin' => $anakin ) )); // description attribute will be removed $p = new Parameter(array('$ref' => 'Anakin', 'description' => 'missing'), $description); $this->assertEquals(array( 'type' => 'array', 'items' => array( 'type' => 'string', 'default' => 'Mesa address tha senate!' ) ), $p->toArray()); } public function testResolvesExtendsRecursively() { $jarJar = array('type' => 'string', 'default' => 'Mesa address tha senate!', 'description' => 'a'); $anakin = array('type' => 'array', 'items' => array('extends' => 'JarJar', 'description' => 'b')); $description = new ServiceDescription(array( 'models' => array('JarJar' => $jarJar, 'Anakin' => $anakin) )); // Description attribute will be updated, and format added $p = new Parameter(array('extends' => 'Anakin', 'format' => 'date'), $description); $this->assertEquals(array( 'type' => 'array', 'format' => 'date', 'items' => array( 'type' => 'string', 'default' => 'Mesa address tha senate!', 'description' => 'b' ) ), $p->toArray()); } public function testHasKeyMethod() { $p = new Parameter(array('name' => 'foo', 'sentAs' => 'bar')); $this->assertEquals('bar', $p->getWireName()); $p->setSentAs(null); $this->assertEquals('foo', $p->getWireName()); } public function testIncludesNameInToArrayWhenItemsAttributeHasName() { $p = new Parameter(array( 'type' => 'array', 'name' => 'Abc', 'items' => array( 'name' => 'Foo', 'type' => 'object' ) )); $result = $p->toArray(); $this->assertEquals(array( 'type' => 'array', 'items' => array( 'name' => 'Foo', 'type' => 'object', 'additionalProperties' => true ) ), $result); } public function dateTimeProvider() { $d = 'October 13, 2012 16:15:46 UTC'; return array( array($d, 'date-time', '2012-10-13T16:15:46Z'), array($d, 'date', '2012-10-13'), array($d, 'timestamp', strtotime($d)), array(new \DateTime($d), 'timestamp', strtotime($d)) ); } /** * @dataProvider dateTimeProvider */ public function testAppliesFormat($d, $format, $result) { $p = new Parameter(); $p->setFormat($format); $this->assertEquals($format, $p->getFormat()); $this->assertEquals($result, $p->filter($d)); } } tests/Guzzle/Tests/Service/Description/SchemaFormatterTest.php000064400000002722151742734620020626 0ustar00assertEquals($result, SchemaFormatter::format($format, $value)); } /** * @expectedException \Guzzle\Common\Exception\InvalidArgumentException */ public function testValidatesDateTimeInput() { SchemaFormatter::format('date-time', false); } } tests/Guzzle/Tests/Service/Description/SchemaValidatorTest.php000064400000030235151742734620020610 0ustar00validator = new SchemaValidator(); } public function testValidatesArrayListsAreNumericallyIndexed() { $value = array(array(1)); $this->assertFalse($this->validator->validate($this->getComplexParam(), $value)); $this->assertEquals( array('[Foo][0] must be an array of properties. Got a numerically indexed array.'), $this->validator->getErrors() ); } public function testValidatesArrayListsContainProperItems() { $value = array(true); $this->assertFalse($this->validator->validate($this->getComplexParam(), $value)); $this->assertEquals( array('[Foo][0] must be of type object'), $this->validator->getErrors() ); } public function testAddsDefaultValuesInLists() { $value = array(array()); $this->assertTrue($this->validator->validate($this->getComplexParam(), $value)); $this->assertEquals(array(array('Bar' => true)), $value); } public function testMergesDefaultValuesInLists() { $value = array( array('Baz' => 'hello!'), array('Bar' => false) ); $this->assertTrue($this->validator->validate($this->getComplexParam(), $value)); $this->assertEquals(array( array( 'Baz' => 'hello!', 'Bar' => true ), array('Bar' => false) ), $value); } public function testCorrectlyConvertsParametersToArrayWhenArraysArePresent() { $param = $this->getComplexParam(); $result = $param->toArray(); $this->assertInternalType('array', $result['items']); $this->assertEquals('array', $result['type']); $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $param->getItems()); } public function testAllowsInstanceOf() { $p = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'instanceOf' => get_class($this) )); $this->assertTrue($this->validator->validate($p, $this)); $this->assertFalse($this->validator->validate($p, $p)); $this->assertEquals(array('[foo] must be an instance of ' . __CLASS__), $this->validator->getErrors()); } public function testEnforcesInstanceOfOnlyWhenObject() { $p = new Parameter(array( 'name' => 'foo', 'type' => array('object', 'string'), 'instanceOf' => get_class($this) )); $this->assertTrue($this->validator->validate($p, $this)); $s = 'test'; $this->assertTrue($this->validator->validate($p, $s)); } public function testConvertsObjectsToArraysWhenToArrayInterface() { $o = $this->getMockBuilder('Guzzle\Common\ToArrayInterface') ->setMethods(array('toArray')) ->getMockForAbstractClass(); $o->expects($this->once()) ->method('toArray') ->will($this->returnValue(array( 'foo' => 'bar' ))); $p = new Parameter(array( 'name' => 'test', 'type' => 'object', 'properties' => array( 'foo' => array('required' => 'true') ) )); $this->assertTrue($this->validator->validate($p, $o)); } public function testMergesValidationErrorsInPropertiesWithParent() { $p = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'properties' => array( 'bar' => array('type' => 'string', 'required' => true, 'description' => 'This is what it does'), 'test' => array('type' => 'string', 'minLength' => 2, 'maxLength' => 5), 'test2' => array('type' => 'string', 'minLength' => 2, 'maxLength' => 2), 'test3' => array('type' => 'integer', 'minimum' => 100), 'test4' => array('type' => 'integer', 'maximum' => 10), 'test5' => array('type' => 'array', 'maxItems' => 2), 'test6' => array('type' => 'string', 'enum' => array('a', 'bc')), 'test7' => array('type' => 'string', 'pattern' => '/[0-9]+/'), 'test8' => array('type' => 'number'), 'baz' => array( 'type' => 'array', 'minItems' => 2, 'required' => true, "items" => array("type" => "string") ) ) )); $value = array( 'test' => 'a', 'test2' => 'abc', 'baz' => array(false), 'test3' => 10, 'test4' => 100, 'test5' => array(1, 3, 4), 'test6' => 'Foo', 'test7' => 'abc', 'test8' => 'abc' ); $this->assertFalse($this->validator->validate($p, $value)); $this->assertEquals(array ( '[foo][bar] is a required string: This is what it does', '[foo][baz] must contain 2 or more elements', '[foo][baz][0] must be of type string', '[foo][test2] length must be less than or equal to 2', '[foo][test3] must be greater than or equal to 100', '[foo][test4] must be less than or equal to 10', '[foo][test5] must contain 2 or fewer elements', '[foo][test6] must be one of "a" or "bc"', '[foo][test7] must match the following regular expression: /[0-9]+/', '[foo][test8] must be of type number', '[foo][test] length must be greater than or equal to 2', ), $this->validator->getErrors()); } public function testHandlesNullValuesInArraysWithDefaults() { $p = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'required' => true, 'properties' => array( 'bar' => array( 'type' => 'object', 'required' => true, 'properties' => array( 'foo' => array('default' => 'hi') ) ) ) )); $value = array(); $this->assertTrue($this->validator->validate($p, $value)); $this->assertEquals(array('bar' => array('foo' => 'hi')), $value); } public function testFailsWhenNullValuesInArraysWithNoDefaults() { $p = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'required' => true, 'properties' => array( 'bar' => array( 'type' => 'object', 'required' => true, 'properties' => array('foo' => array('type' => 'string')) ) ) )); $value = array(); $this->assertFalse($this->validator->validate($p, $value)); $this->assertEquals(array('[foo][bar] is a required object'), $this->validator->getErrors()); } public function testChecksTypes() { $p = new SchemaValidator(); $r = new \ReflectionMethod($p, 'determineType'); $r->setAccessible(true); $this->assertEquals('any', $r->invoke($p, 'any', 'hello')); $this->assertEquals(false, $r->invoke($p, 'foo', 'foo')); $this->assertEquals('string', $r->invoke($p, 'string', 'hello')); $this->assertEquals(false, $r->invoke($p, 'string', false)); $this->assertEquals('integer', $r->invoke($p, 'integer', 1)); $this->assertEquals(false, $r->invoke($p, 'integer', 'abc')); $this->assertEquals('numeric', $r->invoke($p, 'numeric', 1)); $this->assertEquals('numeric', $r->invoke($p, 'numeric', '1')); $this->assertEquals('number', $r->invoke($p, 'number', 1)); $this->assertEquals('number', $r->invoke($p, 'number', '1')); $this->assertEquals(false, $r->invoke($p, 'numeric', 'a')); $this->assertEquals('boolean', $r->invoke($p, 'boolean', true)); $this->assertEquals('boolean', $r->invoke($p, 'boolean', false)); $this->assertEquals(false, $r->invoke($p, 'boolean', 'false')); $this->assertEquals('null', $r->invoke($p, 'null', null)); $this->assertEquals(false, $r->invoke($p, 'null', 'abc')); $this->assertEquals('array', $r->invoke($p, 'array', array())); $this->assertEquals(false, $r->invoke($p, 'array', 'foo')); } public function testValidatesFalseAdditionalProperties() { $param = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'properties' => array('bar' => array('type' => 'string')), 'additionalProperties' => false )); $value = array('test' => '123'); $this->assertFalse($this->validator->validate($param, $value)); $this->assertEquals(array('[foo][test] is not an allowed property'), $this->validator->getErrors()); $value = array('bar' => '123'); $this->assertTrue($this->validator->validate($param, $value)); } public function testAllowsUndefinedAdditionalProperties() { $param = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'properties' => array('bar' => array('type' => 'string')) )); $value = array('test' => '123'); $this->assertTrue($this->validator->validate($param, $value)); } public function testValidatesAdditionalProperties() { $param = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'properties' => array('bar' => array('type' => 'string')), 'additionalProperties' => array('type' => 'integer') )); $value = array('test' => 'foo'); $this->assertFalse($this->validator->validate($param, $value)); $this->assertEquals(array('[foo][test] must be of type integer'), $this->validator->getErrors()); } public function testValidatesAdditionalPropertiesThatArrayArrays() { $param = new Parameter(array( 'name' => 'foo', 'type' => 'object', 'additionalProperties' => array( 'type' => 'array', 'items' => array('type' => 'string') ) )); $value = array('test' => array(true)); $this->assertFalse($this->validator->validate($param, $value)); $this->assertEquals(array('[foo][test][0] must be of type string'), $this->validator->getErrors()); } public function testIntegersCastToStringWhenTypeMismatch() { $param = new Parameter(array('name' => 'test', 'type' => 'string')); $value = 12; $this->assertTrue($this->validator->validate($param, $value)); $this->assertEquals('12', $value); } public function testRequiredMessageIncludesType() { $param = new Parameter(array('name' => 'test', 'type' => array('string', 'boolean'), 'required' => true)); $value = null; $this->assertFalse($this->validator->validate($param, $value)); $this->assertEquals(array('[test] is a required string or boolean'), $this->validator->getErrors()); } protected function getComplexParam() { return new Parameter(array( 'name' => 'Foo', 'type' => 'array', 'required' => true, 'min' => 1, 'items' => array( 'type' => 'object', 'properties' => array( 'Baz' => array( 'type' => 'string', ), 'Bar' => array( 'required' => true, 'type' => 'boolean', 'default' => true ) ) ) )); } } tests/Guzzle/Tests/Service/Description/ServiceDescriptionLoaderTest.php000064400000014307151742734620022477 0ustar00 true, 'baz' => array('bar'), 'apiVersion' => '123', 'operations' => array() )); $this->assertEquals(true, $d->getData('foo')); $this->assertEquals(array('bar'), $d->getData('baz')); $this->assertEquals('123', $d->getApiVersion()); } public function testAllowsDeepNestedInheritance() { $d = ServiceDescription::factory(array( 'operations' => array( 'abstract' => array( 'httpMethod' => 'HEAD', 'parameters' => array( 'test' => array('type' => 'string', 'required' => true) ) ), 'abstract2' => array('uri' => '/test', 'extends' => 'abstract'), 'concrete' => array('extends' => 'abstract2'), 'override' => array('extends' => 'abstract', 'httpMethod' => 'PUT'), 'override2' => array('extends' => 'override', 'httpMethod' => 'POST', 'uri' => '/') ) )); $c = $d->getOperation('concrete'); $this->assertEquals('/test', $c->getUri()); $this->assertEquals('HEAD', $c->getHttpMethod()); $params = $c->getParams(); $param = $params['test']; $this->assertEquals('string', $param->getType()); $this->assertTrue($param->getRequired()); // Ensure that merging HTTP method does not make an array $this->assertEquals('PUT', $d->getOperation('override')->getHttpMethod()); $this->assertEquals('POST', $d->getOperation('override2')->getHttpMethod()); $this->assertEquals('/', $d->getOperation('override2')->getUri()); } /** * @expectedException RuntimeException */ public function testThrowsExceptionWhenExtendingMissingCommand() { ServiceDescription::factory(array( 'operations' => array( 'concrete' => array( 'extends' => 'missing' ) ) )); } public function testAllowsMultipleInheritance() { $description = ServiceDescription::factory(array( 'operations' => array( 'a' => array( 'httpMethod' => 'GET', 'parameters' => array( 'a1' => array( 'default' => 'foo', 'required' => true, 'prepend' => 'hi' ) ) ), 'b' => array( 'extends' => 'a', 'parameters' => array( 'b2' => array() ) ), 'c' => array( 'parameters' => array( 'a1' => array( 'default' => 'bar', 'required' => true, 'description' => 'test' ), 'c3' => array() ) ), 'd' => array( 'httpMethod' => 'DELETE', 'extends' => array('b', 'c'), 'parameters' => array( 'test' => array() ) ) ) )); $command = $description->getOperation('d'); $this->assertEquals('DELETE', $command->getHttpMethod()); $this->assertContains('a1', $command->getParamNames()); $this->assertContains('b2', $command->getParamNames()); $this->assertContains('c3', $command->getParamNames()); $this->assertContains('test', $command->getParamNames()); $this->assertTrue($command->getParam('a1')->getRequired()); $this->assertEquals('bar', $command->getParam('a1')->getDefault()); $this->assertEquals('test', $command->getParam('a1')->getDescription()); } public function testAddsOtherFields() { $description = ServiceDescription::factory(array( 'operations' => array(), 'description' => 'Foo', 'apiVersion' => 'bar' )); $this->assertEquals('Foo', $description->getDescription()); $this->assertEquals('bar', $description->getApiVersion()); } public function testCanLoadNestedExtends() { $description = ServiceDescription::factory(array( 'operations' => array( 'root' => array( 'class' => 'foo' ), 'foo' => array( 'extends' => 'root', 'parameters' => array( 'baz' => array('type' => 'string') ) ), 'foo_2' => array( 'extends' => 'foo', 'parameters' => array( 'bar' => array('type' => 'string') ) ), 'foo_3' => array( 'class' => 'bar', 'parameters' => array( 'bar2' => array('type' => 'string') ) ), 'foo_4' => array( 'extends' => array('foo_2', 'foo_3'), 'parameters' => array( 'bar3' => array('type' => 'string') ) ) ) )); $this->assertTrue($description->hasOperation('foo_4')); $foo4 = $description->getOperation('foo_4'); $this->assertTrue($foo4->hasParam('baz')); $this->assertTrue($foo4->hasParam('bar')); $this->assertTrue($foo4->hasParam('bar2')); $this->assertTrue($foo4->hasParam('bar3')); $this->assertEquals('bar', $foo4->getClass()); } } tests/Guzzle/Tests/Service/Description/ServiceDescriptionTest.php000064400000016461151742734620021353 0ustar00serviceData = array( 'test_command' => new Operation(array( 'name' => 'test_command', 'description' => 'documentationForCommand', 'httpMethod' => 'DELETE', 'class' => 'Guzzle\\Tests\\Service\\Mock\\Command\\MockCommand', 'parameters' => array( 'bucket' => array('required' => true), 'key' => array('required' => true) ) )) ); } /** * @covers Guzzle\Service\Description\ServiceDescription::factory * @covers Guzzle\Service\Description\ServiceDescriptionLoader::build */ public function testFactoryDelegatesToConcreteFactories() { $jsonFile = __DIR__ . '/../../TestData/test_service.json'; $this->assertInstanceOf('Guzzle\Service\Description\ServiceDescription', ServiceDescription::factory($jsonFile)); } public function testConstructor() { $service = new ServiceDescription(array('operations' => $this->serviceData)); $this->assertEquals(1, count($service->getOperations())); $this->assertFalse($service->hasOperation('foobar')); $this->assertTrue($service->hasOperation('test_command')); } public function testIsSerializable() { $service = new ServiceDescription(array('operations' => $this->serviceData)); $data = serialize($service); $d2 = unserialize($data); $this->assertEquals(serialize($service), serialize($d2)); } public function testSerializesParameters() { $service = new ServiceDescription(array( 'operations' => array( 'foo' => new Operation(array('parameters' => array('foo' => array('type' => 'string')))) ) )); $serialized = serialize($service); $this->assertContains('"parameters":{"foo":', $serialized); $service = unserialize($serialized); $this->assertTrue($service->getOperation('foo')->hasParam('foo')); } public function testAllowsForJsonBasedArrayParamsFunctionalTest() { $description = new ServiceDescription(array( 'operations' => array( 'test' => new Operation(array( 'httpMethod' => 'PUT', 'parameters' => array( 'data' => array( 'required' => true, 'filters' => 'json_encode', 'location' => 'body' ) ) )) ) )); $client = new Client(); $client->setDescription($description); $command = $client->getCommand('test', array( 'data' => array( 'foo' => 'bar' ) )); $request = $command->prepare(); $this->assertEquals('{"foo":"bar"}', (string) $request->getBody()); } public function testContainsModels() { $d = new ServiceDescription(array( 'operations' => array('foo' => array()), 'models' => array( 'Tag' => array('type' => 'object'), 'Person' => array('type' => 'object') ) )); $this->assertTrue($d->hasModel('Tag')); $this->assertTrue($d->hasModel('Person')); $this->assertFalse($d->hasModel('Foo')); $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $d->getModel('Tag')); $this->assertNull($d->getModel('Foo')); $this->assertContains('"models":{', serialize($d)); $this->assertEquals(array('Tag', 'Person'), array_keys($d->getModels())); } public function testCanAddModels() { $d = new ServiceDescription(array()); $this->assertFalse($d->hasModel('Foo')); $d->addModel(new Parameter(array('name' => 'Foo'))); $this->assertTrue($d->hasModel('Foo')); } public function testHasAttributes() { $d = new ServiceDescription(array( 'operations' => array(), 'name' => 'Name', 'description' => 'Description', 'apiVersion' => '1.24' )); $this->assertEquals('Name', $d->getName()); $this->assertEquals('Description', $d->getDescription()); $this->assertEquals('1.24', $d->getApiVersion()); $s = serialize($d); $this->assertContains('"name":"Name"', $s); $this->assertContains('"description":"Description"', $s); $this->assertContains('"apiVersion":"1.24"', $s); $d = unserialize($s); $this->assertEquals('Name', $d->getName()); $this->assertEquals('Description', $d->getDescription()); $this->assertEquals('1.24', $d->getApiVersion()); } public function testPersistsCustomAttributes() { $data = array( 'operations' => array('foo' => array('class' => 'foo', 'parameters' => array())), 'name' => 'Name', 'description' => 'Test', 'apiVersion' => '1.24', 'auth' => 'foo', 'keyParam' => 'bar' ); $d = new ServiceDescription($data); $d->setData('hello', 'baz'); $this->assertEquals('foo', $d->getData('auth')); $this->assertEquals('baz', $d->getData('hello')); $this->assertEquals('bar', $d->getData('keyParam')); // responseClass and responseType are added by default $data['operations']['foo']['responseClass'] = 'array'; $data['operations']['foo']['responseType'] = 'primitive'; $this->assertEquals($data + array('hello' => 'baz'), json_decode($d->serialize(), true)); } public function testReturnsNullWhenRetrievingMissingOperation() { $s = new ServiceDescription(array()); $this->assertNull($s->getOperation('foo')); } public function testCanAddOperations() { $s = new ServiceDescription(array()); $this->assertFalse($s->hasOperation('Foo')); $s->addOperation(new Operation(array('name' => 'Foo'))); $this->assertTrue($s->hasOperation('Foo')); } /** * @expectedException Guzzle\Common\Exception\InvalidArgumentException */ public function testValidatesOperationTypes() { $s = new ServiceDescription(array( 'operations' => array('foo' => new \stdClass()) )); } public function testHasBaseUrl() { $description = new ServiceDescription(array('baseUrl' => 'http://foo.com')); $this->assertEquals('http://foo.com', $description->getBaseUrl()); $description->setBaseUrl('http://foobar.com'); $this->assertEquals('http://foobar.com', $description->getBaseUrl()); } public function testCanUseBasePath() { $description = new ServiceDescription(array('basePath' => 'http://foo.com')); $this->assertEquals('http://foo.com', $description->getBaseUrl()); } } tests/Guzzle/Tests/Service/Exception/CommandTransferExceptionTest.php000064400000002763151742734620022164 0ustar00addSuccessfulCommand($c1)->addFailedCommand($c2); $this->assertSame(array($c1), $e->getSuccessfulCommands()); $this->assertSame(array($c2), $e->getFailedCommands()); $this->assertSame(array($c1, $c2), $e->getAllCommands()); } public function testConvertsMultiExceptionIntoCommandTransfer() { $r1 = new Request('GET', 'http://foo.com'); $r2 = new Request('GET', 'http://foobaz.com'); $e = new MultiTransferException('Test', 123); $e->addSuccessfulRequest($r1)->addFailedRequest($r2); $ce = CommandTransferException::fromMultiTransferException($e); $this->assertInstanceOf('Guzzle\Service\Exception\CommandTransferException', $ce); $this->assertEquals('Test', $ce->getMessage()); $this->assertEquals(123, $ce->getCode()); $this->assertSame(array($r1), $ce->getSuccessfulRequests()); $this->assertSame(array($r2), $ce->getFailedRequests()); } } tests/Guzzle/Tests/Service/Exception/InconsistentClientTransferExceptionTest.php000064400000000635151742734620024421 0ustar00assertEquals($items, $e->getCommands()); } } tests/Guzzle/Tests/Service/Exception/ValidationExceptionTest.php000064400000000626151742734620021167 0ustar00setErrors($errors); $this->assertEquals($errors, $e->getErrors()); } } tests/Guzzle/Tests/Service/Mock/Command/IterableCommand.php000064400000001512151742734620017710 0ustar00 'iterable_command', 'parameters' => array( 'page_size' => array('type' => 'integer'), 'next_token' => array('type' => 'string') ) )); } protected function build() { $this->request = $this->client->createRequest('GET'); // Add the next token and page size query string values $this->request->getQuery()->set('next_token', $this->get('next_token')); if ($this->get('page_size')) { $this->request->getQuery()->set('page_size', $this->get('page_size')); } } } tests/Guzzle/Tests/Service/Mock/Command/MockCommand.php000064400000001565151742734620017062 0ustar00 get_called_class() == __CLASS__ ? 'mock_command' : 'sub.sub', 'httpMethod' => 'POST', 'parameters' => array( 'test' => array( 'default' => 123, 'required' => true, 'doc' => 'Test argument' ), '_internal' => array( 'default' => 'abc' ), 'foo' => array('filters' => array('strtoupper')) ) )); } protected function build() { $this->request = $this->client->createRequest(); } } tests/Guzzle/Tests/Service/Mock/Command/OtherCommand.php000064400000001434151742734620017245 0ustar00 'other_command', 'parameters' => array( 'test' => array( 'default' => '123', 'required' => true, 'doc' => 'Test argument' ), 'other' => array(), 'arg' => array('type' => 'string'), 'static' => array('static' => true, 'default' => 'this is static') ) )); } protected function build() { $this->request = $this->client->getRequest('HEAD'); } } tests/Guzzle/Tests/Service/Mock/Command/Sub/Sub.php000064400000000216151742734620016144 0ustar00 '{scheme}://127.0.0.1:8124/{api_version}/{subdomain}', 'scheme' => 'http', 'api_version' => 'v1' ), array('username', 'password', 'subdomain')); return new self($config->get('base_url'), $config); } } tests/Guzzle/Tests/Service/Mock/Model/MockCommandIterator.php000064400000001560151742734620020251 0ustar00nextToken) { $this->command->set('next_token', $this->nextToken); } $this->command->set('page_size', (int) $this->calculatePageSize()); $this->command->execute(); $data = json_decode($this->command->getResponse()->getBody(true), true); $this->nextToken = $data['next_token']; return $data['resources']; } public function next() { $this->calledNext++; parent::next(); } public function getResources() { return $this->resources; } public function getIteratedCount() { return $this->iteratedCount; } } tests/Guzzle/Tests/Service/Resource/CompositeResourceIteratorFactoryTest.php000064400000002470151742734620023562 0ustar00assertFalse($factory->canBuild($cmd)); $factory->build($cmd); } public function testBuildsResourceIterators() { $f1 = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock\Model'); $factory = new CompositeResourceIteratorFactory(array()); $factory->addFactory($f1); $command = new MockCommand(); $iterator = $factory->build($command, array('client.namespace' => 'Guzzle\Tests\Service\Mock')); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); } } tests/Guzzle/Tests/Service/Resource/MapResourceIteratorFactoryTest.php000064400000002512151742734620022332 0ustar00build(new MockCommand()); } public function testBuildsResourceIterators() { $factory = new MapResourceIteratorFactory(array( 'mock_command' => 'Guzzle\Tests\Service\Mock\Model\MockCommandIterator' )); $iterator = $factory->build(new MockCommand()); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); } public function testUsesWildcardMappings() { $factory = new MapResourceIteratorFactory(array( '*' => 'Guzzle\Tests\Service\Mock\Model\MockCommandIterator' )); $iterator = $factory->build(new MockCommand()); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); } } tests/Guzzle/Tests/Service/Resource/ModelTest.php000064400000002567151742734620016115 0ustar00 'object')); $model = new Model(array('foo' => 'bar'), $param); $this->assertSame($param, $model->getStructure()); $this->assertEquals('bar', $model->get('foo')); $this->assertEquals('bar', $model['foo']); } public function testCanBeUsedWithoutStructure() { $model = new Model(array( 'Foo' => 'baz', 'Bar' => array( 'Boo' => 'Bam' ) )); $transform = function ($key, $value) { return ($value && is_array($value)) ? new Collection($value) : $value; }; $model = $model->map($transform); $this->assertInstanceOf('Guzzle\Common\Collection', $model->getPath('Bar')); } public function testAllowsFiltering() { $model = new Model(array( 'Foo' => 'baz', 'Bar' => 'a' )); $model = $model->filter(function ($i, $v) { return $v[0] == 'a'; }); $this->assertEquals(array('Bar' => 'a'), $model->toArray()); } } tests/Guzzle/Tests/Service/Resource/ResourceIteratorApplyBatchedTest.php000064400000004334151742734620022631 0ustar00assertInternalType('array', ResourceIteratorApplyBatched::getAllEvents()); } /** * @covers Guzzle\Service\Resource\ResourceIteratorApplyBatched */ public function testSendsRequestsForNextSetOfResources() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 41\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"j\"] }", )); $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'), array( 'page_size' => 3, 'limit' => 7 )); $received = array(); $apply = new ResourceIteratorApplyBatched($ri, function(ResourceIterator $i, array $batch) use (&$received) { $received[] = $batch; }); $apply->apply(3); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals(3, count($requests)); $this->assertEquals(3, $requests[0]->getQuery()->get('page_size')); $this->assertEquals(3, $requests[1]->getQuery()->get('page_size')); $this->assertEquals(1, $requests[2]->getQuery()->get('page_size')); $this->assertEquals(array('d', 'e', 'f'), array_values($received[0])); $this->assertEquals(array('g', 'h', 'i'), array_values($received[1])); $this->assertEquals(array('j'), array_values($received[2])); $this->assertEquals(3, $apply->getBatchCount()); $this->assertEquals(7, $apply->getIteratedCount()); } } tests/Guzzle/Tests/Service/Resource/ResourceIteratorClassFactoryTest.php000064400000002762151742734620022671 0ustar00registerNamespace('Baz'); $command = new MockCommand(); $factory->build($command); } public function testBuildsResourceIterators() { $factory = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock\Model'); $command = new MockCommand(); $iterator = $factory->build($command, array('client.namespace' => 'Guzzle\Tests\Service\Mock')); $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator); } public function testChecksIfCanBuild() { $factory = new ResourceIteratorClassFactory('Guzzle\Tests\Service'); $this->assertFalse($factory->canBuild(new MockCommand())); $factory = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock\Model'); $this->assertTrue($factory->canBuild(new MockCommand())); } } tests/Guzzle/Tests/Service/Resource/ResourceIteratorTest.php000064400000020272151742734620020347 0ustar00assertInternalType('array', ResourceIterator::getAllEvents()); } /** * @covers Guzzle\Service\Resource\ResourceIterator */ public function testConstructorConfiguresDefaults() { $ri = $this->getMockForAbstractClass('Guzzle\\Service\\Resource\\ResourceIterator', array( $this->getServiceBuilder()->get('mock')->getCommand('iterable_command'), array( 'limit' => 10, 'page_size' => 3 ) ), 'MockIterator'); $this->assertEquals(false, $ri->getNextToken()); $this->assertEquals(false, $ri->current()); } /** * @covers Guzzle\Service\Resource\ResourceIterator */ public function testSendsRequestsForNextSetOfResources() { // Queue up an array of responses for iterating $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 41\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"j\"] }" )); // Create a new resource iterator using the IterableCommand mock $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'), array( 'page_size' => 3 )); // Ensure that no requests have been sent yet $this->assertEquals(0, count($this->getServer()->getReceivedRequests(false))); //$this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i', 'j'), $ri->toArray()); $ri->toArray(); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals(3, count($requests)); $this->assertEquals(3, $requests[0]->getQuery()->get('page_size')); $this->assertEquals(3, $requests[1]->getQuery()->get('page_size')); $this->assertEquals(3, $requests[2]->getQuery()->get('page_size')); // Reset and resend $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 41\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"j\"] }", )); $d = array(); reset($ri); foreach ($ri as $data) { $d[] = $data; } $this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i', 'j'), $d); } /** * @covers Guzzle\Service\Resource\ResourceIterator */ public function testCalculatesPageSize() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"j\", \"k\"] }" )); $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'), array( 'page_size' => 3, 'limit' => 7 )); $this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i', 'j'), $ri->toArray()); $requests = $this->getServer()->getReceivedRequests(true); $this->assertEquals(3, count($requests)); $this->assertEquals(3, $requests[0]->getQuery()->get('page_size')); $this->assertEquals(3, $requests[1]->getQuery()->get('page_size')); $this->assertEquals(1, $requests[2]->getQuery()->get('page_size')); } /** * @covers Guzzle\Service\Resource\ResourceIterator */ public function testUseAsArray() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"g\", \"h\", \"i\"] }" )); $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command')); // Ensure that the key is never < 0 $this->assertEquals(0, $ri->key()); $this->assertEquals(0, count($ri)); // Ensure that the iterator can be used as KVP array $data = array(); foreach ($ri as $key => $value) { $data[$key] = $value; } // Ensure that the iterate is countable $this->assertEquals(6, count($ri)); $this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i'), $data); } /** * @covers Guzzle\Service\Resource\ResourceIterator */ public function testBailsWhenSendReturnsNoResults() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [] }" )); $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command')); // Ensure that the iterator can be used as KVP array $data = $ri->toArray(); // Ensure that the iterate is countable $this->assertEquals(3, count($ri)); $this->assertEquals(array('d', 'e', 'f'), $data); $this->assertEquals(2, $ri->getRequestCount()); } /** * @covers Guzzle\Service\Resource\ResourceIterator::set * @covers Guzzle\Service\Resource\ResourceIterator::get */ public function testHoldsDataOptions() { $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command')); $this->assertNull($ri->get('foo')); $this->assertSame($ri, $ri->set('foo', 'bar')); $this->assertEquals('bar', $ri->get('foo')); } /** * @covers Guzzle\Service\Resource\ResourceIterator::setLimit * @covers Guzzle\Service\Resource\ResourceIterator::setPageSize */ public function testSettingLimitOrPageSizeClearsData() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }", "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }" )); $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command')); $ri->toArray(); $this->assertNotEmpty($this->readAttribute($ri, 'resources')); $ri->setLimit(10); $this->assertEmpty($this->readAttribute($ri, 'resources')); $ri->toArray(); $this->assertNotEmpty($this->readAttribute($ri, 'resources')); $ri->setPageSize(10); $this->assertEmpty($this->readAttribute($ri, 'resources')); } public function testWorksWithCustomAppendIterator() { $this->getServer()->flush(); $this->getServer()->enqueue(array( "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }" )); $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command')); $a = new \Guzzle\Iterator\AppendIterator(); $a->append($ri); $results = iterator_to_array($a, false); $this->assertEquals(4, $ri->calledNext); } } tests/Guzzle/Tests/Stream/PhpStreamRequestFactoryTest.php000064400000016655151742734620017730 0ustar00client = new Client($this->getServer()->getUrl()); $this->factory = new PhpStreamRequestFactory(); } public function testOpensValidStreamByCreatingContext() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request = $this->client->get('/'); $stream = $this->factory->fromRequest($request); $this->assertEquals('hi', (string) $stream); $headers = $this->factory->getLastResponseHeaders(); $this->assertContains('HTTP/1.1 200 OK', $headers); $this->assertContains('Content-Length: 2', $headers); $this->assertSame($headers, $stream->getCustomData('response_headers')); } public function testOpensValidStreamByPassingContextAndMerging() { $request = $this->client->get('/'); $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory') ->setMethods(array('createContext', 'createStream')) ->getMock(); $this->factory->expects($this->never()) ->method('createContext'); $this->factory->expects($this->once()) ->method('createStream') ->will($this->returnValue(new Stream(fopen('php://temp', 'r')))); $context = array('http' => array('method' => 'HEAD', 'ignore_errors' => false)); $this->factory->fromRequest($request, stream_context_create($context)); $options = stream_context_get_options($this->readAttribute($this->factory, 'context')); $this->assertEquals('HEAD', $options['http']['method']); $this->assertFalse($options['http']['ignore_errors']); $this->assertEquals('1.0', $options['http']['protocol_version']); } public function testAppliesProxySettings() { $request = $this->client->get('/'); $request->getCurlOptions()->set(CURLOPT_PROXY, 'tcp://foo.com'); $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory') ->setMethods(array('createStream')) ->getMock(); $this->factory->expects($this->once()) ->method('createStream') ->will($this->returnValue(new Stream(fopen('php://temp', 'r')))); $this->factory->fromRequest($request); $options = stream_context_get_options($this->readAttribute($this->factory, 'context')); $this->assertEquals('tcp://foo.com', $options['http']['proxy']); } public function testAddsPostFields() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request = $this->client->post('/', array('Foo' => 'Bar'), array('foo' => 'baz bar')); $stream = $this->factory->fromRequest($request); $this->assertEquals('hi', (string) $stream); $headers = $this->factory->getLastResponseHeaders(); $this->assertContains('HTTP/1.1 200 OK', $headers); $this->assertContains('Content-Length: 2', $headers); $this->assertSame($headers, $stream->getCustomData('response_headers')); $received = $this->getServer()->getReceivedRequests(); $this->assertEquals(1, count($received)); $this->assertContains('POST / HTTP/1.0', $received[0]); $this->assertContains('host: ', $received[0]); $this->assertContains('user-agent: Guzzle/', $received[0]); $this->assertContains('foo: Bar', $received[0]); $this->assertContains('content-length: 13', $received[0]); $this->assertContains('foo=baz%20bar', $received[0]); } public function testAddsBody() { $this->getServer()->flush(); $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request = $this->client->put('/', array('Foo' => 'Bar'), 'Testing...123'); $stream = $this->factory->fromRequest($request); $this->assertEquals('hi', (string) $stream); $headers = $this->factory->getLastResponseHeaders(); $this->assertContains('HTTP/1.1 200 OK', $headers); $this->assertContains('Content-Length: 2', $headers); $this->assertSame($headers, $stream->getCustomData('response_headers')); $received = $this->getServer()->getReceivedRequests(); $this->assertEquals(1, count($received)); $this->assertContains('PUT / HTTP/1.0', $received[0]); $this->assertContains('host: ', $received[0]); $this->assertContains('user-agent: Guzzle/', $received[0]); $this->assertContains('foo: Bar', $received[0]); $this->assertContains('content-length: 13', $received[0]); $this->assertContains('Testing...123', $received[0]); } public function testCanDisableSslValidation() { $request = $this->client->get('/'); $request->getCurlOptions()->set(CURLOPT_SSL_VERIFYPEER, false); $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory') ->setMethods(array('createStream')) ->getMock(); $this->factory->expects($this->once()) ->method('createStream') ->will($this->returnValue(new Stream(fopen('php://temp', 'r')))); $this->factory->fromRequest($request); $options = stream_context_get_options($this->readAttribute($this->factory, 'context')); $this->assertFalse($options['ssl']['verify_peer']); } public function testUsesSslValidationByDefault() { $request = $this->client->get('/'); $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory') ->setMethods(array('createStream')) ->getMock(); $this->factory->expects($this->once()) ->method('createStream') ->will($this->returnValue(new Stream(fopen('php://temp', 'r')))); $this->factory->fromRequest($request); $options = stream_context_get_options($this->readAttribute($this->factory, 'context')); $this->assertTrue($options['ssl']['verify_peer']); $this->assertSame($request->getCurlOptions()->get(CURLOPT_CAINFO), $options['ssl']['cafile']); } public function testBasicAuthAddsUserAndPassToUrl() { $request = $this->client->get('/'); $request->setAuth('Foo', 'Bar'); $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory') ->setMethods(array('createStream')) ->getMock(); $this->factory->expects($this->once()) ->method('createStream') ->will($this->returnValue(new Stream(fopen('php://temp', 'r')))); $this->factory->fromRequest($request); $this->assertContains('Foo:Bar@', (string) $this->readAttribute($this->factory, 'url')); } public function testCanCreateCustomStreamClass() { $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"); $request = $this->client->get('/'); $stream = $this->factory->fromRequest($request, array(), array('stream_class' => 'Guzzle\Http\EntityBody')); $this->assertInstanceOf('Guzzle\Http\EntityBody', $stream); } } tests/Guzzle/Tests/Stream/StreamTest.php000064400000015422151742734620014346 0ustar00assertEquals($handle, $stream->getStream()); $this->assertTrue($stream->isReadable()); $this->assertTrue($stream->isWritable()); $this->assertTrue($stream->isLocal()); $this->assertTrue($stream->isSeekable()); $this->assertEquals('PHP', $stream->getWrapper()); $this->assertEquals('TEMP', $stream->getStreamType()); $this->assertEquals(4, $stream->getSize()); $this->assertEquals('php://temp', $stream->getUri()); $this->assertEquals(array(), $stream->getWrapperData()); $this->assertFalse($stream->isConsumed()); unset($stream); } /** * @covers Guzzle\Stream\Stream::getStream * @covers Guzzle\Stream\Stream::setStream */ public function testCanModifyStream() { $handle1 = fopen('php://temp', 'r+'); $handle2 = fopen('php://temp', 'r+'); $stream = new Stream($handle1); $this->assertSame($handle1, $stream->getStream()); $stream->setStream($handle2, 10); $this->assertEquals(10, $stream->getSize()); $this->assertSame($handle2, $stream->getStream()); } /** * @covers Guzzle\Stream\Stream::__destruct */ public function testStreamClosesHandleOnDestruct() { $handle = fopen('php://temp', 'r'); $stream = new Stream($handle); unset($stream); $this->assertFalse(is_resource($handle)); } /** * @covers Guzzle\Stream\Stream::__toString */ public function testConvertsToString() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertEquals('data', (string)$stream); unset($stream); $handle = fopen(__DIR__ . '/../TestData/FileBody.txt', 'w'); $stream = new Stream($handle); $this->assertEquals('', (string)$stream); unset($stream); } /** * @covers Guzzle\Stream\Stream::__toString */ public function testConvertsToStringAndRestoresCursorPos() { $handle = fopen('php://temp', 'w+'); $stream = new Stream($handle); $stream->write('foobazbar'); $stream->seek(3); $this->assertEquals('foobazbar', (string) $stream); $this->assertEquals(3, $stream->ftell()); } /** * @covers Guzzle\Stream\Stream::isConsumed */ public function testIsConsumed() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertFalse($stream->isConsumed()); $stream->read(4); $this->assertTrue($stream->isConsumed()); } /** * @covers Guzzle\Stream\Stream::setSize * @covers Guzzle\Stream\Stream::getSize */ public function testAllowsSettingManualSize() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $stream->setSize(10); $this->assertEquals(10, $stream->getSize()); unset($stream); } /** * @covers Guzzle\Stream\Stream::read * @covers Guzzle\Stream\Stream::write * @covers Guzzle\Stream\Stream::seek * @covers Guzzle\Stream\Stream::isReadable * @covers Guzzle\Stream\Stream::isSeekable */ public function testWrapsStream() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertTrue($stream->isSeekable()); $this->assertTrue($stream->isReadable()); $this->assertTrue($stream->seek(0)); $this->assertEquals('da', $stream->read(2)); $this->assertEquals('ta', $stream->read(2)); $this->assertTrue($stream->seek(0)); $this->assertEquals('data', $stream->read(4)); $stream->write('_appended'); $stream->seek(0); $this->assertEquals('data_appended', $stream->read(13)); } /** * @covers Guzzle\Stream\Stream::getSize * @covers Guzzle\Stream\Stream::__construct */ public function testGetSize() { $size = filesize(__DIR__ . '/../../../bootstrap.php'); $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r'); $stream = new Stream($handle); $this->assertEquals($handle, $stream->getStream()); $this->assertEquals($size, $stream->getSize()); $this->assertEquals($size, $stream->getSize()); unset($stream); // Make sure that false is returned when the size cannot be determined $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); $handle = fopen('http://localhost:' . $this->getServer()->getPort(), 'r'); $stream = new Stream($handle); $this->assertEquals(false, $stream->getSize()); unset($stream); } /** * @covers Guzzle\Stream\Stream::getMetaData */ public function testAbstractsMetaData() { $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r'); $stream = new Stream($handle); $this->assertEquals('plainfile', $stream->getMetaData('wrapper_type')); $this->assertEquals(null, $stream->getMetaData('wrapper_data')); $this->assertInternalType('array', $stream->getMetaData()); } /** * @covers Guzzle\Stream\Stream::write */ public function testDoesNotAttemptToWriteToReadonlyStream() { $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r'); $stream = new Stream($handle); $this->assertEquals(0, $stream->write('foo')); } /** * @covers Guzzle\Stream\Stream::ftell */ public function testProvidesStreamPosition() { $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r'); $stream = new Stream($handle); $stream->read(2); $this->assertSame(ftell($handle), $stream->ftell()); $this->assertEquals(2, $stream->ftell()); } /** * @covers Guzzle\Stream\Stream::rewind */ public function testRewindIsSeekZero() { $stream = new Stream(fopen('php://temp', 'w+')); $stream->write('foobazbar'); $this->assertTrue($stream->rewind()); $this->assertEquals('foobazbar', $stream->read(9)); } } tests/Guzzle/Tests/TestData/FileBody.txt000075500000000000151742734620014243 0ustar00tests/Guzzle/Tests/TestData/description/bar.json000064400000000040151742734620015770 0ustar00{ "includes": ["foo.json"] }tests/Guzzle/Tests/TestData/description/baz.json000064400000000054151742734620016005 0ustar00{ "includes": ["foo.json", "bar.json"] }tests/Guzzle/Tests/TestData/description/foo.json000064400000000203151742734620016010 0ustar00{ "includes": ["recursive.json"], "operations": { "abstract": { "httpMethod": "POST" } } } tests/Guzzle/Tests/TestData/description/recursive.json000064400000000040151742734620017233 0ustar00{ "includes": ["foo.json"] }tests/Guzzle/Tests/TestData/mock_response000064400000000043151742734620014603 0ustar00HTTP/1.1 200 OK Content-Length: 0 tests/Guzzle/Tests/TestData/services/json1.json000064400000000653151742734620015570 0ustar00{ "includes": [ "json2.json" ], "services": { "abstract": { "access_key": "xyz", "secret": "abc" }, "mock": { "class": "Guzzle\\Tests\\Service\\Mock\\MockClient", "extends": "abstract", "params": { "username": "foo", "password": "baz", "subdomain": "bar" } } } } tests/Guzzle/Tests/TestData/services/json2.json000064400000000336151742734620015567 0ustar00{ "services": { "foo": { "class": "Guzzle\\Tests\\Service\\Mock\\MockClient", "extends": "abstract", "params": { "baz": "bar" } } } } tests/Guzzle/Tests/TestData/services/services.json000064400000003336151742734620016362 0ustar00{ "abstract": { "access_key": "xyz", "secret": "abc" }, "mock": { "class": "Guzzle\\Tests\\Service\\Mock\\MockClient", "extends": "abstract", "params": { "username": "foo", "password": "baz", "subdomain": "bar" } }, "test.abstract.aws": { "params": { "access_key": "12345", "secret_key": "abcd" } }, "test.s3": { "class": "Guzzle\\Service\\Aws\\S3Client", "extends": "test.abstract.aws", "params": { "devpay_product_token": "", "devpay_user_token": "" } }, "test.simple_db": { "class": "Guzzle\\Service\\Aws\\SimpleDb\\SimpleDbClient", "extends": "test.abstract.aws" }, "test.sqs": { "class": "Guzzle\\Service\\Aws\\Sqs\\SqsClient", "extends": "test.abstract.aws" }, "test.centinel": { "class": "Guzzle\\Service\\CardinalCommerce\\Centinel.CentinelClient", "params": { "password": "test", "processor_id": "123", "merchant_id": "456" } }, "test.mws": { "class": "Guzzle\\Service\\Mws\\MwsClient", "extends": "test.abstract.aws", "params": { "merchant_id": "ABCDE", "marketplace_id": "FGHIJ", "application_name": "GuzzleTest", "application_version": "0.1", "base_url": "https://mws.amazonservices.com" } }, "mock": { "class": "Guzzle\\Tests\\Service\\Mock\\MockClient", "params": { "username": "test_user", "password": "****", "subdomain": "test" } } } tests/Guzzle/Tests/TestData/test_service.json000064400000002225151742734620015407 0ustar00{ "includes": [ "test_service2.json" ], "operations": { "test": { "uri": "/path" }, "concrete": { "extends": "abstract" }, "foo_bar": { "uri": "/testing", "parameters": { "other": { "location": "json", "location_key": "Other" }, "test": { "type": "object", "location": "json", "properties": { "baz": { "type": "boolean", "default": true }, "bar": { "type": "string", "filters": [ { "method": "strtolower", "args": ["test", "@value"] }, "strtoupper" ] } } } } } } } tests/Guzzle/Tests/TestData/test_service2.json000064400000000135151742734620015467 0ustar00{ "operations": { "abstract": { "uri": "/abstract" } } } tests/bootstrap.php000064400000002172151742734620010451 0ustar00