PHP Class 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.
Inheritance: extends Horde_Rpc
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Méthode Description
_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.

Method Details

_objectsToArrays() public méthode

Converts stdClass object to associative arrays.
public _objectsToArrays ( $data ) : mixed
$data mixed Any stdClass object, array, or scalar.
Résultat mixed stdClass objects are returned as asscociative arrays, scalars as-is, and arrays with their elements converted.

_raiseError() public méthode

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.
Résultat PEAR_Error An error object suitable for a JSON-RPC 1.1 conform error result.

getResponse() public méthode

Sends an RPC request to the server and returns the result.
public getResponse ( $request ) : string
Résultat string The JSON encoded response from the server.

getResponseContentType() public méthode

Returns the Content-Type of the response.
public getResponseContentType ( ) : string
Résultat string The MIME Content-Type of the RPC response.

request() public static méthode

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.
Résultat mixed The returned result from the method.