xmlrpc_server Class Reference

List of all members.

Public Member Functions

 xmlrpc_server ($dispMap=null, $serviceNow=true)
 setDebug ($in)
 serializeDebug ($charset_encoding='')
 service ($data=null, $return_payload=false)
 add_to_map ($methodname, $function, $sig=null, $doc='')
 verifySignature ($in, $sig)
 parseRequestHeaders (&$data, &$req_encoding, &$resp_encoding, &$resp_compression)
 parseRequest ($data, $req_encoding='')
 execute ($m, $params=null, $paramtypes=null)
 debugmsg ($string)
 xml_header ($charset_encoding='')
 echoInput ()

Public Attributes

 $dmap = array()
 array defining php functions exposed as xmlrpc methods by this server
 $functions_parameters_type = 'xmlrpcvals'
 $debug = 1
 controls wether the server is going to echo debugging messages back to the client as comments in response body. valid values: 0,1,2,3
 $compress_response = false
 $accepted_compression = array()
 $allow_system_funcs = true
 shall we serve calls to system.* methods?
 $accepted_charset_encodings = array()
 list of charset encodings natively accepted for requests
 $response_charset_encoding = ''
 $debug_info = ''
 storage for internal debug info
 $user_data = null
 extra data passed at runtime to method handling functions. Used only by EPI layer


Detailed Description

Definition at line 434 of file xmlrpcs.inc.php.


Member Function Documentation

xmlrpc_server::xmlrpc_server ( dispMap = null,
serviceNow = true 
)

Parameters:
array $dispmap the dispatch map withd efinition of exposed services
boolean $servicenow set to false to prevent the server from runnung upon construction

Definition at line 479 of file xmlrpcs.inc.php.

References service().

xmlrpc_server::setDebug ( in  ) 

Set debug level of server.

Parameters:
integer $in debug lvl: determines info added to xmlrpc responses (as xml comments) 0 = no debug info, 1 = msgs set from user with debugmsg(), 2 = add complete xmlrpc request (headers and body), 3 = add also all processing warnings happened during method processing (NB: this involves setting a custom error handler, and might interfere with the standard processing of the php function exposed as method. In particular, triggering an USER_ERROR level error will not halt script execution anymore, but just end up logged in the xmlrpc response) Note that info added at elevel 2 and 3 will be base64 encoded public

Definition at line 525 of file xmlrpcs.inc.php.

References debug().

xmlrpc_server::serializeDebug ( charset_encoding = ''  ) 

Return a string with the serialized representation of all debug info

Parameters:
string $charset_encoding the target charset encoding for the serialization
Returns:
string an XML comment (or two)

Definition at line 535 of file xmlrpcs.inc.php.

References $GLOBALS, and xmlrpc_encode_entitites().

Referenced by service().

xmlrpc_server::service ( data = null,
return_payload = false 
)

Execute the xmlrpc request, printing the response

Parameters:
string $data the request body. If null, the http POST request will be examined
Returns:
xmlrpcresp the response object (usually not used by caller...) public

Definition at line 564 of file xmlrpcs.inc.php.

References $GLOBALS, debug(), debugmsg(), parseRequest(), parseRequestHeaders(), serializeDebug(), and xml_header().

Referenced by xmlrpc_server().

xmlrpc_server::add_to_map ( methodname,
function,
sig = null,
doc = '' 
)

Add a method to the dispatch map

Parameters:
string $methodname the name with which the method will be made available
string $function the php function that will get invoked
array $sig the array of valid method signatures
string $doc method documentation public

Definition at line 671 of file xmlrpcs.inc.php.

xmlrpc_server::verifySignature ( in,
sig 
)

Verify type and number of parameters received against a list of known signatures

Parameters:
array $in array of either xmlrpcval objects or xmlrpc type definitions
array $sig array of known signatures to match against private

Definition at line 689 of file xmlrpcs.inc.php.

References $GLOBALS.

Referenced by execute().

xmlrpc_server::parseRequestHeaders ( &$  data,
&$  req_encoding,
&$  resp_encoding,
&$  resp_compression 
)

Parse http headers received along with xmlrpc request. If needed, inflate request

Returns:
null on success or an xmlrpcresp private

Todo:
we should parse q=0.x preferences instead of getting first charset specified...

Todo:
check if mbstring is enabled and automagic input conversion is on: it might mingle with this check???

Definition at line 755 of file xmlrpcs.inc.php.

References $GLOBALS, debug(), and debugmsg().

Referenced by service().

xmlrpc_server::parseRequest ( data,
req_encoding = '' 
)

Parse an xml chunk containing an xmlrpc request and execute the corresponding php function registered with the server

Parameters:
string $data the xml request
string $req_encoding (optional) the charset encoding of the xml request
Returns:
xmlrpcresp private

this will fail on PHP 5 if charset is not specified in the xml prologue,

Definition at line 878 of file xmlrpcs.inc.php.

References $GLOBALS, debug(), debugmsg(), and execute().

Referenced by service().

xmlrpc_server::execute ( m,
params = null,
paramtypes = null 
)

Execute a method invoked by the client, checking parameters used

Parameters:
mixed $m either an xmlrpcmsg obj or a method name
array $params array with method parameters as php types (if m is method name only)
array $paramtypes array with xmlrpc types of method parameters (if m is method name only)
Returns:
xmlrpcresp private

Definition at line 989 of file xmlrpcs.inc.php.

References $dmap, $GLOBALS, debug(), and verifySignature().

Referenced by parseRequest().

xmlrpc_server::debugmsg ( string  ) 

add a string to the 'internal debug message' (separate from 'user debug message')

Parameters:
string $strings private

Definition at line 1144 of file xmlrpcs.inc.php.

Referenced by parseRequest(), parseRequestHeaders(), and service().

xmlrpc_server::xml_header ( charset_encoding = ''  ) 

private

Definition at line 1152 of file xmlrpcs.inc.php.

Referenced by service().

xmlrpc_server::echoInput (  ) 

A debugging routine: just echoes back the input packet as a string value DEPRECATED!

Definition at line 1168 of file xmlrpcs.inc.php.

References $GLOBALS.


Member Data Documentation

xmlrpc_server::$dmap = array()

array defining php functions exposed as xmlrpc methods by this server

Definition at line 437 of file xmlrpcs.inc.php.

Referenced by execute().

xmlrpc_server::$functions_parameters_type = 'xmlrpcvals'

Defines how functions in dmap will be invokde: either using an xmlrpc msg object or plain php values. valid strings are 'xmlrpcvals', 'phpvals' or 'epivals'

Definition at line 443 of file xmlrpcs.inc.php.

xmlrpc_server::$debug = 1

controls wether the server is going to echo debugging messages back to the client as comments in response body. valid values: 0,1,2,3

Definition at line 445 of file xmlrpcs.inc.php.

xmlrpc_server::$compress_response = false

When set to true, it will enable HTTP compression of the response, in case the client has declared its support for compression in the request.

Definition at line 450 of file xmlrpcs.inc.php.

xmlrpc_server::$accepted_compression = array()

List of http compression methods accepted by the server for requests. NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib

Definition at line 455 of file xmlrpcs.inc.php.

xmlrpc_server::$allow_system_funcs = true

shall we serve calls to system.* methods?

Definition at line 457 of file xmlrpcs.inc.php.

xmlrpc_server::$accepted_charset_encodings = array()

list of charset encodings natively accepted for requests

Definition at line 459 of file xmlrpcs.inc.php.

xmlrpc_server::$response_charset_encoding = ''

charset encoding to be used for response. NB: if we can, we will convert the generated response from internal_encoding to the intended one. can be: a supported xml encoding (only UTF-8 and ISO-8859-1 at present, unless mbstring is enabled), null (leave unspecified in response, convert output stream to US_ASCII), 'default' (use xmlrpc library default as specified in xmlrpc.inc, convert output stream if needed), or 'auto' (use client-specified charset encoding or same as request if request headers do not specify it (unless request is US-ASCII: then use library default anyway). NB: pretty dangerous if you accept every charset and do not have mbstring enabled)

Definition at line 469 of file xmlrpcs.inc.php.

xmlrpc_server::$debug_info = ''

storage for internal debug info

Definition at line 471 of file xmlrpcs.inc.php.

xmlrpc_server::$user_data = null

extra data passed at runtime to method handling functions. Used only by EPI layer

Definition at line 473 of file xmlrpcs.inc.php.


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



Generated on Wed Jun 25 17:26:03 2008 by  doxygen 1.5.5