$_params
$_params : array
All driver-specific parameters.
The Horde_RPC_json-rpc class provides a JSON-RPC 1.1 implementation of the Horde RPC system.
authorize() : boolean
Check authentication. Different backends may handle authentication in different ways. The base class implementation checks for HTTP Authentication against the Horde auth setup.
Returns true if authentication is successful. Should send appropriate "not authorized" headers or other response codes/body if auth fails, and take care of exiting.
getInput() : mixed
Get the request body input. Different RPC backends can override this to return an open stream to php://stdin, for instance - whatever is easiest to handle in the getResponse() method.
The base class implementation looks for $HTTP_RAW_POST_DATA and returns that if it's available; otherwise, it returns the contents of php://stdin.
The input - a string (default), a filehandle, etc.
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.
This statically called method is actually the JSON-RPC client.
string|\Horde_Url | $url | The path to the JSON-RPC server on the called host. |
string | $method | The method to call. |
\Horde_Http_Client | $client | An appropriate request client for the type of request. (Horde_Http_Request, SoapClient etc..) |
array | $params | A hash containing any necessary parameters for the method call. |
The returned result from the method.
factory(mixed $driver, $request, array $params = null) : \Horde_Rpc
Attempts to return a concrete RPC server instance based on $driver.
mixed | $driver | The type of concrete Horde_Rpc subclass to return. |
$request | ||
array | $params | A hash containing any additional configuration or connection parameters a subclass might need. |
The newly created concrete Horde_Rpc server instance, or an exception if there is an error.
_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.
string|\PEAR_Error | $error | The error message or object. |
\stdClass | $request | The original request object. |
An error object suitable for a JSON-RPC 1.1 conform error result.