Documentation

xmlrpc_server
in package

Table of Contents

Properties

$accepted_charset_encodings  : mixed
$accepted_compression  : mixed
List of http compression methods accepted by the server for requests.
$allow_system_funcs  : mixed
$compress_response  : mixed
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.
$debug  : mixed
$debug_info  : mixed
$dmap  : mixed
$functions_parameters_type  : mixed
Defines how functions in dmap will be invokde: either using an xmlrpc msg object or plain php values.
$response_charset_encoding  : mixed
charset encoding to be used for response.
$user_data  : mixed

Methods

__construct()  : mixed
add_to_map()  : mixed
Add a method to the dispatch map
debugmsg()  : mixed
add a string to the 'internal debug message' (separate from 'user debug message')
echoInput()  : mixed
A debugging routine: just echoes back the input packet as a string value DEPRECATED!
execute()  : xmlrpcresp
Execute a method invoked by the client, checking parameters used
parseRequest()  : xmlrpcresp
Parse an xml chunk containing an xmlrpc request and execute the corresponding php function registered with the server
parseRequestHeaders()  : null
Parse http headers received along with xmlrpc request. If needed, inflate request
serializeDebug()  : string
Return a string with the serialized representation of all debug info
service()  : xmlrpcresp
Execute the xmlrpc request, printing the response
setDebug()  : mixed
Set debug level of server.
verifySignature()  : mixed
Verify type and number of parameters received against a list of known signatures
xml_header()  : mixed

Properties

$accepted_charset_encodings

public mixed $accepted_charset_encodings = array()

$accepted_compression

List of http compression methods accepted by the server for requests.

public mixed $accepted_compression = array()

NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib

$allow_system_funcs

public mixed $allow_system_funcs = \true

$compress_response

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.

public mixed $compress_response = \false

$debug_info

public mixed $debug_info = ''

$functions_parameters_type

Defines how functions in dmap will be invokde: either using an xmlrpc msg object or plain php values.

public mixed $functions_parameters_type = 'xmlrpcvals'

valid strings are 'xmlrpcvals', 'phpvals' or 'epivals'

$response_charset_encoding

charset encoding to be used for response.

public mixed $response_charset_encoding = ''

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)

$user_data

public mixed $user_data = \null

Methods

__construct()

public __construct([mixed $dispMap = null ][, mixed $serviceNow = true ]) : mixed
Parameters
$dispMap : mixed = null
$serviceNow : mixed = true

add_to_map()

Add a method to the dispatch map

public add_to_map(string $methodname, string $function[, array<string|int, mixed> $sig = null ][, string $doc = '' ]) : mixed
Parameters
$methodname : string

the name with which the method will be made available

$function : string

the php function that will get invoked

$sig : array<string|int, mixed> = null

the array of valid method signatures

$doc : string = ''

method documentation

Tags
access

public

debugmsg()

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

public debugmsg(mixed $string) : mixed
Parameters
$string : mixed
Tags
access

private

echoInput()

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

public echoInput() : mixed

execute()

Execute a method invoked by the client, checking parameters used

public execute(mixed $m[, array<string|int, mixed> $params = null ][, array<string|int, mixed> $paramtypes = null ]) : xmlrpcresp
Parameters
$m : mixed

either an xmlrpcmsg obj or a method name

$params : array<string|int, mixed> = null

array with method parameters as php types (if m is method name only)

$paramtypes : array<string|int, mixed> = null

array with xmlrpc types of method parameters (if m is method name only)

Tags
access

private

Return values
xmlrpcresp

parseRequest()

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

public parseRequest(string $data[, string $req_encoding = '' ]) : xmlrpcresp
Parameters
$data : string

the xml request

$req_encoding : string = ''

(optional) the charset encoding of the xml request

Tags
access

private

Return values
xmlrpcresp

parseRequestHeaders()

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

public parseRequestHeaders(mixed &$data, mixed &$req_encoding, mixed &$resp_encoding, mixed &$resp_compression) : null
Parameters
$data : mixed
$req_encoding : mixed
$resp_encoding : mixed
$resp_compression : mixed
Tags
access

private

Return values
null

on success or an xmlrpcresp

serializeDebug()

Return a string with the serialized representation of all debug info

public serializeDebug([string $charset_encoding = '' ]) : string
Parameters
$charset_encoding : string = ''

the target charset encoding for the serialization

Return values
string

an XML comment (or two)

service()

Execute the xmlrpc request, printing the response

public service([string $data = null ][, mixed $return_payload = false ]) : xmlrpcresp
Parameters
$data : string = null

the request body. If null, the http POST request will be examined

$return_payload : mixed = false
Tags
access

public

Return values
xmlrpcresp

the response object (usually not used by caller...)

setDebug()

Set debug level of server.

public setDebug(int $in) : mixed
Parameters
$in : int

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

Tags
access

public

verifySignature()

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

public verifySignature(array<string|int, mixed> $in, array<string|int, mixed> $sig) : mixed
Parameters
$in : array<string|int, mixed>

array of either xmlrpcval objects or xmlrpc type definitions

$sig : array<string|int, mixed>

array of known signatures to match against

Tags
access

private

xml_header()

public xml_header([mixed $charset_encoding = '' ]) : mixed
Parameters
$charset_encoding : mixed = ''
Tags
access

private


        
On this page

Search results