PHP Класс Horde_Rpc_Jsonrpc, horde

- Only POST requests are supported. - Named and positional parameters are accepted but the Horde registry only works with positional parameters. - Service Descriptions are not supported yet.
Наследование: extends Horde_Rpc
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
_objectsToArrays ( $data ) : mixed Converts stdClass object to associative arrays.
_raiseError ( string | PEAR_Error $error, stdClass $request ) : PEAR_Error Returns a specially crafted PEAR_Error object containing a JSON-RPC response in the error message.
getResponse ( $request ) : string Sends an RPC request to the server and returns the result.
getResponseContentType ( ) : string Returns the Content-Type of the response.
request ( string | Horde_Url $url, string $method, Horde_Http_Client $client, array $params = null ) : mixed Builds an JSON-RPC request and sends it to the server.

Описание методов

_objectsToArrays() публичный Метод

Converts stdClass object to associative arrays.
public _objectsToArrays ( $data ) : mixed
$data mixed Any stdClass object, array, or scalar.
Результат mixed stdClass objects are returned as asscociative arrays, scalars as-is, and arrays with their elements converted.

_raiseError() публичный Метод

Returns a specially crafted PEAR_Error object containing a JSON-RPC response in the error message.
public _raiseError ( string | PEAR_Error $error, stdClass $request ) : PEAR_Error
$error string | PEAR_Error The error message or object.
$request stdClass The original request object.
Результат PEAR_Error An error object suitable for a JSON-RPC 1.1 conform error result.

getResponse() публичный Метод

Sends an RPC request to the server and returns the result.
public getResponse ( $request ) : string
Результат string The JSON encoded response from the server.

getResponseContentType() публичный Метод

Returns the Content-Type of the response.
public getResponseContentType ( ) : string
Результат string The MIME Content-Type of the RPC response.

request() публичный статический Метод

This statically called method is actually the JSON-RPC client.
public static request ( string | Horde_Url $url, string $method, Horde_Http_Client $client, array $params = null ) : mixed
$url string | Horde_Url The path to the JSON-RPC server on the called host.
$method string The method to call.
$client Horde_Http_Client
$params array A hash containing any necessary parameters for the method call.
Результат mixed The returned result from the method.