Class Horde_Rpc_Jsonrpc
The Horde_RPC_json-rpc class provides a JSON-RPC 1.1 implementation of the
Horde RPC system.
- 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.
-
Horde_Rpc
-
Horde_Rpc_Jsonrpc
Methods summary
public
string
|
#
getResponseContentType( )
Returns the Content-Type of the response.
Returns the Content-Type of the response.
Returns
string The MIME Content-Type of the RPC response.
Overrides
|
public
string
|
#
getResponse( string $request )
Sends an RPC request to the server and returns the result.
Sends an RPC request to the server and returns the result.
Parameters
- $request
- raw request string.
Returns
string The JSON encoded response from the server.
Overrides
|
public
PEAR_Error
|
#
_raiseError( string|PEAR_Error $error, stdClass $request )
Returns a specially crafted PEAR_Error object containing a JSON-RPC
response in the error message.
Returns a specially crafted PEAR_Error object containing a JSON-RPC
response in the error message.
Parameters
- $error
- The error message or object.
- $request
- The original request object.
Returns
PEAR_Error An error object suitable for a JSON-RPC 1.1
conform error result.
|
public static
mixed
|
#
request( string|Horde_Url $url, string $method, Horde_Http_Client $client, array $params = null )
Builds an JSON-RPC request and sends it to the server.
Builds an JSON-RPC request and sends it to the server.
This statically called method is actually the JSON-RPC client.
Parameters
- $url
- <p>The path to the JSON-RPC server on the
called host.</p>
- $method
- The method to call.
- $client
-
- $params
- <p>A hash containing any necessary parameters
for the method call.</p>
Returns
mixed The returned result from the method.
Throws
Overrides
|
public
mixed
|
#
_objectsToArrays( mixed $data )
Converts stdClass object to associative arrays.
Converts stdClass object to associative arrays.
Parameters
- $data
- Any stdClass object, array, or scalar.
Returns
mixed stdClass objects are returned as asscociative arrays,
scalars as-is, and arrays with their elements converted.
|