Skip to content
This repository was archived by the owner on Mar 16, 2018. It is now read-only.

devchunk/yii2-json-rpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonRpc Server and Client for Yii2

##Usage Server

  1. Install with Composer
"require": {
    "devchunk/yii2-json-rpc": "dev-master",
},

php composer.phar update
  1. 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;
}
  1. 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);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%