Open Monograph Press  3.3.0
PhpXmlRpc\Server Class Reference

Public Member Functions

 __construct ($dispatchMap=null, $serviceNow=true)
 
 add_to_map ($methodName, $function, $sig=null, $doc=false, $sigDoc=false)
 
 getCapabilities ()
 
 getSystemDispatchMap ()
 
 parseRequest ($data, $reqEncoding='')
 
 serializeDebug ($charsetEncoding='')
 
 service ($data=null, $returnPayload=false)
 
 setDebug ($level)
 

Static Public Member Functions

static _xmlrpcs_errorHandler ($errCode, $errString, $filename=null, $lineNo=null, $context=null)
 
static _xmlrpcs_getCapabilities ($server, $req=null)
 
static _xmlrpcs_listMethods ($server, $req=null)
 
static _xmlrpcs_methodHelp ($server, $req)
 
static _xmlrpcs_methodSignature ($server, $req)
 
static _xmlrpcs_multicall ($server, $req)
 
static _xmlrpcs_multicall_do_call ($server, $call)
 
static _xmlrpcs_multicall_do_call_phpvals ($server, $call)
 
static _xmlrpcs_multicall_error ($err)
 
static error_occurred ($msg)
 
static xmlrpc_debugmsg ($msg)
 

Data Fields

 $accepted_charset_encodings = array()
 
 $accepted_compression = array()
 
 $allow_system_funcs = true
 
 $compress_response = false
 
 $debug = 1
 
 $exception_handling = 0
 
 $functions_parameters_type = 'xmlrpcvals'
 
 $phpvals_encoding_options = array('auto_dates')
 
 $response_charset_encoding = ''
 
 $user_data = null
 

Protected Member Functions

 debugmsg ($string)
 
 execute ($req, $params=null, $paramTypes=null)
 
 parseRequestHeaders (&$data, &$reqEncoding, &$respEncoding, &$respCompression)
 
 verifySignature ($in, $sigs)
 
 xml_header ($charsetEncoding='')
 

Protected Attributes

 $debug_info = ''
 
 $dmap = array()
 

Static Protected Attributes

static $_xmlrpc_debuginfo = ''
 
static $_xmlrpcs_occurred_errors = ''
 
static $_xmlrpcs_prev_ehandler = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

PhpXmlRpc\Server::__construct (   $dispatchMap = null,
  $serviceNow = true 
)
Parameters
array$dispatchMapthe dispatch map with definition of exposed services
boolean$serviceNowset to false to prevent the server from running upon construction

Definition at line 85 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

Member Function Documentation

◆ _xmlrpcs_errorHandler()

static PhpXmlRpc\Server::_xmlrpcs_errorHandler (   $errCode,
  $errString,
  $filename = null,
  $lineNo = null,
  $context = null 
)
static

Error handler used to track errors that occur during server-side execution of PHP code. This allows to report back to the client whether an internal error has occurred or not using an xmlrpc response object, instead of letting the client deal with the html junk that a PHP execution error on the server generally entails.

NB: in fact a user defined error handler can only handle WARNING, NOTICE and USER_* errors.

Definition at line 1022 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

References PhpXmlRpc\Server\error_occurred().

◆ _xmlrpcs_getCapabilities()

static PhpXmlRpc\Server::_xmlrpcs_getCapabilities (   $server,
  $req = null 
)
static

◆ _xmlrpcs_listMethods()

static PhpXmlRpc\Server::_xmlrpcs_listMethods (   $server,
  $req = null 
)
static

◆ _xmlrpcs_methodHelp()

static PhpXmlRpc\Server::_xmlrpcs_methodHelp (   $server,
  $req 
)
static

◆ _xmlrpcs_methodSignature()

static PhpXmlRpc\Server::_xmlrpcs_methodSignature (   $server,
  $req 
)
static

◆ _xmlrpcs_multicall()

static PhpXmlRpc\Server::_xmlrpcs_multicall (   $server,
  $req 
)
static

◆ _xmlrpcs_multicall_do_call()

static PhpXmlRpc\Server::_xmlrpcs_multicall_do_call (   $server,
  $call 
)
static

◆ _xmlrpcs_multicall_do_call_phpvals()

static PhpXmlRpc\Server::_xmlrpcs_multicall_do_call_phpvals (   $server,
  $call 
)
static

◆ _xmlrpcs_multicall_error()

static PhpXmlRpc\Server::_xmlrpcs_multicall_error (   $err)
static

◆ add_to_map()

PhpXmlRpc\Server::add_to_map (   $methodName,
  $function,
  $sig = null,
  $doc = false,
  $sigDoc = false 
)

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
array$sigDocthe array of valid method signatures docs (one string per param, one for return type)

Definition at line 282 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ debugmsg()

PhpXmlRpc\Server::debugmsg (   $string)
protected

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

Parameters
string$string

Definition at line 716 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ error_occurred()

static PhpXmlRpc\Server::error_occurred (   $msg)
static

◆ execute()

PhpXmlRpc\Server::execute (   $req,
  $params = null,
  $paramTypes = null 
)
protected

Execute a method invoked by the client, checking parameters used.

Parameters
mixed$reqeither a Request 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
Response
Exceptions

Definition at line 556 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ getCapabilities()

PhpXmlRpc\Server::getCapabilities ( )
Returns
array

Definition at line 780 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ getSystemDispatchMap()

PhpXmlRpc\Server::getSystemDispatchMap ( )
Returns
array

Definition at line 739 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ parseRequest()

PhpXmlRpc\Server::parseRequest (   $data,
  $reqEncoding = '' 
)

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

Parameters
string$datathe xml request
string$reqEncoding(optional) the charset encoding of the xml request
Returns
Response
Exceptions

Definition at line 456 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ parseRequestHeaders()

PhpXmlRpc\Server::parseRequestHeaders ( $data,
$reqEncoding,
$respEncoding,
$respCompression 
)
protected

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

Returns
mixed Response|null on success or an error Response

Definition at line 353 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ serializeDebug()

PhpXmlRpc\Server::serializeDebug (   $charsetEncoding = '')

Return a string with the serialized representation of all debug info.

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

Definition at line 156 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ service()

PhpXmlRpc\Server::service (   $data = null,
  $returnPayload = false 
)

Execute the xmlrpc request, printing the response.

Parameters
string$datathe request body. If null, the http POST request will be examined
bool$returnPayloadWhen true, return the response but do not echo it or any http header
Returns
Response|string the response object (usually not used by caller...) or its xml serialization
Exceptions

Definition at line 187 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ setDebug()

PhpXmlRpc\Server::setDebug (   $level)

Set debug level of server.

Parameters
integer$leveldebug 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 level 2 and 3 will be base64 encoded

Definition at line 125 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ verifySignature()

PhpXmlRpc\Server::verifySignature (   $in,
  $sigs 
)
protected

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

Parameters
array | Request$inarray of either xmlrpc value objects or xmlrpc type definitions
array$sigsarray of known signatures to match against
Returns
array

Definition at line 304 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ xml_header()

PhpXmlRpc\Server::xml_header (   $charsetEncoding = '')
protected
Parameters
string$charsetEncoding
Returns
string

Definition at line 725 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ xmlrpc_debugmsg()

static PhpXmlRpc\Server::xmlrpc_debugmsg (   $msg)
static

Add a string to the debug info that can be later serialized by the server as part of the response message. Note that for best compatibility, the debug string should be encoded using the PhpXmlRpc::$xmlrpc_internalencoding character set.

Parameters
string$msg@access public

Definition at line 139 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

Field Documentation

◆ $_xmlrpc_debuginfo

PhpXmlRpc\Server::$_xmlrpc_debuginfo = ''
staticprotected

◆ $_xmlrpcs_occurred_errors

PhpXmlRpc\Server::$_xmlrpcs_occurred_errors = ''
staticprotected

◆ $_xmlrpcs_prev_ehandler

PhpXmlRpc\Server::$_xmlrpcs_prev_ehandler = ''
staticprotected

◆ $accepted_charset_encodings

PhpXmlRpc\Server::$accepted_charset_encodings = array()

List of charset encodings natively accepted for requests. Set at constructor time. UNUSED so far...

Definition at line 57 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $accepted_compression

PhpXmlRpc\Server::$accepted_compression = array()

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

Definition at line 49 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $allow_system_funcs

PhpXmlRpc\Server::$allow_system_funcs = true

shall we serve calls to system.* methods?

Definition at line 51 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $compress_response

PhpXmlRpc\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. Set at constructor time.

Definition at line 44 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $debug

PhpXmlRpc\Server::$debug = 1

Controls whether 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 31 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $debug_info

PhpXmlRpc\Server::$debug_info = ''
protected

Storage for internal debug info.

Definition at line 71 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $dmap

PhpXmlRpc\Server::$dmap = array()
protected

Array defining php functions exposed as xmlrpc methods by this server.

Definition at line 13 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $exception_handling

PhpXmlRpc\Server::$exception_handling = 0

Controls behaviour of server when the invoked user function throws an exception: 0 = catch it and return an 'internal error' xmlrpc response (default) 1 = catch it and return an xmlrpc response with the error corresponding to the exception 2 = allow the exception to float to the upper layers

Definition at line 38 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $functions_parameters_type

PhpXmlRpc\Server::$functions_parameters_type = 'xmlrpcvals'

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

Definition at line 19 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $phpvals_encoding_options

PhpXmlRpc\Server::$phpvals_encoding_options = array('auto_dates')

Option used for fine-tuning the encoding the php values returned from functions registered in the dispatch map when the functions_parameters_types member is set to 'phpvals'

See also
Encoder::encode for a list of values

Definition at line 26 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $response_charset_encoding

PhpXmlRpc\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 67 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.

◆ $user_data

PhpXmlRpc\Server::$user_data = null

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

Definition at line 75 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Server.php.


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