- Fully compliant with the JSON-RPC 2.0 specifications (with 100% unit-test coverage)
- Flexible: you can choose your own system for interpreting the JSON-RPC method strings
- Minimalistic (just two tiny files)
- Ready to use, with working examples
- PHP >= 5.3
This package is released under an open-source license: LGPL-3.0
$client = new Client($destination, $command, $options);
$client->query(1, 'add', array(1, 2));
$reply = $client->send(); // array('jsonrpc' => '2.0', 'id' => 1, 'result' => 3)
$translator = new Translator();
$server = new Server($translator);
$server->reply();
See the "examples" folder for ready-to-use examples.
If you're using Composer, you can use this package (datto/json-rpc-ssh) by inserting a line into the "require" section of your "composer.json" file:
"datto/json-rpc-ssh": "~1.0"
-
Try the examples! Follow the README file in the "examples" directory to set up an SSH environment. Then run the examples from the project directory like this:
php examples/client.php
-
Once your example is working, replace the example "Server" code with your own code.
-
Write a beautiful wrapper around the JSON-RPC client class that will dovetail with your project.