PHP code example of limingxinleo / jsonrpc-fpm-client

1. Go to this page and download the library: Download limingxinleo/jsonrpc-fpm-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

limingxinleo / jsonrpc-fpm-client example snippets




use Xin\JsonRPC\FpmClient\Client;

/**
 * @method string id(string $id)
 * @method void exception()
 */
class IdGenerator extends Client
{
}




use Xin\JsonRPC\FpmClient\Packer\JsonLengthPacker;
use Xin\JsonRPC\FpmClient\Transporter\TcpTransporter;

$client = new IdGenerator('IdGenerateService', new TcpTransporter('127.0.0.1', 9502), new JsonLengthPacker());
$ret = $client->id($id = uniqid());