-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate guzzlehttp/guzzle-service to Guzzle 6
* Migrate the serialization * Migrate the deserialization * Move the response error handling from `HandleErrorResponses` to `Deserializer` * Migrate the request locations * Migrate the response locations * Add request location FormParamLocation as substitute of PostFieldLocation * Add request location MultiPartLocation as substitute of PostFileLocation * Migrate ValidateInput to ValidateDescriptionHandler * Move code from ProcessResponse to Deserializer * Change Description::getBaseUrl() to Description::getBaseUri() * Change Parameter::getRequired() to Parameter::isRequired() * Change Parameter::getStatic() to Parameter::isStatic() * Require PHP 5.5 and higher
- Loading branch information
1 parent
8adb1d1
commit 3bdd887
Showing
64 changed files
with
3,984 additions
and
2,347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
.idea | ||
.DS_STORE | ||
phpunit.xml | ||
composer.lock | ||
vendor/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Guzzle Services | ||
|
||
[](https://packagist.org/packages/guzzlehttp/guzzle-services) | ||
[](https://travis-ci.org/guzzle/guzzle-services) | ||
[](https://scrutinizer-ci.com/g/guzzle/guzzle-services/?branch=guzzle6) | ||
[](https://scrutinizer-ci.com/g/guzzle/guzzle-services/?branch=guzzle6) | ||
[](https://insight.sensiolabs.com/projects/b08be676-b209-40b7-a6df-b6d13e8dff62) | ||
[](https://packagist.org/packages/guzzlehttp/guzzle-services) | ||
[](https://packagist.org/packages/guzzlehttp/guzzle-services) | ||
[](https://packagist.org/packages/guzzlehttp/guzzle-services) | ||
|
||
Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures. | ||
|
||
```php | ||
use GuzzleHttp\Client; | ||
use GuzzleHttp\Command\Guzzle\GuzzleClient; | ||
use GuzzleHttp\Command\Guzzle\Description; | ||
|
||
$client = new Client(); | ||
$description = new Description([ | ||
'baseUri' => 'http://httpbin.org/', | ||
'operations' => [ | ||
'testing' => [ | ||
'httpMethod' => 'GET', | ||
'uri' => '/get{?foo}', | ||
'responseModel' => 'getResponse', | ||
'parameters' => [ | ||
'foo' => [ | ||
'type' => 'string', | ||
'location' => 'uri' | ||
], | ||
'bar' => [ | ||
'type' => 'string', | ||
'location' => 'query' | ||
] | ||
] | ||
] | ||
], | ||
'models' => [ | ||
'getResponse' => [ | ||
'type' => 'object', | ||
'additionalProperties' => [ | ||
'location' => 'json' | ||
] | ||
] | ||
] | ||
]); | ||
|
||
$guzzleClient = new GuzzleClient($client, $description); | ||
|
||
$result = $guzzleClient->testing(['foo' => 'bar']); | ||
echo $result['args']['foo']; | ||
// bar | ||
``` | ||
|
||
## Installing | ||
|
||
This project can be installed using Composer: | ||
|
||
``composer require guzzlehttp/guzzle-services`` | ||
|
||
For **Guzzle 5**, use ``composer require guzzlehttp/guzzle-services:0.5.*``. | ||
|
||
**Note:** If Composer is not | ||
`installed globally <https://getcomposer.org/doc/00-intro.md#globally>`_, | ||
then you may need to run the preceding Composer commands using | ||
``php composer.phar`` (where ``composer.phar`` is the path to your copy of | ||
Composer), instead of just ``composer``. | ||
|
||
## Plugins | ||
|
||
* Load Service description from file [https://github.com/gimler/guzzle-description-loader] | ||
|
||
More documentation coming soon. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,22 @@ | |
"name": "Michael Dowling", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/mtdowling" | ||
}, | ||
{ | ||
"name": "Jeremy Lindblom", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/jeremeamia" | ||
}, | ||
{ | ||
"name": "Stefano Kowalke", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/konafets" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.4.0", | ||
"guzzlehttp/command": "0.7.*" | ||
"php": ">=5.5", | ||
"guzzlehttp/guzzle": "^6.2", | ||
"guzzlehttp/command": "~1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.0" | ||
|
@@ -27,9 +38,12 @@ | |
"GuzzleHttp\\Tests\\Command\\Guzzle\\": "tests/" | ||
} | ||
}, | ||
"suggest": { | ||
"gimler/guzzle-description-loader": "^0.0.4" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "0.4-dev" | ||
"dev-master": "0.6-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.