itcoder / jsonrpc-client
There is no license information available for the latest version (dev-master) of this package.
php json-rpc client for connection golang based on jsonrpc protocol v1
dev-master
2018-09-24 15:04 UTC
Requires
- php: >=7.2.9
This package is auto-updated.
Last update: 2024-09-25 08:30:10 UTC
README
Overview
This package based on JSON-RPC 1.0 Specification
Features
- Correct: fully compliant with the JSON-RPC 2.0 specifications
Examples
Client
$socketStream = new SocketStream('127.0.0.1:1234', 1000); $tcpConnection = new TcpConnection($socketStream); $client = new Client($tcpConnection); $method = 'PackageJsonRpc.Push'; $params = [ ['subscribe' => 1, 'validate' => true], ['message' => 'test message', 'check' => true], ]; foreach ($params as $p) { $result = $client->query($method, $p); var_dump($result); }
Server
Server based on on this GOLANG lib examples.
Requirements
- PHP >= 7.2.9
License
This package is released under an open-source license: LGPL-3.0
Installation
If you're using Composer, you can include this library (itcoder/jsonrpc-client) like this:
composer require "itcoder/jsonrpc-client" "~0.1"
Getting started
- Try the examples. You can run the examples from the project directory like this:
php examples/rpc-client.php
Unit tests
You can run the suite of unit tests from the project directory like this:
php ./phpunit.phar
Author
[Yuri Zhigadlo] (https://github.com/yuzic)