mszewcz/php-json-rpc
PHP 7.1+ implementation of JSON RPC 2.0. Client and server libraries can handle regular requests, notifications. Batch requests are supported.
Server supports namespaces and self-description (automatically provides input and output schema for each method in each namespace - please refer to Wiki).
Client is able to send requests using stream context, cURL extension or by user defined transport class., (*1)
, (*2)
Contents
, (*3)
What is JSON RPC?
JSON RPC is a simple and light weight communication protocol that allows clients and servers talk to each other. Version 2.0, which is implemented by this library, is described here. Please take a while to read this, to understand request and response formats as well as some server-regarded rules., (*4)
, (*5)
Installation
If you use Composer to manage the dependencies simply add a dependency on mszewcz/php-json-rpc to your project's composer.json file. Here is a minimal example of a composer.json:, (*6)
{
"require": {
"mszewcz/php-json-rpc": ">=1.0"
}
}
You can also clone or download this respository., (*7)
php-json-rpc meets PSR-4 autoloading standards. If using the Composer please include its autoloader file:, (*8)
require_once 'vendor/autoload.php';
If you cloned or downloaded this repository, you will have to code your own PSR-4 style autoloader implementation., (*9)
, (*10)
Usage
Please refer to project Wiki:
- Client usage
- Server usage, (*11)
You may also want to check examples directory., (*12)
, (*13)
Contributing
Contributions are welcome. Please send your contributions through GitHub pull requests, (*14)
Pull requests for bug fixes must be based on latest stable release from the master branch whereas pull requests for new features must be based on the developer branch., (*15)
Due to time constraints, I am not always able to respond as quickly as I would like. If you feel you're waiting too long for merging your pull request please remind me here., (*16)
Coding standards
I follow PSR-2 coding style and PSR-4 autoloading standards. Be sure you're also following them before sending us your pull request., (*17)
, (*18)
License
php-json-rpc is licensed under the MIT License - see the LICENSE file for details., (*19)