Permalink
Browse files

Guzzle 2.0

Adopting composer for dependency management
Updating LICENSE, travis build file, making better use of git ignores, and remove unused build target
Removing @author tags.  Use the commit history for a changelog.
Moving files from build folder to /
Adding min build target to product a Guzzle only phar with no autoloader
[Common] Accepting ZF1 or ZF2 cache in ZendCacheAdapter
[Common] Optimizing Stream wrapper and EntityBody abstractions.
[Common] [Http] Migrating from Guzzle event system to the Symfony2 event dispatcher
[Common] Moved Inflector and Inspector to Service namespace
[Http] Simplifying Guzzle\Guzzle curl detection
[Http] Removing Guzzle\Http\Pool and now using Guzzle\Http\Curl\CurlMulti
[Http] The helper methods from Guzzle\Http\Message\RequestFactory have been removed to prevent confusion and encourage developers to use Guzzle\Http\Client to create requests.
[Http] Clients can now send one or more requests in an array using the send() method, so the batch() method was removed.
[Http] Updating curl multi to allow blocking calls while sending other transfers
[Http] Making the Request::hasHeader method more intuitive.  Guzzle\Http\Message\AbstractMessage::hasHeader() now returns true if the header is found using exact matching.  If the header is found using a regex or case-insensitive match, then it will return the name of the found header.
[Http] Removing content-type guessing from EntityBody based on file extension and solely using finfo.
[Http] Adding basic auth plugin
[Http] Cleaning up CookieJar and CurlMulti
[Http] Removing custom rawurlencode from QueryString because PHP 5.3 now properly deals with tilde characters.
[Http] Minor optimization to parsing messages in RequestFactory
[Http] Adding Guzzle\Http\Client for developers that don't need commands or service descriptions
[Http] Making it easier to set a global User-Agent header for a Guzzle\Http\Client
[Http] Fixing the discrepancies between the ClientInterface and Guzzle\Http\Client
[Http] Adding the ability to set and retrieve tokenized headers from Requests and Responses
[Service] Ditching NIH filters and using the Symfony2 validator
[Service] Moving most service building logic to the ServiceBuilder::factory method so that it is easier to build custom config readers.
[Service] Allowing deep nested command inheritance.
[Service] Cleaning up Inflector caching.
[Service] Getting rid of concept of can_batch because everything is now sent in parallel.
[Service] Adding a JSON description builder.
[Service] Cleaning up ResourceIteratorApplyBatched.
[Service] Removing caching stuff from ServiceBuilder because the data being cached is extremely fast to generate.
[Service] Added a method to serialize the ServiceDescription in case a ServiceDescription needs to be cached in an application.
[Service] Making description builders use static methods.
[Service] Adding support to include other description files for XML and JSON description builders.
[Service] Adding support for filters to ApiCommands
[Service] Using {{}} instead of $. to reference other services as a dependency for another service
  • Loading branch information...
1 parent 85dae7d commit 4c46e7701530f45e7893d03537b05073a3ea639e @mtdowling mtdowling committed Jan 14, 2012
Showing with 6,036 additions and 19,697 deletions.
  1. +16 −6 .gitignore
  2. +0 −9 .gitmodules
  3. +3 −5 .travis.yml
  4. +1 −1 LICENSE
  5. +23 −11 README.md
  6. +24 −0 autoload.php
  7. +42 −0 build.xml
  8. +0 −22 build/autoload.php
  9. +0 −53 build/build.xml
  10. +55 −10 composer.json
  11. +0 −2 phpunit.xml.dist
  12. +55 −0 src/Guzzle/Common/AbstractHasDispatcher.php
  13. +1 −9 src/Guzzle/Common/Cache/AbstractCacheAdapter.php
  14. +0 −2 src/Guzzle/Common/Cache/CacheAdapterInterface.php
  15. +6 −30 src/Guzzle/Common/Cache/DoctrineCacheAdapter.php
  16. +13 −34 src/Guzzle/Common/Cache/ZendCacheAdapter.php
  17. +5 −10 src/Guzzle/Common/Collection.php
  18. +66 −0 src/Guzzle/Common/Event.php
  19. +0 −30 src/Guzzle/Common/Event/AbstractSubject.php
  20. +0 −234 src/Guzzle/Common/Event/EventManager.php
  21. +0 −22 src/Guzzle/Common/Event/Observer.php
  22. +0 −18 src/Guzzle/Common/Event/Subject.php
  23. +58 −0 src/Guzzle/Common/ExceptionCollection.php
  24. +0 −77 src/Guzzle/Common/Filter/AbstractFilter.php
  25. +0 −24 src/Guzzle/Common/Filter/ArrayFilter.php
  26. +0 −33 src/Guzzle/Common/Filter/BooleanFilter.php
  27. +0 −40 src/Guzzle/Common/Filter/ClassFilter.php
  28. +0 −34 src/Guzzle/Common/Filter/ClosureFilter.php
  29. +0 −36 src/Guzzle/Common/Filter/DateFilter.php
  30. +0 −39 src/Guzzle/Common/Filter/EnumFilter.php
  31. +0 −22 src/Guzzle/Common/Filter/FilterInterface.php
  32. +0 −25 src/Guzzle/Common/Filter/FloatFilter.php
  33. +0 −25 src/Guzzle/Common/Filter/IntegerFilter.php
  34. +0 −36 src/Guzzle/Common/Filter/RegexFilter.php
  35. +0 −25 src/Guzzle/Common/Filter/StringFilter.php
  36. +0 −31 src/Guzzle/Common/Filter/TimestampFilter.php
  37. +0 −12 src/Guzzle/Common/GuzzleException.php
  38. +10 −0 src/Guzzle/Common/GuzzleExceptionInterface.php
  39. +42 −0 src/Guzzle/Common/HasDispatcherInterface.php
  40. +0 −102 src/Guzzle/Common/Inflector.php
  41. +1 −8 src/Guzzle/Common/Log/AbstractLogAdapter.php
  42. +1 −8 src/Guzzle/Common/Log/ClosureLogAdapter.php
  43. +1 −5 src/Guzzle/Common/Log/LogAdapterInterface.php
  44. +1 −7 src/Guzzle/Common/Log/MonologLogAdapter.php
  45. +7 −12 src/Guzzle/Common/Log/ZendLogAdapter.php
  46. +15 −76 src/Guzzle/Common/NullObject.php
  47. +46 −142 src/Guzzle/Common/Stream.php
  48. +0 −3 src/Guzzle/Common/XmlElement.php
  49. +20 −40 src/Guzzle/Guzzle.php
  50. +391 −0 src/Guzzle/Http/Client.php
  51. +200 −0 src/Guzzle/Http/ClientInterface.php
  52. +3 −7 src/Guzzle/Http/Cookie.php
  53. +6 −17 src/Guzzle/Http/CookieJar/ArrayCookieJar.php
  54. +0 −2 src/Guzzle/Http/CookieJar/CookieJarInterface.php
  55. +3 −5 src/Guzzle/Http/CookieJar/FileCookieJar.php
  56. +15 −7 src/Guzzle/Http/Curl/CurlException.php
  57. +0 −474 src/Guzzle/Http/Curl/CurlFactory.php
  58. +0 −32 src/Guzzle/Http/Curl/CurlFactoryInterface.php
  59. +149 −267 src/Guzzle/Http/Curl/CurlHandle.php
  60. +485 −0 src/Guzzle/Http/Curl/CurlMulti.php
  61. +19 −18 src/Guzzle/Http/{Pool/PoolInterface.php → Curl/CurlMultiInterface.php}
  62. +21 −109 src/Guzzle/Http/EntityBody.php
  63. +1 −5 src/Guzzle/Http/HttpException.php
  64. +97 −47 src/Guzzle/Http/Message/AbstractMessage.php
  65. +0 −2 src/Guzzle/Http/Message/BadResponseException.php
  66. +101 −125 src/Guzzle/Http/Message/EntityEnclosingRequest.php
  67. +37 −11 src/Guzzle/Http/Message/EntityEnclosingRequestInterface.php
  68. +52 −24 src/Guzzle/Http/Message/MessageInterface.php
  69. +170 −291 src/Guzzle/Http/Message/Request.php
  70. +4 −2 src/Guzzle/Http/Message/RequestException.php
  71. +10 −103 src/Guzzle/Http/Message/RequestFactory.php
  72. +21 −45 src/Guzzle/Http/Message/RequestInterface.php
  73. +15 −23 src/Guzzle/Http/Message/Response.php
  74. +46 −0 src/Guzzle/Http/Plugin/BasicAuthPlugin.php
  75. +85 −89 src/Guzzle/Http/Plugin/CachePlugin.php
  76. +72 −54 src/Guzzle/Http/Plugin/CookiePlugin.php
  77. +56 −62 src/Guzzle/Http/Plugin/ExponentialBackoffPlugin.php
  78. +13 −9 src/Guzzle/Http/Plugin/HistoryPlugin.php
  79. +98 −69 src/Guzzle/Http/Plugin/LogPlugin.php
  80. +24 −21 src/Guzzle/Http/Plugin/Md5ValidatorPlugin.php
  81. +34 −20 src/Guzzle/{Service → Http}/Plugin/MockPlugin.php
  82. +0 −268 src/Guzzle/Http/Pool/Pool.php
  83. +0 −63 src/Guzzle/Http/Pool/PoolRequestException.php
  84. +18 −45 src/Guzzle/Http/QueryString.php
  85. +12 −15 src/Guzzle/Http/Url.php
  86. +20 −379 src/Guzzle/Service/Client.php
  87. +2 −197 src/Guzzle/Service/ClientInterface.php
  88. +13 −33 src/Guzzle/Service/Command/AbstractCommand.php
  89. +0 −16 src/Guzzle/Service/Command/ClosureCommand.php
  90. +0 −9 src/Guzzle/Service/Command/CommandInterface.php
  91. +39 −70 src/Guzzle/Service/Command/CommandSet.php
  92. +0 −2 src/Guzzle/Service/Command/CommandSetException.php
  93. +35 −86 src/Guzzle/Service/Description/ApiCommand.php
  94. +0 −2 src/Guzzle/Service/Description/CommandFactoryInterface.php
  95. +3 −3 src/Guzzle/Service/Description/DescriptionBuilderInterface.php
  96. +9 −14 src/Guzzle/Service/Description/DynamicCommandFactory.php
  97. +38 −0 src/Guzzle/Service/Description/JsonDescriptionBuilder.php
  98. +51 −23 src/Guzzle/Service/Description/ServiceDescription.php
  99. +56 −113 src/Guzzle/Service/Description/XmlDescriptionBuilder.php
  100. +75 −0 src/Guzzle/Service/Inflector.php
  101. +118 −72 src/Guzzle/{Common → Service}/Inspector.php
  102. +29 −29 src/Guzzle/Service/ResourceIterator.php
  103. +25 −17 src/Guzzle/Service/ResourceIteratorApplyBatched.php
  104. +41 −67 src/Guzzle/Service/ServiceBuilder.php
  105. +57 −0 tests/Guzzle/Tests/Common/AbstractHasDispatcherTest.php
  106. +0 −3 tests/Guzzle/Tests/Common/Cache/CacheAdapterTest.php
  107. +12 −7 tests/Guzzle/Tests/Common/Cache/ZendCacheAdapterTest.php
  108. +0 −3 tests/Guzzle/Tests/Common/CollectionTest.php
  109. +0 −23 tests/Guzzle/Tests/Common/Event/AbstractSubjectTest.php
  110. +0 −236 tests/Guzzle/Tests/Common/Event/EventManagerTest.php
  111. +62 −0 tests/Guzzle/Tests/Common/EventTest.php
  112. +46 −0 tests/Guzzle/Tests/Common/ExceptionCollectionTest.php
  113. +0 −151 tests/Guzzle/Tests/Common/Filter/FilterImpTest.php
  114. +0 −87 tests/Guzzle/Tests/Common/Filter/FilterTest.php
  115. +0 −5 tests/Guzzle/Tests/Common/Log/ClosureLogAdapterTest.php
  116. +0 −3 tests/Guzzle/Tests/Common/Log/MonologLogAdapterTest.php
  117. +4 −5 tests/Guzzle/Tests/Common/Log/ZendLogAdapterTest.php
  118. +0 −45 tests/Guzzle/Tests/Common/Mock/MockFilter.php
  119. +0 −14 tests/Guzzle/Tests/Common/Mock/MockFilterCommand.php
  120. +0 −37 tests/Guzzle/Tests/Common/Mock/MockObserver.php
  121. +0 −10 tests/Guzzle/Tests/Common/Mock/MockSubject.php
  122. +0 −3 tests/Guzzle/Tests/Common/NullObjectTest.php
  123. +6 −57 tests/Guzzle/Tests/Common/StreamTest.php
  124. +0 −4 tests/Guzzle/Tests/Common/XmlElementTest.php
  125. +0 −3 tests/Guzzle/Tests/GuzzleTest.php
  126. +55 −7 tests/Guzzle/Tests/GuzzleTestCase.php
  127. +432 −0 tests/Guzzle/Tests/Http/ClientTest.php
  128. +0 −6 tests/Guzzle/Tests/Http/CookieJar/ArrayCookieJarTest.php
  129. +0 −3 tests/Guzzle/Tests/Http/CookieJar/FileCookieJarTest.php
  130. +0 −3 tests/Guzzle/Tests/Http/CookieTest.php
  131. +6 −7 tests/Guzzle/Tests/Http/Curl/CurlExceptionTest.php
  132. +0 −737 tests/Guzzle/Tests/Http/Curl/CurlFactoryTest.php
  133. +326 −170 tests/Guzzle/Tests/Http/Curl/CurlHandleTest.php
  134. +490 −0 tests/Guzzle/Tests/Http/Curl/CurlMultiTest.php
  135. +1 −2 tests/Guzzle/Tests/Http/EntityBodyTest.php
  136. +91 −7 tests/Guzzle/Tests/Http/Message/AbstractMessageTest.php
  137. +173 −77 tests/Guzzle/Tests/Http/Message/EntityEnclosingRequestTest.php
  138. +0 −3 tests/Guzzle/Tests/Http/Message/ExceptionTest.php
  139. +20 −24 tests/Guzzle/Tests/Http/Message/RequestFactoryTest.php
  140. +115 −73 tests/Guzzle/Tests/Http/Message/RequestTest.php
  141. +4 −6 tests/Guzzle/Tests/Http/Message/ResponseTest.php
  142. +22 −0 tests/Guzzle/Tests/Http/Plugin/BasicAuthPluginTest.php
  143. +64 −73 tests/Guzzle/Tests/Http/Plugin/CachePluginTest.php
  144. +31 −22 tests/Guzzle/Tests/Http/Plugin/CookiePluginTest.php
  145. +18 −17 tests/Guzzle/Tests/Http/Plugin/ExponentialBackoffTest.php
  146. +18 −8 tests/Guzzle/Tests/Http/Plugin/HistoryPluginTest.php
  147. +29 −41 tests/Guzzle/Tests/Http/Plugin/LogPluginTest.php
  148. +34 −25 tests/Guzzle/Tests/Http/Plugin/Md5ValidatorPluginTest.php
  149. +42 −40 tests/Guzzle/Tests/{Service → Http}/Plugin/MockPluginTest.php
  150. +0 −14 tests/Guzzle/Tests/Http/Pool/MockPool.php
  151. +0 −252 tests/Guzzle/Tests/Http/Pool/PoolTest.php
  152. +0 −7 tests/Guzzle/Tests/Http/QueryStringTest.php
  153. +13 −8 tests/Guzzle/Tests/Http/Server.php
  154. +0 −3 tests/Guzzle/Tests/Http/UrlTest.php
  155. +6 −1 tests/Guzzle/Tests/Http/server.js
  156. +11 −0 tests/Guzzle/Tests/Mock/MockMulti.php
  157. +70 −0 tests/Guzzle/Tests/Mock/MockObserver.php
  158. +7 −0 tests/Guzzle/Tests/Mock/MockSubject.php
  159. +9 −354 tests/Guzzle/Tests/Service/ClientTest.php
  160. +1 −5 tests/Guzzle/Tests/Service/Command/AbstractCommandTest.php
  161. +1 −19 tests/Guzzle/Tests/Service/Command/ClosureCommandTest.php
  162. +18 −27 tests/Guzzle/Tests/Service/Command/CommandSetTest.php
  163. +4 −11 tests/Guzzle/Tests/Service/Command/CommandTest.php
  164. +26 −18 tests/Guzzle/Tests/Service/Description/ApiCommandTest.php
  165. +18 −27 tests/Guzzle/Tests/Service/Description/DynamicCommandFactoryTest.php
  166. +29 −0 tests/Guzzle/Tests/Service/Description/JsonDescriptionBuilderTest.php
  167. +92 −13 tests/Guzzle/Tests/Service/Description/ServiceDescriptionTest.php
  168. +11 −79 tests/Guzzle/Tests/Service/Description/XmlDescriptionBuilderTest.php
  169. +3 −14 tests/Guzzle/Tests/{Common → Service}/InflectorTest.php
  170. +99 −65 tests/Guzzle/Tests/{Common → Service}/InspectorTest.php
  171. +0 −16 tests/Guzzle/Tests/Service/Mock/Command/MockCommand.php
  172. +0 −2 tests/Guzzle/Tests/Service/Mock/Command/OtherCommand.php
  173. +0 −2 tests/Guzzle/Tests/Service/Mock/Command/Sub/Sub.php
  174. +1 −3 tests/Guzzle/Tests/Service/Mock/MockClient.php
  175. +17 −0 tests/Guzzle/Tests/Service/Mock/MockInflector.php
  176. +0 −3 tests/Guzzle/Tests/Service/Mock/MockResourceIterator.php
  177. +8 −1 tests/Guzzle/Tests/Service/ResourceIteratorApplyBatchedTest.php
  178. +8 −1 tests/Guzzle/Tests/Service/ResourceIteratorTest.php
  179. +49 −38 tests/Guzzle/Tests/Service/ServiceBuilderTest.php
  180. +12 −0 tests/Guzzle/Tests/TestData/test_service.json
  181. +15 −8 tests/Guzzle/Tests/TestData/test_service.xml
  182. +7 −0 tests/Guzzle/Tests/TestData/test_service2.json
  183. +6 −0 tests/Guzzle/Tests/TestData/test_service2.xml
  184. +13 −14 tests/bootstrap.php
  185. +0 −1 vendor/Doctrine
  186. +0 −1 vendor/Monolog
  187. +0 −1 vendor/Symfony/Component/ClassLoader
  188. +0 −250 vendor/Zend/Cache.php
  189. +0 −266 vendor/Zend/Cache/Backend.php
  190. +0 −355 vendor/Zend/Cache/Backend/Apc.php
  191. +0 −250 vendor/Zend/Cache/Backend/BlackHole.php
  192. +0 −126 vendor/Zend/Cache/Backend/ExtendedInterface.php
  193. +0 −1,006 vendor/Zend/Cache/Backend/File.php
  194. +0 −99 vendor/Zend/Cache/Backend/Interface.php
  195. +0 −484 vendor/Zend/Cache/Backend/Libmemcached.php
  196. +0 −504 vendor/Zend/Cache/Backend/Memcached.php
  197. +0 −679 vendor/Zend/Cache/Backend/Sqlite.php
  198. +0 −559 vendor/Zend/Cache/Backend/Static.php
  199. +0 −413 vendor/Zend/Cache/Backend/Test.php
  200. +0 −536 vendor/Zend/Cache/Backend/TwoLevels.php
  201. +0 −221 vendor/Zend/Cache/Backend/Xcache.php
  202. +0 −317 vendor/Zend/Cache/Backend/ZendPlatform.php
  203. +0 −207 vendor/Zend/Cache/Backend/ZendServer.php
  204. +0 −100 vendor/Zend/Cache/Backend/ZendServer/Disk.php
  205. +0 −100 vendor/Zend/Cache/Backend/ZendServer/ShMem.php
  206. +0 −757 vendor/Zend/Cache/Core.php
  207. +0 −32 vendor/Zend/Cache/Exception.php
  208. +0 −88 vendor/Zend/Cache/Frontend/Capture.php
  209. +0 −259 vendor/Zend/Cache/Frontend/Class.php
  210. +0 −218 vendor/Zend/Cache/Frontend/File.php
  211. +0 −180 vendor/Zend/Cache/Frontend/Function.php
  212. +0 −106 vendor/Zend/Cache/Frontend/Output.php
  213. +0 −402 vendor/Zend/Cache/Frontend/Page.php
  214. +0 −298 vendor/Zend/Cache/Manager.php
  215. +0 −96 vendor/Zend/Exception.php
  216. +0 −583 vendor/Zend/Log.php
  217. +0 −33 vendor/Zend/Log/Exception.php
  218. +0 −38 vendor/Zend/Log/FactoryInterface.php
  219. +0 −60 vendor/Zend/Log/Filter/Abstract.php
  220. +0 −40 vendor/Zend/Log/Filter/Interface.php
  221. +0 −85 vendor/Zend/Log/Filter/Message.php
  222. +0 −101 vendor/Zend/Log/Filter/Priority.php
  223. +0 −77 vendor/Zend/Log/Filter/Suppress.php
  224. +0 −50 vendor/Zend/Log/Formatter/Firebug.php
  225. +0 −41 vendor/Zend/Log/Formatter/Interface.php
  226. +0 −86 vendor/Zend/Log/Formatter/Simple.php
  227. +0 −122 vendor/Zend/Log/Formatter/Xml.php
  228. +0 −138 vendor/Zend/Log/Writer/Abstract.php
  229. +0 −145 vendor/Zend/Log/Writer/Db.php
  230. +0 −204 vendor/Zend/Log/Writer/Firebug.php
  231. +0 −430 vendor/Zend/Log/Writer/Mail.php
  232. +0 −81 vendor/Zend/Log/Writer/Mock.php
  233. +0 −56 vendor/Zend/Log/Writer/Null.php
  234. +0 −138 vendor/Zend/Log/Writer/Stream.php
  235. +0 −262 vendor/Zend/Log/Writer/Syslog.php
  236. +0 −131 vendor/Zend/Log/Writer/ZendMonitor.php
View
@@ -1,10 +1,20 @@
+# Ingore common cruft
.DS_STORE
coverage
+
+# Ignore binary files
+guzzle.phar
+
+# Ignore potentially sensitive phpunit file
phpunit.xml
-build/guzzle.phar
-build/guzzle-na.phar
-src/Guzzle/Aws/
-src/Guzzle/CardinalCommerce/
-src/Guzzle/Unfuddle/
+
+# Helps to ignore services being tested
+src/Guzzle/
+!src/Guzzle/Guzzle.php
+!src/Guzzle/Common
+!src/Guzzle/Http
+!src/Guzzle/Service
+
+# Ignore composer generated files
composer.lock
-vendor/.composer
+vendor/
View
@@ -1,9 +0,0 @@
-[submodule "vendor/Symfony/Component/ClassLoader"]
- path = vendor/Symfony/Component/ClassLoader
- url = https://github.com/symfony/ClassLoader
-[submodule "vendor/Doctrine"]
- path = vendor/Doctrine
- url = https://github.com/doctrine/common
-[submodule "vendor/Monolog"]
- path = vendor/Monolog
- url = https://github.com/Seldaek/monolog.git
View
@@ -3,10 +3,8 @@ php:
- 5.3
- 5.4
before_script:
- - git submodule update --init
+ - wget --quiet http://getcomposer.org/composer.phar
+ - php composer.phar install --install-suggests
- cp phpunit.xml.dist phpunit.xml
- - ~/.nvm/v0.6.1/bin/node tests/Guzzle/Tests/Http/server.js &
+ - ~/.nvm/nvm.sh run default tests/Guzzle/Tests/Http/server.js &
script: sudo phpunit
-notifications:
- email:
- - michael@guzzlephp.org
View
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Michael Dowling <michael@guzzlephp.org>
+Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -1,7 +1,7 @@
Guzzle, PHP HTTP client and webservice framework
-===============================================
+================================================
-Guzzle is a game changer in the world of PHP HTTP clients. Guzzle allows you to truly reap the benefits of the HTTP/1.1 spec. No other library provides persistent connection management or makes it easier to send requests in parallel.</p>
+Guzzle is a game changer in the world of PHP HTTP clients. Guzzle allows you to truly reap the benefits of the HTTP/1.1 spec. No other library makes it easier to manage persistent connections or send requests in parallel.</p>
In addition to taking the pain out of HTTP, Guzzle provides a lightweight framework for creating web service clients. Most web service clients follow a specific pattern: create a client class, create methods for each action, create and execute a cURL handle, parse the response, implement error handling, and return the result. Guzzle takes the redundancy out of this process and gives you the tools you need to quickly build a web service client.
@@ -37,7 +37,7 @@ HTTP basics
```php
<?php
-use Guzzle\Service\Client;
+use Guzzle\Http\Client;
$client = new Client('http://www.example.com/api/v1/key/{{key}}', array(
'key' => '***'
@@ -102,18 +102,30 @@ Send requests in parallel
```php
<?php
-use Guzzle\Service\Client;
-
try {
- $responses = $client->batch(array(
- $client->get('http://www.google.com/'),
- $client->head('http://www.google.com/'),
- $client->get('https://www.github.com/')
+ $client = new Guzzle\Http\Client('http://www.myapi.com/api/v1');
+ $responses = $client->send(array(
+ $client->get('users'),
+ $client->head('messages/123'),
+ $client->delete('orders/123')
));
-} catch (PoolRequestException $e) {
+} catch (Guzzle\Common\ExceptionCollection $e) {
echo "The following requests encountered an exception: \n";
foreach ($e as $exception) {
echo $exception->getRequest() . "\n" . $exception->getMessage() . "\n";
}
}
-```
+```
+
+Testing Guzzle
+--------------
+
+Here's how to install Guzzle from source to run the unit tests:
+
+```
+git clone git@github.com:guzzle/guzzle.git
+cd guzzle
+composer.phar install --install-suggests
+cp phpunit.xml.dist phpunit.xml
+phpunit
+```
View
@@ -0,0 +1,24 @@
+<?php
+
+$namespaces = array(
+ 'Guzzle' => 'phar://' . __FILE__ . '/src',
+ 'Symfony\\Component\\Validator' => 'phar://' . __FILE__ . '/vendor/symfony/validator',
+ 'Symfony\\Component\\EventDispatcher' => 'phar://' . __FILE__ . '/vendor/symfony/event-dispatcher',
+ 'Doctrine' => 'phar://' . __FILE__ . '/vendor/doctrine/common/lib',
+ 'Monolog' => 'phar://' . __FILE__ . '/vendor/monolog/monolog/src'
+);
+
+if (DIRECTORY_SEPARATOR == '/') {
+ require_once 'phar://' . __FILE__ . '/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+} else {
+ require_once 'phar://' . __FILE__ . '\\vendor\\symfony\\class-loader\\Symfony\\Component\\ClassLoader\\UniversalClassLoader.php';
+ $namespaces = array_filter($namespaces, function($namespace) {
+ return str_replace('phar:\\\\', 'phar://', str_replace('/', '\\', $namespace));
+ });
+}
+
+$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
+$classLoader->registerNamespaces($namespaces);
+$classLoader->register();
+
+__HALT_COMPILER();
View
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="guzzle" default="phar">
+ <target name="phar" description="Create a phar with an autoloader">
+ <if>
+ <equals arg1="${min}" arg2="true" />
+ <then>
+ <pharpackage
+ destfile="./guzzle-min.phar"
+ basedir="."
+ alias="Guzzle"
+ signature="md5">
+ <fileset dir=".">
+ <include name="src/**/*.php" />
+ </fileset>
+ <metadata>
+ <element name="version" value="2.0.0" />
+ </metadata>
+ </pharpackage>
+ </then>
+ <else>
+ <pharpackage
+ destfile="./guzzle.phar"
+ basedir="."
+ stub="autoload.php"
+ alias="Guzzle"
+ signature="md5">
+ <fileset dir=".">
+ <include name="src/**/*.php" />
+ <include name="vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php" />
+ <include name="vendor/symfony/event-dispatcher/**/*.php" />
+ <include name="vendor/symfony/validator/**/*.php" />
+ <include name="vendor/doctrine/common/lib/Doctrine/Common/Cache/*.php" />
+ <include name="vendor/monolog/monolog/src/**/*.php" />
+ </fileset>
+ <metadata>
+ <element name="version" value="2.0.0" />
+ </metadata>
+ </pharpackage>
+ </else>
+ </if>
+ </target>
+</project>
View
@@ -1,22 +0,0 @@
-<?php
-/**
- * Autoloader stub for guzzle.phar to autoload Guzzle\* classes.
- *
- * Note: this autoloader does not load other PSR-0 libraries. If you need to
- * autoload other libraries, we recommend the Symfony ClassLoader component.
- */
-
-spl_autoload_register(function($class) {
- if (0 === strpos($class, 'Guzzle\\')) {
- if ('\\' != DIRECTORY_SEPARATOR) {
- $class = 'phar://' . __FILE__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
- } else {
- $class = 'phar://' . __FILE__ . DIRECTORY_SEPARATOR . $class . '.php';
- }
- if (file_exists($class)) {
- require $class;
- }
- }
-});
-
-__HALT_COMPILER();
View
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project name="guzzle" default="init">
-
- <target name="init-git" description="Initialize git submodules">
- <echo msg="Initializing git submodules" />
- <exec command="git submodule update --init" dir="./.." />
- </target>
-
- <target name="init-test" description="Initialize for unit testing">
- <echo msg="Copying ./phpunit.xml.dist to ./phpunit.xml" />
- <copy file="../phpunit.xml.dist" tofile="../phpunit.xml" />
- </target>
-
- <target name="init" depends="init-git,init-test" />
-
- <target name="phar" description="Create a phar with an autoloader">
- <if>
- <equals arg1="${autoload}" arg2="false" />
- <then>
- <pharpackage
- destfile="./guzzle-na.phar"
- basedir="../src"
- alias="Guzzle"
- signature="sha1">
- <fileset dir="../src">
- <include name="**/*.php" />
- <exclude name="**/Tests/**" />
- </fileset>
- <metadata>
- <element name="version" value="1.0.1" />
- </metadata>
- </pharpackage>
- </then>
- <else>
- <pharpackage
- destfile="./guzzle.phar"
- basedir="../src"
- stub="./autoload.php"
- alias="Guzzle"
- signature="sha1">
- <fileset dir="../src">
- <include name="**/*.php" />
- <exclude name="**/Tests/**" />
- </fileset>
- <metadata>
- <element name="version" value="1.0.1" />
- </metadata>
- </pharpackage>
- </else>
- </if>
- </target>
-</project>
View
@@ -2,21 +2,66 @@
"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"],
+ "keywords": ["framework", "http", "rest", "web service"],
"homepage": "http://www.guzzlephp.org/",
"license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "michael@guzzlephp.org"
+ "authors": [{
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Guzzle Community",
+ "homepage": "https://github.com/guzzle/guzzle/contributors"
+ }],
+ "repositories": {
+ "zend-log": {
+ "package": {
+ "name": "zend/zend-log",
+ "version": "2.0.0",
+ "autoload": { "psr-0": { "Zend\\Log": "" } },
+ "target-dir": "Zend/Log",
+ "dist": {
+ "url": "https://github.com/KnpLabs/zend-log/zipball/master",
+ "type": "zip"
+ },
+ "source": {
+ "url": "https://github.com/KnpLabs/zend-log.git",
+ "type": "git",
+ "reference": "master"
+ }
+ }
},
- {
- "name": "Guzzle Community",
- "homepage": "https://github.com/guzzle/guzzle/contributors"
+ "zend-cache": {
+ "package": {
+ "name": "zend/zend-cache",
+ "version": "2.0.0",
+ "autoload": { "psr-0": { "Zend\\Cache": "" } },
+ "target-dir": "Zend/Cache",
+ "dist": {
+ "url": "https://github.com/KnpLabs/zend-cache/zipball/master",
+ "type": "zip"
+ },
+ "source": {
+ "url": "https://github.com/KnpLabs/zend-cache.git",
+ "type": "git",
+ "reference": "master"
+ }
+ }
}
- ],
+ },
"require": {
- "php": ">=5.3.2"
+ "php": ">=5.3.2",
+ "ext-curl": "*",
+ "symfony/event-dispatcher": "*",
+ "symfony/validator": "*"
+ },
+ "suggest": {
+ "symfony/class-loader": "*",
+ "doctrine/common": "*",
+ "monolog/monolog": "*",
+ "zend/zend-cache": "*",
+ "zend/zend-log": "*"
},
"autoload": {
"psr-0": { "Guzzle": "src/" }
View
@@ -20,8 +20,6 @@
<directory suffix=".php">./src/Guzzle</directory>
<exclude>
<directory suffix="Interface.php">./src/Guzzle</directory>
- <file>./src/Guzzle/Common/Event/Subject.php</file>
- <file>./src/Guzzle/Common/GuzzleException.php</file>
<file>./src/Guzzle/Http/HttpException.php</file>
</exclude>
</whitelist>
Oops, something went wrong.

0 comments on commit 4c46e77

Please sign in to comment.