2017 © Pedro Peláez
 

library simplejsonrpc

Implementation of JSON-RPC for PHP 5.4+

image

egorgrushko/simplejsonrpc

Implementation of JSON-RPC for PHP 5.4+

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SimpleJSONRPC

Implementation of JSON-RPC for PHP 5.4+. Can be used to create API service for your project. Specification: http://www.jsonrpc.org/specification, (*1)

Install

Via Composer, (*2)

``` bash $ composer require egorgrushko/simplejsonrpc, (*3)


## Usage Example implementation of http://www.jsonrpc.org/specification#examples ``` php class Foo { public $data; public function __construct($data) { $this->data = $data; } public function __destruct() { } public function sum($param1, $param2, $param3) { return $param1 + $param2 + $param3; } public function subtract($minuend, $subtrahend) { return $minuend - $subtrahend; } public function notify_hello() { return 2 + 2; } public function get_data() { return $this->data; } } $request = isset($_REQUEST['request']) ? $_REQUEST['request'] : null; // Read JSON string $fooObject = new Foo(array("hello", 0)); // Create the class object with the required methods and properties $server = new SimpleJSONRPCServer($fooObject); // Create server object $fooObject->data[1] = 5; // You can change properties before or between processing RPC echo $server->process($request); // Execute the JSONRPC string processing. Returns result of processing

License

The MIT License (MIT). Please see License File (LICENSE.md) for more information., (*4)

The Versions

05/02 2017

dev-master

9999999-dev https://github.com/egorgrushko/SimpleJSONRPC

Implementation of JSON-RPC for PHP 5.4+

  Sources   Download

MIT

The Requires

  • php >= 5.4.0

 

api soa json json-rpc jsonrpc rpc service-oriented architecture