XRL  latest
Simple XML-RPC Library (both client and server)
fpoirotte\XRL\CapableServer Class Reference

A class that adds various capabilities to an existing XML-RPC server. More...

Public Member Functions

 getCapabilities ()
 
 listMethods ()
 
 methodHelp ($method)
 
 methodSignature ($method)
 
 multicall (array $requests)
 

Static Public Member Functions

static enable (\fpoirotte\XRL\Server $server, array $whitelist=null)
 

Protected Member Functions

 __construct (\fpoirotte\XRL\Server $server, array $whitelist=null)
 

Static Protected Member Functions

static adaptType ($type)
 
static extractTypes ($doc)
 

Protected Attributes

 $server
 Original XML-RPC server.
 
 $whitelist
 Whitelist of XML-RPC methods to announce.
 

Detailed Description

A class that adds various capabilities to an existing XML-RPC server.

See also
http://scripts.incutio.com/xmlrpc/introspection.html for documentation on introspection-related capabilities.
http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php for documentation on interoperability faults.
Authors
François Poirotte click.nosp@m.y@er.nosp@m.ebot..nosp@m.net

Definition at line 29 of file CapableServer.php.

Constructor & Destructor Documentation

fpoirotte\XRL\CapableServer::__construct ( \fpoirotte\XRL\Server  $server,
array  $whitelist = null 
)
protected

Wrap an XML-RPC server to add capabilities support.

Parameters
fpoirotte::XRL::Server$serverServer to wrap.
array$whitelist(optional) Whitelist of methods that can be announced by the newly upgraded server. Pass an empty array to disable announces. By default, all methods are announced.

Definition at line 49 of file CapableServer.php.

References fpoirotte\XRL\CapableServer\$server, and fpoirotte\XRL\CapableServer\$whitelist.

Member Function Documentation

static fpoirotte\XRL\CapableServer::adaptType (   $type)
staticprotected

Return XML-RPC type that comes the closest to some type used in documentation comments.

Parameters
string$typeA type used in a documentation comment.
Return values
stringThe closest XML-RPC, or null if none could be derived.

Definition at line 159 of file CapableServer.php.

static fpoirotte\XRL\CapableServer::enable ( \fpoirotte\XRL\Server  $server,
array  $whitelist = null 
)
static

Turn a regular XML-RPC server into one that supports various XML-RPC capabilities.

Parameters
fpoirotte::XRL::Server$serverAn XML-RPC to upgrade.
array$whitelist(optional) Whitelist of methods that can be announced by the newly upgraded server. Pass an empty array to disable announces. By default, all methods are announced.
Return values
fpoirotte::XRL::ServerThe upgraded server.
Examples:
server.php.

Definition at line 71 of file CapableServer.php.

References fpoirotte\XRL\CapableServer\$server, and fpoirotte\XRL\CapableServer\$whitelist.

static fpoirotte\XRL\CapableServer::extractTypes (   $doc)
staticprotected

Extract parameter and return type information from a documentation comment.

Parameters
string$docDocumentation comment the types will be extracted from.
Return values
arrayArray with type information. The "retval" key contains information about the return type, while the array in the "params" key contains information about each parameter's type (indexed by its name).

Definition at line 92 of file CapableServer.php.

fpoirotte\XRL\CapableServer::getCapabilities ( )

Get the server's capabilities.

Return values
arrayArray of capabilities supported by this server. Each entry contains two keys:
  • specURL (URL to that capability's specification)
  • specVersion (version of the capability)

Definition at line 196 of file CapableServer.php.

fpoirotte\XRL\CapableServer::listMethods ( )

List the methods supported by the server.

Return values
arrayArray with the names of available methods.

Definition at line 222 of file CapableServer.php.

fpoirotte\XRL\CapableServer::methodHelp (   $method)

Get help about a procedure.

Parameters
string$methodName of the procedure.
Return values
stringHuman readable help message for the given procedure.

Definition at line 284 of file CapableServer.php.

fpoirotte\XRL\CapableServer::methodSignature (   $method)

Return possible signatures for a method.

Parameters
string$methodName of the method.
Return values
arrayAn array containing:
  • The return type of the method as its first value
  • The types for the method's parameters in the following values

Definition at line 242 of file CapableServer.php.

fpoirotte\XRL\CapableServer::multicall ( array  $requests)

Perform several calls to XML-RPC methods in a single go.

Parameters
array$requestsArray of requests, each described as a struct with the following information:
  • "methodName": name of the method to call
  • "params": array of parameters for the method
Return values
arrayArray of responses, one for each request, in the same order. Each response may be either a fault or an array with a single element (the call's result).
Note
Recursive calls to system.multicall are forbidden.

Definition at line 352 of file CapableServer.php.


The documentation for this class was generated from the following file: