1
1
# Guzzle JSON-RPC
2
2
3
3
[ ![ Master branch build status] [ ico-build ]] [ travis ]
4
+ [ ![ Coverage Status] [ ico-coverage ]] [ coverage ]
5
+ [ ![ Quality Score] [ ico-quality ]] [ quality ]
4
6
[ ![ Published version] [ ico-package ]] [ package ]
5
7
[ ![ PHP ~ 5.4] [ ico-engine ]] [ lang ]
6
8
[ ![ MIT Licensed] [ ico-license ]] [ license ]
7
9
8
10
This library implements [ JSON-RPC 2.0] [ jsonrpc ] for the Guzzle HTTP client. We
9
11
try to support all commonly used versions of Guzzle including:
10
- - [ GuzzleHTTP 5] [ guzzle ] on [ ` master ` ] [ branch-master ] branch, ` >= 2.1 ` releases
11
- - [ GuzzleHTTP 4] [ guzzle ] on [ ` guzzle-4 ` ] [ branch-4 ] branch, ` 2.0.x ` releases
12
- - [ Guzzle 3] [ guzzle-3 ] on [ ` guzzle-3 ` ] [ branch-3 ] branch, ` 1.x ` releases
12
+
13
+ - [ GuzzleHTTP 6] [ guzzle ] on [ ` master ` ] [ branch-master ] branch, ` ^3.0 ` releases
14
+ - [ GuzzleHTTP 5] [ guzzle ] on [ ` guzzle-5 ` ] [ branch-5 ] branch, ` ^2.1 ` releases
15
+ - [ GuzzleHTTP 4] [ guzzle ] on [ ` guzzle-4 ` ] [ branch-4 ] branch, ` 2.0.* ` releases
16
+ - [ Guzzle 3] [ guzzle-3 ] on [ ` guzzle-3 ` ] [ branch-3 ] branch, ` ^1.0 ` releases
13
17
14
18
It can be installed in whichever way you prefer, but we recommend [ Composer] [ package ] .
19
+
15
20
``` json
16
21
{
17
22
"require" : {
18
- "graze/guzzle-jsonrpc" : " ~ 2.1"
23
+ "graze/guzzle-jsonrpc" : " ^ 2.1"
19
24
}
20
25
}
21
26
```
22
27
28
+ ``` shell
29
+ ~ $ composer require graze/guzzle-jsonrpc:^2.1
30
+ ```
31
+
23
32
## Documentation
33
+
24
34
``` php
25
35
<?php
26
36
use Graze\GuzzleHttp\JsonRpc\Client;
@@ -43,10 +53,12 @@ $request->sendAll([
43
53
```
44
54
45
55
### Throw exception on RPC error
56
+
46
57
You can throw an exception if you receive an RPC error response by attaching a
47
58
subscriber to either the client or the request. You probably won't want to do so
48
59
with batch requests as the exception will only include the first bad response in
49
60
your batch.
61
+
50
62
``` php
51
63
<?php
52
64
use Graze\GuzzleHttp\JsonRpc\Client;
@@ -68,40 +80,43 @@ try {
68
80
}
69
81
```
70
82
71
- ## Contributing
83
+ ### Contributing
84
+
72
85
We accept contributions to the source via Pull Request,
73
86
but passing unit tests must be included before it will be considered for merge.
74
- ``` bash
75
- $ composer install
76
- $ make test
77
- ```
78
87
79
- If you have [ Vagrant] [ vagrant ] installed, you can build our dev environment to
80
- assist development. The repository will be mounted in ` /srv ` .
81
88
``` bash
82
- $ vagrant up
83
- $ vagrant ssh
84
- $ cd /srv
89
+ ~ $ make deps
90
+ ~ $ make lint test
85
91
```
86
92
87
93
### License
94
+
88
95
The content of this library is released under the ** MIT License** by
89
- ** Nature Delivered Ltd** .<br /> You can find a copy of this license at
90
- http://www.opensource.org/licenses/mit or in [ ` LICENSE ` ] [ license ]
96
+ ** Nature Delivered Ltd** .
97
+
98
+ You can find a copy of this license at
99
+ [ MIT] [ mit ] or in [ ` LICENSE ` ] [ license ]
91
100
92
101
<!-- Links -->
102
+ [ mit ] : http://www.opensource.org/licenses/mit
93
103
[ travis ] : https://travis-ci.org/graze/guzzle-jsonrpc
94
104
[ lang ] : http://php.net
95
105
[ package ] : https://packagist.org/packages/graze/guzzle-jsonrpc
106
+ [ coverage ] : https://scrutinizer-ci.com/g/graze/guzzle-jsonrpc/guzzle-5/code-structure
107
+ [ quality ] : https://scrutinizer-ci.com/g/graze/guzzle-jsonrpc/guzzle-5
96
108
[ ico-license ] : http://img.shields.io/packagist/l/graze/guzzle-jsonrpc.svg?style=flat
97
109
[ ico-package ] : http://img.shields.io/packagist/v/graze/guzzle-jsonrpc.svg?style=flat
98
- [ ico-build ] : http://img.shields.io/travis/graze/guzzle-jsonrpc/master .svg?style=flat
110
+ [ ico-build ] : http://img.shields.io/travis/graze/guzzle-jsonrpc/guzzle-5 .svg?style=flat
99
111
[ ico-engine ] : http://img.shields.io/badge/php-~5.4-8892BF.svg?style=flat
112
+ [ ico-coverage ] : https://img.shields.io/scrutinizer/coverage/g/graze/guzzle-jsonrpc/guzzle-5.svg?style=flat
113
+ [ ico-quality ] : https://img.shields.io/scrutinizer/g/graze/guzzle-jsonrpc/guzzle-5.svg?style=flat
100
114
[ vagrant ] : http://vagrantup.com
101
115
[ jsonrpc ] : http://jsonrpc.org/specification
102
116
[ guzzle ] : https://github.com/guzzle/guzzle
103
117
[ guzzle-3 ] : https://github.com/guzzle/guzzle3
104
118
[ branch-3 ] : https://github.com/graze/guzzle-jsonrpc/tree/guzzle-3
105
119
[ branch-4 ] : https://github.com/graze/guzzle-jsonrpc/tree/guzzle-4
120
+ [ branch-5 ] : https://github.com/graze/guzzle-jsonrpc/tree/guzzle-5
106
121
[ branch-master ] : https://github.com/graze/guzzle-jsonrpc
107
122
[ license ] : LICENSE
0 commit comments