Class Horde_RPC_jsonrpc

Description

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.

Located in /RPC/RPC/jsonrpc.php (line 31)

Horde_RPC
   |
   --Horde_RPC_jsonrpc
Method Summary
 Horde_RPC_jsonrpc Horde_RPC_jsonrpc ([ $params = array()], array $config)
 string getResponse (string $request)
 mixed request (string $url, string $method, [array $params = null], [$options $options = array()])
 mixed _objectsToArrays ($data $data)
 PEAR_Error _raiseError (string|PEAR_Error $error, stdClass $request)
Variables
Methods
Constructor Horde_RPC_jsonrpc (line 39)

Constructor.

Horde_RPC_jsonrpc Horde_RPC_jsonrpc ([ $params = array()], array $config)
  • array $config: A hash containing any additional configuration or connection parameters this class might need.
  • $params
getResponse (line 62)

Sends an RPC request to the server and returns the result.

  • return: The JSON encoded response from the server.
string getResponse (string $request)
  • string $request: The raw request string.

Redefinition of:
Horde_RPC::getResponse()
Sends an RPC request to the server and returns the result.
getResponseContentType (line 50)

Returns the Content-Type of the response.

  • return: The MIME Content-Type of the RPC response.
string getResponseContentType ()

Redefinition of:
Horde_RPC::getResponseContentType()
Returns the Content-Type of the response.
request (line 165)

Builds an JSON-RPC request and sends it to the server.

This statically called method is actually the JSON-RPC client.

  • return: The returned result from the method or a PEAR_Error on failure.
mixed request (string $url, string $method, [array $params = null], [$options $options = array()])
  • string $url: The path to the JSON-RPC server on the called host.
  • string $method: The method to call.
  • array $params: A hash containing any necessary parameters for the method call.
  • $options $options: Optional associative array of parameters which can be:
    • user - Basic Auth username
    • pass - Basic Auth password
    • proxy_host - Proxy server host
    • proxy_port - Proxy server port
    • proxy_user - Proxy auth username
    • proxy_pass - Proxy auth password
    • timeout - Connection timeout in seconds.
    • allowRedirects - Whether to follow redirects or not
    • maxRedirects - Max number of redirects to follow

Redefinition of:
Horde_RPC::request()
Builds an RPC request and sends it to the RPC server.
_objectsToArrays (line 229)

Converts stdClass object to associative arrays.

  • return: stdClass objects are returned as asscociative arrays, scalars as-is, and arrays with their elements converted.
mixed _objectsToArrays ($data $data)
  • $data $data: mixed Any stdClass object, array, or scalar.
_raiseError (line 116)

Returns a specially crafted PEAR_Error object containing a JSON-RPC response in the error message.

  • return: An error object suitable for a JSON-RPC 1.1 conform error result.
PEAR_Error _raiseError (string|PEAR_Error $error, stdClass $request)
  • string|PEAR_Error $error: The error message or object.
  • stdClass $request: The original request object.

Inherited Methods

Inherited From Horde_RPC

 Horde_RPC::Horde_RPC()
 Horde_RPC::authorize()
 Horde_RPC::factory()
 Horde_RPC::getInput()
 Horde_RPC::getResponse()
 Horde_RPC::getResponseContentType()
 Horde_RPC::request()

Documentation generated on Sun, 30 Jan 2011 05:18:41 +0000 by phpDocumentor 1.4.3