devchunk / yii2-json-rpc
This package is abandoned and no longer maintained.
No replacement package was suggested.
There is no license information available for the latest version (v2.0.0) of this package.
yii2-json-rpc
v2.0.0
2016-07-07 21:36 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: *
README
JsonRpc Server and Client for Yii2
##Usage Server
- Install with Composer
"require": { "devchunk/yii2-json-rpc": "dev-master", }, php composer.phar update
- Server:
Add action to controller (e.g. JsonRpcTestController)
public function actions() { return array( 'index' => array( 'class' => '\devchunk\jsonRpc\Action', ), ); } public function echo($param) { return $param; }
- Client:
$rpc = new Client('http://127.0.0.1/json-rpc-test', [ 'timeout' => 5, ]); $result = $rpc->echo("some string"); echo sprintf("RPC result: %s\n", $r);