\Nano4\Utils\JSONRPCClient

A simple JSON-RPC client.

Summary

Methods
Properties
Constants
__construct()
__call()
$version
$debug
$notify
$batch
$idtype
$batch_name
$notifications
$named_params
No constants found
_rpc_send_request()
_rpc_send_batch_requests()
$batch_requests
$transport
N/A
No private methods found
No private properties found
N/A

Properties

$version

$version : 

Type

$debug

$debug : 

Type

$notify

$notify : 

Type

$batch

$batch : 

Type

$idtype

$idtype : 

Type

$batch_name

$batch_name : 

Type

$notifications

$notifications : 

Type

$named_params

$named_params : 

Type

$batch_requests

$batch_requests : 

Type

$transport

$transport : 

Type

Methods

__construct()

__construct(Array  $opts) 

Build a JSON-RPC client.

Parameters

Array $opts

Named parameters.

'debug' If true, we enable debugging. 'idtype' One of JSONRPC_ID_RAND, JSONRPC_ID_TIME, JSONRPC_ID_UUID. 'version' Either 1 (default) or 2 (for JSON-RPC 2.0). 'batch' If true, we use batch mode (2.0 only) 'batch_name' Override the method name used to send batch requests. We use 'send' by default. (Only if batch is true.) 'notifications' An array of methods that are notifications. 'named_params' An array of methods that use named params (2.0 only.) 'transport' One of the transport classes: 'http' A simple HTTP stream class (default). 'curl' The Nano Curl library is used for transport. 'socket' The Nano Socket library is used for transport.

Any extra parameters are sent to the Transport object's constructor. The default 'http' transport REQUIRES the 'url' parameter to specify the JSON-RPC URL endpoint.

Any of the parameters other than 'transport' can be changed after initialization using object properties of the same name.

__call()

__call(  $method,   $params) 

Builds requests based on object method calls.

Parameters

$method
$params

_rpc_send_request()

_rpc_send_request(  $request) 

Parameters

$request

_rpc_send_batch_requests()

_rpc_send_batch_requests()