Class Horde_RPC

Description

The Horde_RPC:: class provides a set of server and client methods for RPC communication.

TODO:

  • Introspection documentation and method signatures.
EXAMPLE:
  1.  $response Horde_RPC::request('xmlrpc',
  2.                                 'http://localhost:80/horde/rpc.php',
  3.                                 'contacts.search',
  4.                                 array(array('jan')array('localsql'),
  5.                                       array('name''email')),
  6.                                 array('user' => Auth::getAuth(),
  7.                                       'pass' => Auth::getCredential('password')));

$Horde: framework/RPC/RPC.php,v 1.7.10.18 2009/06/16 15:28:04 jan Exp $

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

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


	
			
Direct descendents
Class Description
 class Horde_RPC_PhpSoap The Horde_RPC_PhpSoap class provides a PHP 5 Soap implementation of the Horde RPC system.
 class Horde_RPC_jsonrpc The Horde_RPC_json-rpc class provides a JSON-RPC 1.1 implementation of the Horde RPC system.
 class Horde_RPC_phpgw The Horde_RPC_phpgw class provides an XMLRPC implementation of the Horde RPC system compatible with phpgw. It is based on the xmlrpc.php implementation by Jan Schneider.
 class Horde_RPC_soap The Horde_RPC_soap class provides an SOAP implementation of the Horde RPC system.
 class Horde_RPC_syncml The Horde_RPC_syncml class provides a SyncML implementation of the Horde RPC system.
 class Horde_RPC_webdav The Horde_RPC_webdav class provides a WebDAV implementation of the Horde RPC system.
 class Horde_RPC_xmlrpc The Horde_RPC_xmlrpc class provides an XMLRPC implementation of the Horde RPC system.
Variable Summary
Method Summary
 Horde_RPC Horde_RPC ([ $params = array()], array $config)
 boolean authorize ()
 Horde_RPC factory (mixed $driver, [array $params = null])
 mixed getInput ()
 string getResponse (string $request)
 mixed request (string $driver, string $url, string $method, [array $params = null], [$options $options = array()])
Variables
array $_params = array() (line 38)

All driver-specific parameters.

boolean $_requestMissingAuthorization = true (line 53)

Whether we should exit if auth fails instead of requesting authorization credentials.

boolean $_requireAuthorization = true (line 45)

Do we need an authenticated user?

Methods
Constructor Horde_RPC (line 63)

RPC server constructor.

  • return: An RPC server instance.
Horde_RPC Horde_RPC ([ $params = array()], array $config)
  • array $config: A hash containing any additional configuration or connection parameters a subclass might need.
  • $params
authorize (line 85)

Check authentication. Different backends may handle authentication in different ways. The base class implementation checks for HTTP Authentication against the Horde auth setup.

  • return: 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.
boolean authorize ()

Redefined in descendants as:
factory (line 206)

Attempts to return a concrete RPC server instance based on $driver.

  • return: The newly created concrete Horde_RPC server instance, or PEAR_Error on error.
Horde_RPC factory (mixed $driver, [array $params = null])
  • mixed $driver: The type of concrete RPC subclass to return. If $driver is an array, then we will look in $driver[0]/lib/RPC/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
getInput (line 128)

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.

  • return: The input - a string (default), a filehandle, etc.
mixed getInput ()

Redefined in descendants as:
getResponse (line 144)

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

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

Redefined in descendants as:
getResponseContentType (line 154)

Returns the Content-Type of the response.

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

Redefined in descendants as:
request (line 176)

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

This statically called method is actually the RPC client.

  • return: The returned result from the method or a PEAR error object on failure.
mixed request (string $driver, string $url, string $method, [array $params = null], [$options $options = array()])
  • string $driver: The protocol driver to use. Currently 'soap', 'xmlrpc' and 'jsonrpc' are available.
  • string $url: The path to the 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: Associative array of parameters depending on the selected protocol driver.

Redefined in descendants as:

Documentation generated on Sun, 30 Jan 2011 05:21:02 +0000 by phpDocumentor 1.4.3