Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Working on breaking the project into components each with its own com…

…poser.json file
  • Loading branch information...
commit 4c12cc079f88eed135f875f74686d046ae939ec2 1 parent 95e1a46
@mtdowling mtdowling authored
Showing with 1,003 additions and 634 deletions.
  1. +20 −1 composer.json
  2. +1 −1  src/Guzzle/{Common → }/Batch/AbstractBatchDecorator.php
  3. +2 −2 src/Guzzle/{Common → }/Batch/Batch.php
  4. +3 −3 src/Guzzle/{Common → }/Batch/BatchBuilder.php
  5. +3 −1 src/Guzzle/{Common → }/Batch/BatchClosureDivisor.php
  6. +2 −2 src/Guzzle/{Common → }/Batch/BatchClosureTransfer.php
  7. +5 −4 src/Guzzle/{Service/Command → Batch}/BatchCommandTransfer.php
  8. +1 −1  src/Guzzle/{Common → }/Batch/BatchDivisorInterface.php
  9. +1 −1  src/Guzzle/{Common → }/Batch/BatchInterface.php
  10. +4 −4 src/Guzzle/{Http → Batch}/BatchRequestTransfer.php
  11. +1 −1  src/Guzzle/{Common → }/Batch/BatchSizeDivisor.php
  12. +1 −1  src/Guzzle/{Common → }/Batch/BatchTransferInterface.php
  13. +4 −4 src/Guzzle/{Common → Batch}/Exception/BatchTransferException.php
  14. +2 −2 src/Guzzle/{Common → }/Batch/ExceptionBufferingBatch.php
  15. +1 −1  src/Guzzle/{Common → }/Batch/FlushingBatch.php
  16. +1 −1  src/Guzzle/{Common → }/Batch/HistoryBatch.php
  17. +1 −1  src/Guzzle/{Common → }/Batch/NotifyingBatch.php
  18. +27 −0 src/Guzzle/Batch/composer.json
  19. +1 −1  src/Guzzle/{Common → }/Cache/AbstractCacheAdapter.php
  20. +4 −2 src/Guzzle/{Common → }/Cache/CacheAdapterFactory.php
  21. +5 −6 src/Guzzle/{Common → }/Cache/CacheAdapterInterface.php
  22. +4 −5 src/Guzzle/{Common → }/Cache/ClosureCacheAdapter.php
  23. +1 −1  src/Guzzle/{Common → }/Cache/DoctrineCacheAdapter.php
  24. +1 −1  src/Guzzle/{Common → }/Cache/NullCacheAdapter.php
  25. +1 −1  src/Guzzle/{Common → }/Cache/Zf1CacheAdapter.php
  26. +6 −7 src/Guzzle/{Common → }/Cache/Zf2CacheAdapter.php
  27. +23 −0 src/Guzzle/Cache/composer.json
  28. +29 −0 src/Guzzle/Common/Collection.php
  29. +0 −2  src/Guzzle/Common/Exception/BadMethodCallException.php
  30. +0 −2  src/Guzzle/Common/Exception/ExceptionCollection.php
  31. +1 −1  src/Guzzle/Common/{ → Exception}/GuzzleException.php
  32. +0 −2  src/Guzzle/Common/Exception/InvalidArgumentException.php
  33. +0 −2  src/Guzzle/Common/Exception/RuntimeException.php
  34. +0 −2  src/Guzzle/Common/Exception/UnexpectedValueException.php
  35. +1 −2  src/Guzzle/Common/composer.json
  36. +1 −1  src/Guzzle/Http/EntityBody.php
  37. +1 −1  src/Guzzle/Http/EntityBodyInterface.php
  38. +2 −2 src/Guzzle/Http/{ → Exception}/HttpException.php
  39. +0 −1  src/Guzzle/Http/Exception/RequestException.php
  40. +11 −2 src/Guzzle/Http/composer.json
  41. +1 −1  src/Guzzle/{Common → }/Inflection/Inflector.php
  42. +1 −1  src/Guzzle/{Common → }/Inflection/InflectorInterface.php
  43. +1 −1  src/Guzzle/{Common → }/Inflection/MemoizingInflector.php
  44. +1 −1  src/Guzzle/{Common → }/Inflection/PreComputedInflector.php
  45. +22 −0 src/Guzzle/Inflection/composer.json
  46. +4 −2 src/Guzzle/Iterator/FilterIterator.php
  47. +4 −2 src/Guzzle/Iterator/MapIterator.php
  48. +5 −5 src/Guzzle/Iterator/composer.json
  49. +1 −1  src/Guzzle/{Common → }/Log/AbstractLogAdapter.php
  50. +1 −3 src/Guzzle/{Common → }/Log/ArrayLogAdapter.php
  51. +2 −4 src/Guzzle/{Common → }/Log/ClosureLogAdapter.php
  52. +1 −1  src/Guzzle/{Common → }/Log/LogAdapterInterface.php
  53. +1 −1  src/Guzzle/{Common → }/Log/MonologLogAdapter.php
  54. +1 −1  src/Guzzle/{Common → }/Log/Zf1LogAdapter.php
  55. +1 −1  src/Guzzle/{Common → }/Log/Zf2LogAdapter.php
  56. +22 −0 src/Guzzle/Log/composer.json
  57. +1 −1  src/Guzzle/{Http/Plugin → Plugin/Async}/AsyncPlugin.php
  58. +23 −0 src/Guzzle/Plugin/Async/composer.json
  59. +3 −3 src/Guzzle/{Http/Plugin/ExponentialBackoffLogger.php → Plugin/Backoff/BackoffLogger.php}
  60. +1 −1  src/Guzzle/{Http/Plugin → Plugin/Backoff}/ExponentialBackoffPlugin.php
  61. +24 −0 src/Guzzle/Plugin/Backoff/composer.json
  62. +2 −2 src/Guzzle/{Http/Plugin → Plugin/Cache}/CachePlugin.php
  63. +24 −0 src/Guzzle/Plugin/Cache/composer.json
  64. +1 −1  src/Guzzle/{Http/Plugin → Plugin/Cookie}/CookiePlugin.php
  65. +23 −0 src/Guzzle/Plugin/Cookie/composer.json
  66. +1 −1  src/Guzzle/{Http/Plugin → Plugin/CurlAuth}/CurlAuthPlugin.php
  67. +23 −0 src/Guzzle/Plugin/CurlAuth/composer.json
  68. +1 −1  src/Guzzle/{Http/Plugin → Plugin/History}/HistoryPlugin.php
  69. +23 −0 src/Guzzle/Plugin/History/composer.json
  70. +2 −2 src/Guzzle/{Http/Plugin → Plugin/Log}/LogPlugin.php
  71. +24 −0 src/Guzzle/Plugin/Log/composer.json
  72. +1 −1  src/Guzzle/{Http/Plugin → Plugin/Md5Validator}/Md5ValidatorPlugin.php
  73. +23 −0 src/Guzzle/Plugin/Md5Validator/composer.json
  74. +1 −1  src/Guzzle/{Http/Plugin → Plugin/Mock}/MockPlugin.php
  75. +23 −0 src/Guzzle/Plugin/Mock/composer.json
  76. +2 −3 src/Guzzle/{Http/Plugin → Plugin/Oauth}/OauthPlugin.php
  77. +23 −0 src/Guzzle/Plugin/Oauth/composer.json
  78. +39 −0 src/Guzzle/Plugin/composer.json
  79. +2 −2 src/Guzzle/Service/Client.php
  80. +1 −1  src/Guzzle/Service/ClientInterface.php
  81. +2 −2 src/Guzzle/Service/Command/Factory/ConcreteClassFactory.php
  82. +1 −1  src/Guzzle/Service/Command/Factory/ServiceDescriptionFactory.php
  83. +1 −1  src/Guzzle/Service/Description/ApiCommand.php
  84. +3 −1 src/Guzzle/Service/Exception/InconsistentClientTransferException.php
  85. +5 −25 src/Guzzle/Service/Inspector.php
  86. +3 −3 src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.php
  87. +2 −2 src/Guzzle/Service/Resource/ResourceIteratorClassFactory.php
  88. +26 −0 src/Guzzle/Service/composer.json
  89. +1 −1  src/Guzzle/{Common → Stream}/Stream.php
  90. +1 −1  src/Guzzle/{Common → Stream}/StreamInterface.php
  91. +23 −0 src/Guzzle/Stream/composer.json
  92. +1 −1  src/Guzzle/{Common → }/Validation/AbstractConstraint.php
  93. +1 −1  src/Guzzle/{Common → }/Validation/AbstractType.php
  94. +1 −1  src/Guzzle/{Common → }/Validation/AnyMatch.php
  95. +1 −1  src/Guzzle/{Common → }/Validation/Blank.php
  96. +1 −1  src/Guzzle/{Common → }/Validation/Bool.php
  97. +1 −1  src/Guzzle/{Common → }/Validation/Choice.php
  98. +1 −1  src/Guzzle/{Common → }/Validation/ConstraintInterface.php
  99. +1 −1  src/Guzzle/{Common → }/Validation/Ctype.php
  100. +1 −1  src/Guzzle/{Common → }/Validation/Email.php
  101. +1 −1  src/Guzzle/{Common → }/Validation/Ip.php
  102. +1 −1  src/Guzzle/{Common → }/Validation/IsInstanceOf.php
  103. +1 −1  src/Guzzle/{Common → }/Validation/NotBlank.php
  104. +1 −1  src/Guzzle/{Common → }/Validation/Numeric.php
  105. +1 −1  src/Guzzle/{Common → }/Validation/Regex.php
  106. +1 −1  src/Guzzle/{Common → }/Validation/String.php
  107. +1 −1  src/Guzzle/{Common → }/Validation/Type.php
  108. +1 −1  src/Guzzle/{Common → }/Validation/Url.php
  109. +26 −0 src/Guzzle/Validation/composer.json
  110. +7 −7 tests/Guzzle/Tests/{Common → }/Batch/AbstractBatchDecoratorTest.php
  111. +12 −12 tests/Guzzle/Tests/{Common → }/Batch/BatchBuilderTest.php
  112. +3 −3 tests/Guzzle/Tests/{Common → }/Batch/BatchClosureDivisorTest.php
  113. +4 −4 tests/Guzzle/Tests/{Common → }/Batch/BatchClosureTransferTest.php
  114. +3 −3 tests/Guzzle/Tests/{Service/Command → Batch}/BatchCommandTransferTest.php
  115. +2 −2 tests/Guzzle/Tests/{Http → Batch}/BatchRequestTransferTest.php
  116. +3 −3 tests/Guzzle/Tests/{Common → }/Batch/BatchSizeDivisorTest.php
  117. +6 −6 tests/Guzzle/Tests/{Common → }/Batch/BatchTest.php
  118. +6 −6 tests/Guzzle/Tests/{Common → }/Batch/ExceptionBufferingBatchTest.php
  119. +6 −6 tests/Guzzle/Tests/{Common → }/Batch/FlushingBatchTest.php
  120. +6 −6 tests/Guzzle/Tests/{Common → }/Batch/HistoryBatchTest.php
  121. +9 −9 tests/Guzzle/Tests/{Common → }/Batch/NotifyingBatchTest.php
  122. +18 −18 tests/Guzzle/Tests/{Common → }/Cache/CacheAdapterFactoryTest.php
  123. +8 −8 tests/Guzzle/Tests/{Common → }/Cache/CacheAdapterTest.php
  124. +9 −9 tests/Guzzle/Tests/{Common → }/Cache/ClosureCacheAdapterTest.php
  125. +2 −2 tests/Guzzle/Tests/{Common → }/Cache/NullCacheAdapterTest.php
  126. +3 −3 tests/Guzzle/Tests/{Common → }/Cache/Zf1CacheAdapterTest.php
  127. +7 −7 tests/Guzzle/Tests/{Common → }/Cache/Zf2CacheAdapterTest.php
  128. +28 −0 tests/Guzzle/Tests/Common/CollectionTest.php
  129. +3 −3 tests/Guzzle/Tests/Common/Exception/BatchTransferExceptionTest.php
  130. +1 −1  tests/Guzzle/Tests/GuzzleTestCase.php
  131. +3 −3 tests/Guzzle/Tests/Http/ClientTest.php
  132. +2 −2 tests/Guzzle/Tests/Http/Curl/CurlMultiTest.php
  133. +1 −1  tests/Guzzle/Tests/Http/Message/RequestTest.php
  134. +3 −3 tests/Guzzle/Tests/{Common → }/Inflection/InflectorTest.php
  135. +5 −5 tests/Guzzle/Tests/{Common → }/Inflection/MemoizingInflectorTest.php
  136. +6 −6 tests/Guzzle/Tests/{Common → }/Inflection/PreComputedInflectorTest.php
  137. +2 −4 tests/Guzzle/Tests/{Common → }/Log/ArrayLogAdapterTest.php
  138. +5 −6 tests/Guzzle/Tests/{Common → }/Log/ClosureLogAdapterTest.php
  139. +3 −8 tests/Guzzle/Tests/{Common → }/Log/MonologLogAdapterTest.php
  140. 0  tests/Guzzle/Tests/{Common → }/Log/Zend_Log.php
  141. +5 −11 tests/Guzzle/Tests/{Common → }/Log/Zf1LogAdapterTest.php
  142. +3 −9 tests/Guzzle/Tests/{Common → }/Log/Zf2LogAdapterTest.php
  143. +5 −17 tests/Guzzle/Tests/{Http/Plugin → Plugin/Async}/AsyncPluginTest.php
  144. +7 −7 tests/Guzzle/Tests/{Http/Plugin/ExponentialBackoffLoggerTest.php → Plugin/Backoff/BackoffLoggerTest.php}
  145. +26 −26 tests/Guzzle/Tests/{Http/Plugin → Plugin/Backoff}/ExponentialBackoffTest.php
  146. +26 −26 tests/Guzzle/Tests/{Http/Plugin → Plugin/Cache}/CachePluginTest.php
  147. +3 −3 tests/Guzzle/Tests/{Http/Plugin → Plugin/Cookie}/CookiePluginTest.php
  148. +3 −3 tests/Guzzle/Tests/{Http/Plugin → Plugin/CurlAuth}/CurlAuthPluginTest.php
  149. +5 −28 tests/Guzzle/Tests/{Http/Plugin → Plugin/History}/HistoryPluginTest.php
  150. +5 −9 tests/Guzzle/Tests/{Http/Plugin → Plugin/Log}/LogPluginTest.php
  151. +3 −3 tests/Guzzle/Tests/{Http/Plugin → Plugin/Md5Validator}/Md5ValidatorPluginTest.php
  152. +5 −47 tests/Guzzle/Tests/{Http/Plugin → Plugin/Mock}/MockPluginTest.php
  153. +4 −4 tests/Guzzle/Tests/{Http/Plugin → Plugin/Oauth}/OauthPluginTest.php
  154. +1 −1  tests/Guzzle/Tests/Service/AbstractFactoryTest.php
  155. +5 −5 tests/Guzzle/Tests/Service/Builder/ServiceBuilderTest.php
  156. +3 −3 tests/Guzzle/Tests/Service/ClientTest.php
  157. +1 −1  tests/Guzzle/Tests/Service/Command/CommandTest.php
  158. +1 −1  tests/Guzzle/Tests/Service/Command/Factory/ServiceDescriptionFactoryTest.php
  159. +1 −1  tests/Guzzle/Tests/Service/Description/ArrayDescriptionBuilderTest.php
  160. +1 −28 tests/Guzzle/Tests/Service/InspectorTest.php
  161. +20 −20 tests/Guzzle/Tests/{Common → Stream}/StreamTest.php
  162. +4 −4 tests/Guzzle/Tests/{Common → }/Validation/AnyMatchTest.php
  163. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/BlankTest.php
  164. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/BoolTest.php
  165. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/ChoiceTest.php
  166. +5 −5 tests/Guzzle/Tests/{Common → }/Validation/CtypeTest.php
  167. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/EmailTest.php
  168. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/IpTest.php
  169. +5 −5 tests/Guzzle/Tests/{Common → }/Validation/IsInstanceOfTest.php
  170. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/NotBlankTest.php
  171. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/NumericTest.php
  172. +4 −4 tests/Guzzle/Tests/{Common → }/Validation/RegexTest.php
  173. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/StringTest.php
  174. +5 −5 tests/Guzzle/Tests/{Common → }/Validation/TypeTest.php
  175. +3 −3 tests/Guzzle/Tests/{Common → }/Validation/UrlTest.php
  176. +1 −1  tests/Guzzle/Tests/{Common → }/Validation/Validation.php
View
21 composer.json
@@ -19,9 +19,28 @@
],
"replace": {
+ "guzzle/batch": "self.version",
+ "guzzle/cache": "self.version",
"guzzle/common": "self.version",
"guzzle/http": "self.version",
- "guzzle/parser": "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-history": "self.version",
+ "guzzle/plugin-log": "self.version",
+ "guzzle/plugin-md5validator": "self.version",
+ "guzzle/plugin-mock": "self.version",
+ "guzzle/plugin-oauth": "self.version",
+ "guzzle/service": "self.version",
+ "guzzle/stream": "self.version",
+ "guzzle/validation": "self.version"
},
"require": {
View
2  src/Guzzle/Common/Batch/AbstractBatchDecorator.php → src/Guzzle/Batch/AbstractBatchDecorator.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* Abstract decorator used when decorating a BatchInterface
View
4 src/Guzzle/Common/Batch/Batch.php → src/Guzzle/Batch/Batch.php
@@ -1,8 +1,8 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
-use Guzzle\Common\Exception\BatchTransferException;
+use Guzzle\Batch\Exception\BatchTransferException;
/**
* Default batch implementation used to convert queued items into smaller
View
6 src/Guzzle/Common/Batch/BatchBuilder.php → src/Guzzle/Batch/BatchBuilder.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
use Guzzle\Common\Exception\InvalidArgumentException;
use Guzzle\Common\Exception\RuntimeException;
@@ -44,8 +44,8 @@ class BatchBuilder
* @var array of Mapped transfer strategies by handle name
*/
protected static $mapping = array(
- 'request' => 'Guzzle\Http\BatchRequestTransfer',
- 'command' => 'Guzzle\Service\Command\BatchCommandTransfer'
+ 'request' => 'Guzzle\Batch\BatchRequestTransfer',
+ 'command' => 'Guzzle\Batch\BatchCommandTransfer'
);
/**
View
4 src/Guzzle/Common/Batch/BatchClosureDivisor.php → src/Guzzle/Batch/BatchClosureDivisor.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
use Guzzle\Common\Exception\InvalidArgumentException;
@@ -24,6 +24,8 @@ class BatchClosureDivisor implements BatchDivisorInterface
* must accept an \SplQueue and return an array of
* arrays containing the divided items
* @param mixed $context Optional context to pass to the batch divisor
+ *
+ * @throws InvalidArgumentException if the callable is not callable
*/
public function __construct($callable, $context = null)
{
View
4 src/Guzzle/Common/Batch/BatchClosureTransfer.php → src/Guzzle/Batch/BatchClosureTransfer.php
@@ -1,12 +1,12 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
use Guzzle\Common\Exception\InvalidArgumentException;
/**
* Batch transfer strategy where transfer logic can be defined via a Closure.
- * This class is to be used with {@see Guzzle\Common\Batch\BatchInterface}
+ * This class is to be used with {@see Guzzle\Batch\BatchInterface}
*/
class BatchClosureTransfer implements BatchTransferInterface
{
View
9 src/Guzzle/Service/Command/BatchCommandTransfer.php → src/Guzzle/Batch/BatchCommandTransfer.php
@@ -1,15 +1,16 @@
<?php
-namespace Guzzle\Service\Command;
+namespace Guzzle\Batch;
-use Guzzle\Common\Batch\BatchTransferInterface;
-use Guzzle\Common\Batch\BatchDivisorInterface;
+use Guzzle\Batch\BatchTransferInterface;
+use Guzzle\Batch\BatchDivisorInterface;
use Guzzle\Common\Exception\InvalidArgumentException;
+use Guzzle\Service\Command\CommandInterface;
use Guzzle\Service\Exception\InconsistentClientTransferException;
/**
* Efficiently transfers multiple commands in parallel per client
- * This class is to be used with {@see Guzzle\Common\Batch\BatchInterface}
+ * This class is to be used with {@see Guzzle\Batch\BatchInterface}
*/
class BatchCommandTransfer implements BatchTransferInterface, BatchDivisorInterface
{
View
2  src/Guzzle/Common/Batch/BatchDivisorInterface.php → src/Guzzle/Batch/BatchDivisorInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* Interface used for dividing a queue of items into an array of batches
View
2  src/Guzzle/Common/Batch/BatchInterface.php → src/Guzzle/Batch/BatchInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* Interface for efficiently transferring items in a queue using batches
View
8 src/Guzzle/Http/BatchRequestTransfer.php → src/Guzzle/Batch/BatchRequestTransfer.php
@@ -1,15 +1,15 @@
<?php
-namespace Guzzle\Http;
+namespace Guzzle\Batch;
-use Guzzle\Common\Batch\BatchTransferInterface;
-use Guzzle\Common\Batch\BatchDivisorInterface;
+use Guzzle\Batch\BatchTransferInterface;
+use Guzzle\Batch\BatchDivisorInterface;
use Guzzle\Common\Exception\InvalidArgumentException;
use Guzzle\Http\Message\RequestInterface;
/**
* Batch transfer strategy used to efficiently transfer a batch of requests.
- * This class is to be used with {@see Guzzle\Common\Batch\BatchInterface}
+ * This class is to be used with {@see Guzzle\Batch\BatchInterface}
*/
class BatchRequestTransfer implements BatchTransferInterface, BatchDivisorInterface
{
View
2  src/Guzzle/Common/Batch/BatchSizeDivisor.php → src/Guzzle/Batch/BatchSizeDivisor.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* Divides batches into smaller batches under a certain size
View
2  src/Guzzle/Common/Batch/BatchTransferInterface.php → src/Guzzle/Batch/BatchTransferInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* Interface used for transferring batches of items
View
8 ...uzzle/Common/Exception/BatchTransferException.php → ...Guzzle/Batch/Exception/BatchTransferException.php
@@ -1,10 +1,10 @@
<?php
-namespace Guzzle\Common\Exception;
+namespace Guzzle\Batch\Exception;
-use Guzzle\Common\GuzzleException;
-use Guzzle\Common\Batch\BatchTransferInterface as TransferStrategy;
-use Guzzle\Common\Batch\BatchDivisorInterface as DivisorStrategy;
+use Guzzle\Common\Exception\GuzzleException;
+use Guzzle\Batch\BatchTransferInterface as TransferStrategy;
+use Guzzle\Batch\BatchDivisorInterface as DivisorStrategy;
/**
* Exception thrown during a batch transfer
View
4 src/Guzzle/Common/Batch/ExceptionBufferingBatch.php → src/Guzzle/Batch/ExceptionBufferingBatch.php
@@ -1,8 +1,8 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
-use Guzzle\Common\Exception\BatchTransferException;
+use Guzzle\Batch\Exception\BatchTransferException;
/**
* BatchInterface decorator used to buffer exceptions encountered during a
View
2  src/Guzzle/Common/Batch/FlushingBatch.php → src/Guzzle/Batch/FlushingBatch.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* BatchInterface decorator used to add automatic flushing of the queue when the
View
2  src/Guzzle/Common/Batch/HistoryBatch.php → src/Guzzle/Batch/HistoryBatch.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
/**
* BatchInterface decorator used to keep a history of items that were added to
View
2  src/Guzzle/Common/Batch/NotifyingBatch.php → src/Guzzle/Batch/NotifyingBatch.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Batch;
+namespace Guzzle\Batch;
use Guzzle\Common\Exception\InvalidArgumentException;
View
27 src/Guzzle/Batch/composer.json
@@ -0,0 +1,27 @@
+{
+ "name": "guzzle/batch",
+ "type": "component",
+ "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"
+}
View
2  src/Guzzle/Common/Cache/AbstractCacheAdapter.php → src/Guzzle/Cache/AbstractCacheAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
/**
* Abstract cache adapter
View
6 src/Guzzle/Common/Cache/CacheAdapterFactory.php → src/Guzzle/Cache/CacheAdapterFactory.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
use Guzzle\Common\FromConfigInterface;
use Guzzle\Common\Exception\InvalidArgumentException;
@@ -19,6 +19,7 @@ class CacheAdapterFactory implements FromConfigInterface
* @param array $config Array of configuration options
*
* @return CacheAdapterInterface
+ * @throws InvalidArgumentException
*/
public static function factory($config = array())
{
@@ -27,7 +28,7 @@ public static function factory($config = array())
}
if (!isset($config['cache.adapter']) && !isset($config['cache.provider'])) {
- $config['cache.adapter'] = 'Guzzle\\Common\\Cache\\NullCacheAdapter';
+ $config['cache.adapter'] = 'Guzzle\Cache\NullCacheAdapter';
$config['cache.provider'] = null;
} else {
// Validate that the options are valid
@@ -67,6 +68,7 @@ public static function factory($config = array())
* @param array $args Arguments for the class constructor
*
* @return mixed
+ * @throws RuntimeException
*/
protected static function createObject($className, array $args = null)
{
View
11 src/Guzzle/Common/Cache/CacheAdapterInterface.php → src/Guzzle/Cache/CacheAdapterInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
/**
* Interface for cache adapters.
@@ -44,11 +44,10 @@ public function fetch($id, array $options = null);
/**
* Puts data into the cache.
*
- * @param string $id The cache id.
- * @param string $data The cache entry/data.
- * @param int $lifeTime The lifetime. If != false, sets a specific lifetime for this cache entry. Set to null to
- * give an infinite lifetime.
- * @param array $options Array of cache adapter options
+ * @param string $id The cache id
+ * @param string $data The cache entry/data
+ * @param int|bool $lifeTime The lifetime. If != false, sets a specific lifetime for this cache entry
+ * @param array $options Array of cache adapter options
*
* @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
*/
View
9 src/Guzzle/Common/Cache/ClosureCacheAdapter.php → src/Guzzle/Cache/ClosureCacheAdapter.php
@@ -1,8 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
-
-use Guzzle\Common\Exception\InvalidArgumentException;
+namespace Guzzle\Cache;
/**
* Cache adapter that defers to closures for implementation
@@ -25,14 +23,15 @@ class ClosureCacheAdapter implements CacheAdapterInterface
* - fetch: Callable that accepts an $id and $options argument
* - save: Callable that accepts an $id, $data, $lifeTime, and
* $options argument
+ *
+ * @throws \InvalidArgumentException if the callable is not callable
*/
public function __construct(array $callables)
{
// Validate each key to ensure it exists and is callable
foreach (array('contains', 'delete', 'fetch', 'save') as $key) {
if (!array_key_exists($key, $callables) || !is_callable($callables[$key])) {
- throw new InvalidArgumentException(
- "callables must contain a callable $key key");
+ throw new \InvalidArgumentException("callables must contain a callable {$key} key");
}
}
View
2  src/Guzzle/Common/Cache/DoctrineCacheAdapter.php → src/Guzzle/Cache/DoctrineCacheAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
use Doctrine\Common\Cache\Cache;
View
2  src/Guzzle/Common/Cache/NullCacheAdapter.php → src/Guzzle/Cache/NullCacheAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
use Doctrine\Common\Cache\Cache;
View
2  src/Guzzle/Common/Cache/Zf1CacheAdapter.php → src/Guzzle/Cache/Zf1CacheAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
/**
* Zend Framework 1 cache adapter
View
13 src/Guzzle/Common/Cache/Zf2CacheAdapter.php → src/Guzzle/Cache/Zf2CacheAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Cache;
+namespace Guzzle\Cache;
use Zend\Cache\Storage\Adapter\AdapterInterface;
@@ -17,12 +17,11 @@ class Zf2CacheAdapter extends AbstractCacheAdapter
protected $defaultOptions = array();
/**
- * @param AdapterInterface $cache Zend Framework 2 cache adapter
- * @param array $options Hash of default options for each cache method.
- * Can contain for 'contains', 'delete', 'fetch',
- * and 'save'. Each key must map to an
- * associative array of options to merge into the
- * options argument passed into each respective call.
+ * @param AdapterInterface $cache Zend Framework 2 cache adapter
+ * @param array $defaultOptions Hash of default options for each cache method. Can contain for
+ * 'contains', 'delete', 'fetch', and 'save'. Each key must map to an
+ * associative array of options to merge into the options argument passed
+ * into each respective call.
*/
public function __construct(AdapterInterface $cache, array $defaultOptions = array())
{
View
23 src/Guzzle/Cache/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/cache",
+ "type": "component",
+ "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"
+}
View
29 src/Guzzle/Common/Collection.php
@@ -2,6 +2,8 @@
namespace Guzzle\Common;
+use Guzzle\Common\Exception\InvalidArgumentException;
+
/**
* Key value pair collection object
*/
@@ -27,6 +29,33 @@ public function __construct(array $data = null)
}
/**
+ * 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.
View
2  src/Guzzle/Common/Exception/BadMethodCallException.php
@@ -2,6 +2,4 @@
namespace Guzzle\Common\Exception;
-use Guzzle\Common\GuzzleException;
-
class BadMethodCallException extends \BadMethodCallException implements GuzzleException {}
View
2  src/Guzzle/Common/Exception/ExceptionCollection.php
@@ -2,8 +2,6 @@
namespace Guzzle\Common\Exception;
-use Guzzle\Common\GuzzleException;
-
/**
* Collection of exceptions
*/
View
2  src/Guzzle/Common/GuzzleException.php → src/Guzzle/Common/Exception/GuzzleException.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common;
+namespace Guzzle\Common\Exception;
/**
* Guzzle exception
View
2  src/Guzzle/Common/Exception/InvalidArgumentException.php
@@ -2,6 +2,4 @@
namespace Guzzle\Common\Exception;
-use Guzzle\Common\GuzzleException;
-
class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException {}
View
2  src/Guzzle/Common/Exception/RuntimeException.php
@@ -2,6 +2,4 @@
namespace Guzzle\Common\Exception;
-use Guzzle\Common\GuzzleException;
-
class RuntimeException extends \RuntimeException implements GuzzleException {}
View
2  src/Guzzle/Common/Exception/UnexpectedValueException.php
@@ -2,6 +2,4 @@
namespace Guzzle\Common\Exception;
-use Guzzle\Common\GuzzleException;
-
class UnexpectedValueException extends \UnexpectedValueException implements GuzzleException {}
View
3  src/Guzzle/Common/composer.json
@@ -2,13 +2,12 @@
"name": "guzzle/common",
"homepage": "http://guzzlephp.org/",
"description": "Common libraries used by Guzzle",
- "keywords": ["common", "cache", "log", "event", "socket", "batch", "inflection", "validation"],
+ "keywords": ["common", "event", "exception", "collection"],
"license": "MIT",
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": "2.1.*"
},
- "minimum-stability": "beta",
"autoload": {
"psr-0": { "Guzzle\\Common": "" }
},
View
2  src/Guzzle/Http/EntityBody.php
@@ -2,7 +2,7 @@
namespace Guzzle\Http;
-use Guzzle\Common\Stream;
+use Guzzle\Stream\Stream;
use Guzzle\Common\Exception\InvalidArgumentException;
/**
View
2  src/Guzzle/Http/EntityBodyInterface.php
@@ -2,7 +2,7 @@
namespace Guzzle\Http;
-use Guzzle\Common\StreamInterface;
+use Guzzle\Stream\StreamInterface;
/**
* Entity body used with an HTTP request or response
View
4 src/Guzzle/Http/HttpException.php → src/Guzzle/Http/Exception/HttpException.php
@@ -1,8 +1,8 @@
<?php
-namespace Guzzle\Http;
+namespace Guzzle\Http\Exception;
-use Guzzle\Common\GuzzleException;
+use Guzzle\Common\Exception\GuzzleException;
/**
* Http exception interface
View
1  src/Guzzle/Http/Exception/RequestException.php
@@ -4,7 +4,6 @@
use Guzzle\Common\Exception\RuntimeException;
use Guzzle\Http\Message\RequestInterface;
-use Guzzle\Http\HttpException;
/**
* Http request exception
View
13 src/Guzzle/Http/composer.json
@@ -1,13 +1,22 @@
{
"name": "guzzle/http",
- "homepage": "http://guzzlephp.org/",
+ "type": "component",
"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/parser": "self.version",
+ "guzzle/stream": "self.version"
},
"autoload": {
"psr-0": { "Guzzle\\Http": "" }
View
2  src/Guzzle/Common/Inflection/Inflector.php → src/Guzzle/Inflection/Inflector.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Inflection;
+namespace Guzzle\Inflection;
/**
* Default inflection implementation
View
2  src/Guzzle/Common/Inflection/InflectorInterface.php → src/Guzzle/Inflection/InflectorInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Inflection;
+namespace Guzzle\Inflection;
/**
* Inflector interface used to convert the casing of words
View
2  src/Guzzle/Common/Inflection/MemoizingInflector.php → src/Guzzle/Inflection/MemoizingInflector.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Inflection;
+namespace Guzzle\Inflection;
/**
* Decorator used to add memoization to previously inflected words
View
2  ...Guzzle/Common/Inflection/PreComputedInflector.php → src/Guzzle/Inflection/PreComputedInflector.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Inflection;
+namespace Guzzle\Inflection;
/**
* Decorator used to add pre-computed inflection mappings to an inflector
View
22 src/Guzzle/Inflection/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "guzzle/inflection",
+ "type": "component",
+ "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"
+}
View
6 src/Guzzle/Iterator/FilterIterator.php
@@ -2,6 +2,8 @@
namespace Guzzle\Iterator;
+use Guzzle\Common\Exception\InvalidArgumentException;
+
/**
* Filters values using a callback
*
@@ -18,13 +20,13 @@ class FilterIterator extends \FilterIterator
* @param \Traversable $iterator Traversable iterator
* @param array|\Closure $callback Callback used for filtering. Return true to keep or false to filter.
*
- * @throws \InvalidArgumentException if the callback if not callable
+ * @throws InvalidArgumentException if the callback if not callable
*/
public function __construct(\Traversable $iterator, $callback)
{
parent::__construct($iterator);
if (!is_callable($callback)) {
- throw new \InvalidArgumentException('The callback must be callable');
+ throw new InvalidArgumentException('The callback must be callable');
}
$this->callback = $callback;
}
View
6 src/Guzzle/Iterator/MapIterator.php
@@ -2,6 +2,8 @@
namespace Guzzle\Iterator;
+use Guzzle\Common\Exception\InvalidArgumentException;
+
/**
* Maps values before yielding
*/
@@ -16,13 +18,13 @@ class MapIterator extends \IteratorIterator
* @param \Traversable $iterator Traversable iterator
* @param array|\Closure $callback Callback used for iterating
*
- * @throws \InvalidArgumentException if the callback if not callable
+ * @throws InvalidArgumentException if the callback if not callable
*/
public function __construct(\Traversable $iterator, $callback)
{
parent::__construct($iterator);
if (!is_callable($callback)) {
- throw new \InvalidArgumentException('The callback must be callable');
+ throw new InvalidArgumentException('The callback must be callable');
}
$this->callback = $callback;
}
View
10 src/Guzzle/Iterator/composer.json
@@ -13,11 +13,11 @@
}
],
"require": {
- "php": ">=5.3.2"
+ "php": ">=5.3.2",
+ "guzzle/common": ">=2.8.*"
},
"autoload": {
- "psr-0": {
- "Guzzle\\Iterator": "src/"
- }
- }
+ "psr-0": { "Guzzle\\Iterator": "/" }
+ },
+ "target-dir": "Guzzle/Log"
}
View
2  src/Guzzle/Common/Log/AbstractLogAdapter.php → src/Guzzle/Log/AbstractLogAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
+namespace Guzzle\Log;
/**
* Adapter class that allows Guzzle to log data to various logging
View
4 src/Guzzle/Common/Log/ArrayLogAdapter.php → src/Guzzle/Log/ArrayLogAdapter.php
@@ -1,8 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
-
-use Guzzle\Common\Log\LogAdapterInterface;
+namespace Guzzle\Log;
/**
* Adapter class that allows Guzzle to log data to various logging
View
6 src/Guzzle/Common/Log/ClosureLogAdapter.php → src/Guzzle/Log/ClosureLogAdapter.php
@@ -1,8 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
-
-use Guzzle\Common\Exception\InvalidArgumentException;
+namespace Guzzle\Log;
/**
* Allows Closures to be called when messages are logged. Closures combined
@@ -16,7 +14,7 @@ class ClosureLogAdapter extends AbstractLogAdapter
public function __construct($logObject)
{
if (!is_callable($logObject)) {
- throw new InvalidArgumentException('Object must be callable');
+ throw new \InvalidArgumentException('Object must be callable');
}
$this->log = $logObject;
View
2  src/Guzzle/Common/Log/LogAdapterInterface.php → src/Guzzle/Log/LogAdapterInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
+namespace Guzzle\Log;
/**
* Adapter class that allows Guzzle to log data to various logging
View
2  src/Guzzle/Common/Log/MonologLogAdapter.php → src/Guzzle/Log/MonologLogAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
+namespace Guzzle\Log;
use Monolog\Logger;
View
2  src/Guzzle/Common/Log/Zf1LogAdapter.php → src/Guzzle/Log/Zf1LogAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
+namespace Guzzle\Log;
/**
* Adapts a Zend Framework 1 logger object
View
2  src/Guzzle/Common/Log/Zf2LogAdapter.php → src/Guzzle/Log/Zf2LogAdapter.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Log;
+namespace Guzzle\Log;
use Zend\Log\Logger;
View
22 src/Guzzle/Log/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "guzzle/log",
+ "type": "component",
+ "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": "" }
+ },
+ "target-dir": "Guzzle/Log"
+}
View
2  src/Guzzle/Http/Plugin/AsyncPlugin.php → src/Guzzle/Plugin/Async/AsyncPlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Async;
use Guzzle\Common\Event;
use Guzzle\Http\Message\Response;
View
23 src/Guzzle/Plugin/Async/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-async",
+ "type": "component",
+ "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"
+}
View
6 src/Guzzle/Http/Plugin/ExponentialBackoffLogger.php → src/Guzzle/Plugin/Backoff/BackoffLogger.php
@@ -1,10 +1,10 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Backoff;
use Guzzle\Common\Event;
use Guzzle\Common\Collection;
-use Guzzle\Common\Log\LogAdapterInterface;
+use Guzzle\Log\LogAdapterInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
@@ -25,7 +25,7 @@
* - {total_time}: Total transaction time in seconds for last transfer (if available)
* - {header_*}: Replace `*` with the lowercased name of a header to add to the message
*/
-class ExponentialBackoffLogger implements EventSubscriberInterface
+class BackoffLogger implements EventSubscriberInterface
{
/**
* @var string Default log message template
View
2  src/Guzzle/Http/Plugin/ExponentialBackoffPlugin.php → ...uzzle/Plugin/Backoff/ExponentialBackoffPlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Backoff;
use Guzzle\Common\Event;
use Guzzle\Common\AbstractHasDispatcher;
View
24 src/Guzzle/Plugin/Backoff/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "guzzle/plugin-backoff",
+ "type": "component",
+ "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"
+}
View
4 src/Guzzle/Http/Plugin/CachePlugin.php → src/Guzzle/Plugin/Cache/CachePlugin.php
@@ -1,8 +1,8 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Cache;
-use Guzzle\Common\Cache\CacheAdapterInterface;
+use Guzzle\Cache\CacheAdapterInterface;
use Guzzle\Common\Event;
use Guzzle\Http\Utils;
use Guzzle\Http\Message\RequestInterface;
View
24 src/Guzzle/Plugin/Cache/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "guzzle/plugin-cache",
+ "type": "component",
+ "description": "Guzzle HTTP cache 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",
+ "guzzle/cache": "self.version"
+ },
+ "autoload": {
+ "psr-0": { "Guzzle\\Plugin\\Cache": "" }
+ },
+ "target-dir": "Guzzle/Plugin/Cache"
+}
View
2  src/Guzzle/Http/Plugin/CookiePlugin.php → src/Guzzle/Plugin/Cookie/CookiePlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Cookie;
use Guzzle\Common\Event;
use Guzzle\Http\CookieJar\CookieJarInterface;
View
23 src/Guzzle/Plugin/Cookie/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-cookie",
+ "type": "component",
+ "description": "Guzzle cookie 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\\Cookie": "" }
+ },
+ "target-dir": "Guzzle/Plugin/Cookie"
+}
View
2  src/Guzzle/Http/Plugin/CurlAuthPlugin.php → src/Guzzle/Plugin/CurlAuth/CurlAuthPlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\CurlAuth;
use Guzzle\Common\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
View
23 src/Guzzle/Plugin/CurlAuth/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-curlauth",
+ "type": "component",
+ "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"
+}
View
2  src/Guzzle/Http/Plugin/HistoryPlugin.php → src/Guzzle/Plugin/History/HistoryPlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\History;
use Guzzle\Common\Event;
use Guzzle\Http\Message\RequestInterface;
View
23 src/Guzzle/Plugin/History/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-history",
+ "type": "component",
+ "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"
+}
View
4 src/Guzzle/Http/Plugin/LogPlugin.php → src/Guzzle/Plugin/Log/LogPlugin.php
@@ -1,9 +1,9 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Log;
use Guzzle\Common\Event;
-use Guzzle\Common\Log\LogAdapterInterface;
+use Guzzle\Log\LogAdapterInterface;
use Guzzle\Http\EntityBody;
use Guzzle\Http\Message\EntityEnclosingRequestInterface;
use Guzzle\Http\Message\RequestInterface;
View
24 src/Guzzle/Plugin/Log/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "guzzle/plugin-log",
+ "type": "component",
+ "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"
+}
View
2  src/Guzzle/Http/Plugin/Md5ValidatorPlugin.php → ...Guzzle/Plugin/Md5Validator/Md5ValidatorPlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Md5Validator;
use Guzzle\Common\Event;
use Guzzle\Common\Exception\UnexpectedValueException;
View
23 src/Guzzle/Plugin/Md5Validator/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-md5validator",
+ "type": "component",
+ "description": "Guzzle MD5 validator 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\\Md5Validator": "" }
+ },
+ "target-dir": "Guzzle/Plugin/Md5Validator"
+}
View
2  src/Guzzle/Http/Plugin/MockPlugin.php → src/Guzzle/Plugin/Mock/MockPlugin.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Mock;
use Guzzle\Common\Event;
use Guzzle\Common\Exception\InvalidArgumentException;
View
23 src/Guzzle/Plugin/Mock/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-mock",
+ "type": "component",
+ "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"
+}
View
5 src/Guzzle/Http/Plugin/OauthPlugin.php → src/Guzzle/Plugin/Oauth/OauthPlugin.php
@@ -1,13 +1,12 @@
<?php
-namespace Guzzle\Http\Plugin;
+namespace Guzzle\Plugin\Oauth;
use Guzzle\Common\Event;
use Guzzle\Common\Collection;
use Guzzle\Http\Message\RequestInterface;
use Guzzle\Http\Message\EntityEnclosingRequestInterface;
use Guzzle\Http\Url;
-use Guzzle\Service\Inspector;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
@@ -36,7 +35,7 @@ class OauthPlugin implements EventSubscriberInterface
*/
public function __construct($config)
{
- $this->config = Inspector::prepareConfig($config, array(
+ $this->config = Collection::fromConfig($config, array(
'version' => '1.0',
'consumer_key' => 'anonymous',
'consumer_secret' => 'anonymous',
View
23 src/Guzzle/Plugin/Oauth/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/plugin-oauth",
+ "type": "component",
+ "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"
+}
View
39 src/Guzzle/Plugin/composer.json
@@ -0,0 +1,39 @@
+{
+ "name": "guzzle/plugin",
+ "type": "component",
+ "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-history": "self.version",
+ "guzzle/plugin-log": "self.version",
+ "guzzle/plugin-md5validator": "self.version",
+ "guzzle/plugin-mock": "self.version",
+ "guzzle/plugin-oauth": "self.version"
+ }
+}
View
4 src/Guzzle/Service/Client.php
@@ -5,8 +5,8 @@
use Guzzle\Common\Collection;
use Guzzle\Common\Exception\InvalidArgumentException;
use Guzzle\Common\Exception\BadMethodCallException;
-use Guzzle\Common\Inflection\InflectorInterface;
-use Guzzle\Common\Inflection\Inflector;
+use Guzzle\Inflection\InflectorInterface;
+use Guzzle\Inflection\Inflector;
use Guzzle\Http\Client as HttpClient;
use Guzzle\Http\Message\RequestInterface;
use Guzzle\Service\Command\CommandInterface;
View
2  src/Guzzle/Service/ClientInterface.php
@@ -4,7 +4,7 @@
use Guzzle\Common\FromConfigInterface;
use Guzzle\Common\Exception\InvalidArgumentException;
-use Guzzle\Common\Inflection\InflectorInterface;
+use Guzzle\Inflection\InflectorInterface;
use Guzzle\Http\ClientInterface as HttpClientInterface;
use Guzzle\Service\Command\CommandInterface;
use Guzzle\Service\Description\ServiceDescription;
View
4 src/Guzzle/Service/Command/Factory/ConcreteClassFactory.php
@@ -2,8 +2,8 @@
namespace Guzzle\Service\Command\Factory;
-use Guzzle\Common\Inflection\InflectorInterface;
-use Guzzle\Common\Inflection\Inflector;
+use Guzzle\Inflection\InflectorInterface;
+use Guzzle\Inflection\Inflector;
use Guzzle\Service\ClientInterface;
/**
View
2  src/Guzzle/Service/Command/Factory/ServiceDescriptionFactory.php
@@ -3,7 +3,7 @@
namespace Guzzle\Service\Command\Factory;
use Guzzle\Service\Description\ServiceDescription;
-use Guzzle\Common\Inflection\InflectorInterface;
+use Guzzle\Inflection\InflectorInterface;
/**
* Command factory used to create commands based on service descriptions
View
2  src/Guzzle/Service/Description/ApiCommand.php
@@ -3,7 +3,7 @@
namespace Guzzle\Service\Description;
use Guzzle\Common\Collection;
-use Guzzle\Common\Inflection\Inflector;
+use Guzzle\Inflection\Inflector;
use Guzzle\Service\Exception\ValidationException;
use Guzzle\Service\Inspector;
View
4 src/Guzzle/Service/Exception/InconsistentClientTransferException.php
@@ -2,10 +2,12 @@
namespace Guzzle\Service\Exception;
+use Guzzle\Common\Exception\RuntimeException;
+
/**
* Command transfer exception when commands do not all use the same client
*/
-class InconsistentClientTransferException extends \RuntimeException
+class InconsistentClientTransferException extends RuntimeException
{
/**
* @var array Commands with an invalid client
View
30 src/Guzzle/Service/Inspector.php
@@ -4,7 +4,7 @@
use Guzzle\Common\Collection;
use Guzzle\Common\Exception\InvalidArgumentException;
-use Guzzle\Common\Validation\ConstraintInterface;
+use Guzzle\Validation\ConstraintInterface;
use Guzzle\Service\Exception\ValidationException;
/**
@@ -39,7 +39,7 @@ class Inspector
*/
public function __construct()
{
- $base = 'Guzzle\\Common\\Validation\\';
+ $base = 'Guzzle\\Validation\\';
$this->constraints = array(
'blank' => array($base . 'Blank', null),
'not_blank' => array($base . 'NotBlank', null),
@@ -83,32 +83,12 @@ public static function getInstance()
}
/**
- * Validate and prepare configuration parameters
- *
- * @param array $config Configuration values to apply.
- * @param array $defaults Default parameters
- * @param array $required Required parameter names
- *
- * @return Collection
- * @throws InvalidArgumentException if a parameter is missing
+ * @deprecated
+ * @see Guzzle\Common\Collection::fromConfig
*/
public static function prepareConfig(array $config = null, array $defaults = null, array $required = null)
{
- $collection = new Collection($defaults);
-
- foreach ((array) $config as $key => $value) {
- $collection->set($key, $value);
- }
-
- foreach ((array) $required as $key) {
- if ($collection->hasKey($key) === false) {
- throw new ValidationException(
- "Config must contain a '{$key}' key"
- );
- }
- }
-
- return $collection;
+ return Collection::fromConfig($config, $defaults, $required);
}
/**
View
6 src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.php
@@ -3,9 +3,9 @@
namespace Guzzle\Service\Resource;
use Guzzle\Common\AbstractHasDispatcher;
-use Guzzle\Common\Batch\BatchBuilder;
-use Guzzle\Common\Batch\BatchSizeDivisor;
-use Guzzle\Common\Batch\BatchClosureTransfer;
+use Guzzle\Batch\BatchBuilder;
+use Guzzle\Batch\BatchSizeDivisor;
+use Guzzle\Batch\BatchClosureTransfer;
/**
* Apply a callback to the contents of a {@see ResourceIteratorInterface}
View
4 src/Guzzle/Service/Resource/ResourceIteratorClassFactory.php
@@ -3,8 +3,8 @@
namespace Guzzle\Service\Resource;
use Guzzle\Common\Exception\InvalidArgumentException;
-use Guzzle\Common\Inflection\InflectorInterface;
-use Guzzle\Common\Inflection\Inflector;
+use Guzzle\Inflection\InflectorInterface;
+use Guzzle\Inflection\Inflector;
use Guzzle\Service\Command\CommandInterface;
/**
View
26 src/Guzzle/Service/composer.json
@@ -0,0 +1,26 @@
+{
+ "name": "guzzle/service",
+ "type": "component",
+ "description": "Guzzle service component for abstracting RESTful web services",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": ["web service", "webservice", "REST", "guzzle"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.2",
+ "guzzle/cache": "self.version",
+ "guzzle/http": "self.version",
+ "guzzle/inflection": "self.version",
+ "guzzle/validation": "self.version"
+ },
+ "autoload": {
+ "psr-0": { "Guzzle\\Service": "" }
+ },
+ "target-dir": "Guzzle/Service"
+}
View
2  src/Guzzle/Common/Stream.php → src/Guzzle/Stream/Stream.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common;
+namespace Guzzle\Stream;
use Guzzle\Common\Exception\InvalidArgumentException;
View
2  src/Guzzle/Common/StreamInterface.php → src/Guzzle/Stream/StreamInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common;
+namespace Guzzle\Stream;
/**
* OO interface to PHP streams
View
23 src/Guzzle/Stream/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "guzzle/stream",
+ "type": "component",
+ "description": "Guzzle stream wrapper component",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": ["stream", "component", "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\\Stream": "" }
+ },
+ "target-dir": "Guzzle/Stream"
+}
View
2  src/Guzzle/Common/Validation/AbstractConstraint.php → src/Guzzle/Validation/AbstractConstraint.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
use Guzzle\Common\Exception\InvalidArgumentException;
View
2  src/Guzzle/Common/Validation/AbstractType.php → src/Guzzle/Validation/AbstractType.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
use Guzzle\Common\Exception\InvalidArgumentException;
View
2  src/Guzzle/Common/Validation/AnyMatch.php → src/Guzzle/Validation/AnyMatch.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
use Guzzle\Service\Inspector;
View
2  src/Guzzle/Common/Validation/Blank.php → src/Guzzle/Validation/Blank.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is blank
View
2  src/Guzzle/Common/Validation/Bool.php → src/Guzzle/Validation/Bool.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is boolean ("true", "false", true, false, on, off, 1, 0)
View
2  src/Guzzle/Common/Validation/Choice.php → src/Guzzle/Validation/Choice.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is one of an array of choices
View
2  src/Guzzle/Common/Validation/ConstraintInterface.php → src/Guzzle/Validation/ConstraintInterface.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Interface for validating values
View
2  src/Guzzle/Common/Validation/Ctype.php → src/Guzzle/Validation/Ctype.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is of a specific ctype_*
View
2  src/Guzzle/Common/Validation/Email.php → src/Guzzle/Validation/Email.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is an email
View
2  src/Guzzle/Common/Validation/Ip.php → src/Guzzle/Validation/Ip.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is an IP address
View
2  src/Guzzle/Common/Validation/IsInstanceOf.php → src/Guzzle/Validation/IsInstanceOf.php
@@ -1,6 +1,6 @@
<?php
-namespace Guzzle\Common\Validation;
+namespace Guzzle\Validation;
/**
* Ensures that a value is an instance of a class
View