JSONRPC 1.0.0-beta3

Notification extends Request
in package

Table of Contents

Properties

$content_type  : mixed
$currentIdCounter  : mixed
$currentIdPrefix  : mixed
$id  : mixed
$jsonrpc_version  : string
$paramnames  : array<string|int, string>
$serializer  : mixed

Methods

__construct()  : mixed
addParam()  : bool
getJsonRpcVersion()  : string
getParamNames()  : array<string|int, string>
getParser()  : Parser
Reimplemented to make us use the correct parser type.
getSerializer()  : mixed
id()  : mixed
parseResponse()  : Response
Parse the json-rpc response contained in the string $data and return a jsonrpcresp object.
setJsonRpcVersion()  : void
setSerializer()  : mixed
generateId()  : mixed

Properties

$content_type

public mixed $content_type = 'application/json'

$currentIdCounter

protected static mixed $currentIdCounter = 1

$currentIdPrefix

protected static mixed $currentIdPrefix = ''

$jsonrpc_version

protected string $jsonrpc_version = \PhpXmlRpc\JsonRpc\PhpJsonRpc::VERSION_2_0

$paramnames

protected array<string|int, string> $paramnames = array()

Methods

__construct()

public __construct(mixed $methodName[, mixed $params = array() ]) : mixed
Parameters
$methodName : mixed

the name of the method to invoke

$params : mixed = array()

array of parameters to be passed to the method (xmlrpcval objects)

addParam()

public addParam(mixed $param[, string|null $name = null ]) : bool
Parameters
$param : mixed
$name : string|null = null
Return values
bool

getJsonRpcVersion()

public getJsonRpcVersion() : string
Return values
string

getParamNames()

public getParamNames() : array<string|int, string>
Return values
array<string|int, string>

getParser()

Reimplemented to make us use the correct parser type.

public getParser() : Parser
Return values
Parser

parseResponse()

Parse the json-rpc response contained in the string $data and return a jsonrpcresp object.

public parseResponse([string $data = '' ][, bool $headersProcessed = false ][, string $returnType = Parser::RETURN_JSONRPCVALS ]) : Response
Parameters
$data : string = ''

the json-rpc response, possibly including http headers

$headersProcessed : bool = false

when true prevents parsing HTTP headers for interpretation of content-encoding and conseuqent decoding

$returnType : string = Parser::RETURN_JSONRPCVALS

decides return type, i.e. content of response->value(). Either 'jsonrpcvals', 'json' or 'phpvals'

Tags
todo

move more of this parsing into the parent class (split method in smaller ones)

todo

throw when $returnType == 'xmlrpcvals', 'epivals' or 'xml'

todo

we should check that the received Id is the same s the one sent

Return values
Response

setJsonRpcVersion()

public setJsonRpcVersion(string $jsonrpcVersion) : void
Parameters
$jsonrpcVersion : string

setSerializer()

public static setSerializer(mixed $serializer) : mixed
Parameters
$serializer : mixed

        
On this page

Search results