Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_XmlRpc_Server Class Reference

Public Member Functions

 __construct ()
 Constructor.
 
 __call ($method, $params)
 Proxy calls to system object.
 
 addFunction ($function, $namespace= '')
 Attach a callback as an XMLRPC method.
 
 setClass ($class, $namespace= '', $argv=null)
 Attach class methods as XMLRPC method handlers.
 
 fault ($fault=null, $code=404)
 Raise an xmlrpc server fault.
 
 handle ($request=false)
 Handle an xmlrpc call.
 
 loadFunctions ($definition)
 Load methods as returned from getFunctions.
 
 setEncoding ($encoding)
 Set encoding.
 
 getEncoding ()
 Retrieve current encoding.
 
 setPersistence ($mode)
 Do nothing; persistence is handled via Zend_XmlRpc_Server_Cache.
 
 setRequest ($request)
 Set the request object.
 
 getRequest ()
 Return currently registered request object.
 
 setResponseClass ($class)
 Set the class to use for the response.
 
 getResponseClass ()
 Retrieve current response class.
 
 getDispatchTable ()
 Retrieve dispatch table.
 
 getFunctions ()
 Returns a list of registered methods.
 
 getSystem ()
 Retrieve system object.
 
 sendArgumentsToAllMethods ($flag=null)
 Send arguments to all methods?
 
- Public Member Functions inherited from Zend_Server_Abstract
 __construct ()
 Constructor.
 
 getFunctions ()
 Returns a list of registered methods.
 

Protected Member Functions

 _fixType ($type)
 Map PHP type to XML-RPC type.
 
 _handle (Zend_XmlRpc_Request $request)
 Handle an xmlrpc call (actual work)
 
 _registerSystemMethods ()
 Register system methods with the server.
 
- Protected Member Functions inherited from Zend_Server_Abstract
 _buildCallback (Zend_Server_Reflection_Function_Abstract $reflection)
 Build callback for method signature.
 
 _buildSignature (Zend_Server_Reflection_Function_Abstract $reflection, $class=null)
 Build a method signature.
 
 _dispatch (Zend_Server_Method_Definition $invocable, array $params)
 Dispatch method.
 
 _fixType ($type)
 Map PHP type to protocol type.
 

Protected Attributes

 $_encoding = 'UTF-8'
 
 $_request = null
 
 $_responseClass = 'Zend_XmlRpc_Response_Http'
 
 $_table
 
 $_typeMap
 
 $_sendArgumentsToAllMethods = true
 
- Protected Attributes inherited from Zend_Server_Abstract
 $_overwriteExistingMethods = false
 
 $_table
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Server_Abstract
static lowerCase (&$value, &$key)
 Lowercase a string.
 
- Static Protected Attributes inherited from Zend_Server_Abstract
static $magic_methods
 

Constructor & Destructor Documentation

__construct ( )

Constructor.

Creates system.* methods.

Returns
void

Member Function Documentation

__call (   $method,
  $params 
)

Proxy calls to system object.

Parameters
string$method
array$params
Returns
mixed
Exceptions
Zend_XmlRpc_Server_Exception
_fixType (   $type)
protected

Map PHP type to XML-RPC type.

Parameters
string$type
Returns
string
_handle ( Zend_XmlRpc_Request  $request)
protected

Handle an xmlrpc call (actual work)

Parameters
Zend_XmlRpc_Request$request
Returns
Zend_XmlRpc_Response
Exceptions
Zend_XmlRpcServer_Exception|ExceptionZend_XmlRpcServer_Exceptions are thrown for internal errors; otherwise, any other exception may be thrown by the callback
_registerSystemMethods ( )
protected

Register system methods with the server.

Returns
void
addFunction (   $function,
  $namespace = '' 
)

Attach a callback as an XMLRPC method.

Attaches a callback as an XMLRPC method, prefixing the XMLRPC method name with $namespace, if provided. Reflection is done on the callback's docblock to create the methodHelp for the XMLRPC method.

Additional arguments to pass to the function at dispatch may be passed; any arguments following the namespace will be aggregated and passed at dispatch time.

Parameters
string | array$functionValid callback
string$namespaceOptional namespace prefix
Returns
void
Exceptions
Zend_XmlRpc_Server_Exception

Implements Zend_Server_Interface.

fault (   $fault = null,
  $code = 404 
)

Raise an xmlrpc server fault.

Parameters
string | Exception$fault
int$code
Returns
Zend_XmlRpc_Server_Fault

Implements Zend_Server_Interface.

getDispatchTable ( )

Retrieve dispatch table.

Returns
array
getEncoding ( )

Retrieve current encoding.

Returns
string
getFunctions ( )

Returns a list of registered methods.

Returns an array of dispatchables (Zend_Server_Reflection_Function, _Method, and _Class items).

Returns
array

Implements Zend_Server_Interface.

getRequest ( )

Return currently registered request object.

Returns
null|Zend_XmlRpc_Request
getResponseClass ( )

Retrieve current response class.

Returns
string
getSystem ( )

Retrieve system object.

Returns
Zend_XmlRpc_Server_System
handle (   $request = false)

Handle an xmlrpc call.

Parameters
Zend_XmlRpc_Request$requestOptional
Returns
Zend_XmlRpc_Response|Zend_XmlRpc_Fault

Implements Zend_Server_Interface.

loadFunctions (   $definition)

Load methods as returned from getFunctions.

Typically, you will not use this method; it will be called using the results pulled from Zend_XmlRpc_Server_Cache::get().

Parameters
array | Zend_Server_Definition$definition
Returns
void
Exceptions
Zend_XmlRpc_Server_Exceptionon invalid input

Implements Zend_Server_Interface.

sendArgumentsToAllMethods (   $flag = null)

Send arguments to all methods?

If setClass() is used to add classes to the server, this flag defined how to handle arguments. If set to true, all methods including constructor will receive the arguments. If set to false, only constructor will receive the arguments

setClass (   $class,
  $namespace = '',
  $argv = null 
)

Attach class methods as XMLRPC method handlers.

$class may be either a class name or an object. Reflection is done on the class or object to determine the available public methods, and each is attached to the server as an available method; if a $namespace has been provided, that namespace is used to prefix the XMLRPC method names.

Any additional arguments beyond $namespace will be passed to a method at invocation.

Parameters
string | object$class
string$namespaceOptional
mixed$argvOptional arguments to pass to methods
Returns
void
Exceptions
Zend_XmlRpc_Server_Exceptionon invalid input

Implements Zend_Server_Interface.

setEncoding (   $encoding)

Set encoding.

Parameters
string$encoding
Returns
Zend_XmlRpc_Server
setPersistence (   $mode)

Do nothing; persistence is handled via Zend_XmlRpc_Server_Cache.

Parameters
mixed$mode
Returns
void

Implements Zend_Server_Interface.

setRequest (   $request)

Set the request object.

Parameters
string | Zend_XmlRpc_Request$request
Returns
Zend_XmlRpc_Server
Exceptions
Zend_XmlRpc_Server_Exceptionon invalid request class or object
setResponseClass (   $class)

Set the class to use for the response.

Parameters
string$class
Returns
boolean True if class was set, false if not

Member Data Documentation

$_encoding = 'UTF-8'
protected
$_request = null
protected
$_responseClass = 'Zend_XmlRpc_Response_Http'
protected
$_sendArgumentsToAllMethods = true
protected
$_table
protected
$_typeMap
protected