Cheetah
Public Member Functions | Public Attributes | List of all members
xmlrpc_server Class Reference

Public Member Functions

 __construct ($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 More...
 
 $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 More...
 
 $compress_response = false
 
 $accepted_compression = array()
 
 $allow_system_funcs = true
 shall we serve calls to system.* methods? More...
 
 $accepted_charset_encodings = array()
 list of charset encodings natively accepted for requests More...
 
 $response_charset_encoding = ''
 
 $debug_info = ''
 storage for internal debug info More...
 
 $user_data = null
 extra data passed at runtime to method handling functions. Used only by EPI layer More...
 

Detailed Description

Definition at line 433 of file xmlrpcs.inc.

Constructor & Destructor Documentation

◆ __construct()

xmlrpc_server::__construct (   $dispMap = null,
  $serviceNow = true 
)
Parameters
array$dispmapthe dispatch map withd efinition of exposed services
boolean$servicenowset to false to prevent the server from runnung upon construction

Definition at line 478 of file xmlrpcs.inc.

Member Function Documentation

◆ add_to_map()

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

Add a method to the dispatch map

Parameters
string$methodnamethe name with which the method will be made available
string$functionthe php function that will get invoked
array$sigthe array of valid method signatures
string$docmethod documentation @access public

Definition at line 679 of file xmlrpcs.inc.

◆ debugmsg()

xmlrpc_server::debugmsg (   $string)

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

Parameters
string$strings@access private

Definition at line 1163 of file xmlrpcs.inc.

◆ echoInput()

xmlrpc_server::echoInput ( )

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

Definition at line 1187 of file xmlrpcs.inc.

◆ execute()

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

Execute a method invoked by the client, checking parameters used

Parameters
mixed$meither an xmlrpcmsg obj or a method name
array$paramsarray with method parameters as php types (if m is method name only)
array$paramtypesarray with xmlrpc types of method parameters (if m is method name only)
Returns
xmlrpcresp @access private

Definition at line 1008 of file xmlrpcs.inc.

◆ parseRequest()

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$datathe xml request
string$req_encoding(optional) the charset encoding of the xml request
Returns
xmlrpcresp @access private

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

Definition at line 886 of file xmlrpcs.inc.

◆ parseRequestHeaders()

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 @access private

Definition at line 763 of file xmlrpcs.inc.

◆ serializeDebug()

xmlrpc_server::serializeDebug (   $charset_encoding = '')

Return a string with the serialized representation of all debug info

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

Definition at line 534 of file xmlrpcs.inc.

◆ service()

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

Execute the xmlrpc request, printing the response

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

Definition at line 563 of file xmlrpcs.inc.

◆ setDebug()

xmlrpc_server::setDebug (   $in)

Set debug level of server.

Parameters
integer$indebug 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 @access public

Definition at line 524 of file xmlrpcs.inc.

◆ verifySignature()

xmlrpc_server::verifySignature (   $in,
  $sig 
)

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

Parameters
array$inarray of either xmlrpcval objects or xmlrpc type definitions
array$sigarray of known signatures to match against @access private

Definition at line 697 of file xmlrpcs.inc.

◆ xml_header()

xmlrpc_server::xml_header (   $charset_encoding = '')

@access private

Definition at line 1171 of file xmlrpcs.inc.

Member Data Documentation

◆ $accepted_charset_encodings

xmlrpc_server::$accepted_charset_encodings = array()

list of charset encodings natively accepted for requests

Definition at line 458 of file xmlrpcs.inc.

◆ $accepted_compression

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 454 of file xmlrpcs.inc.

◆ $allow_system_funcs

xmlrpc_server::$allow_system_funcs = true

shall we serve calls to system.* methods?

Definition at line 456 of file xmlrpcs.inc.

◆ $compress_response

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 449 of file xmlrpcs.inc.

◆ $debug

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 444 of file xmlrpcs.inc.

◆ $debug_info

xmlrpc_server::$debug_info = ''

storage for internal debug info

Definition at line 470 of file xmlrpcs.inc.

◆ $dmap

xmlrpc_server::$dmap =array()

array defining php functions exposed as xmlrpc methods by this server

Definition at line 436 of file xmlrpcs.inc.

◆ $functions_parameters_type

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 442 of file xmlrpcs.inc.

◆ $response_charset_encoding

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 468 of file xmlrpcs.inc.

◆ $user_data

xmlrpc_server::$user_data = null

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

Definition at line 472 of file xmlrpcs.inc.


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