Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
PhpXmlRpc\PhpXmlRpc Class Reference

Static Public Member Functions

static exportGlobals ()
 A function to be used for compatibility with legacy code: it creates all global variables which used to be declared, such as library version etc...
 
static importGlobals ()
 A function to be used for compatibility with legacy code: it gets the values of all global variables which used to be declared, such as library version etc... and sets them to php classes.
 
static setLogger ($logger)
 Inject a logger into all classes of the PhpXmlRpc library which use one.
 
static useInteropFaults ()
 Makes the library use the error codes detailed at https://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php.
 

Static Public Attributes

static int $xmlpc_double_precision = 128
 Number of decimal digits used to serialize Double values.
 
static string $xmlrpc_datetime_format = '/^([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9]|60)$/'
 Used to validate received date values.
 
static string $xmlrpc_defencoding = "UTF-8"
 The charset encoding used by the server for received requests and by the client for received responses when received charset cannot be determined and mbstring extension is not enabled.
 
static string[] $xmlrpc_detectencodings = array()
 The list of preferred encodings used by the server for requests and by the client for responses to detect the charset of the received payload when.
 
static string $xmlrpc_double_format = '/^[ t]*[-+]?[0-9]*::.?[0-9]+([eE][-+]?[0-9]+)?[ t]*$/'
 Used to validate received double values.
 
static string $xmlrpc_int_format = '/^[ t]*[+-]?[0-9]+[ t]*$/'
 Used to validate received integer values.
 
static string $xmlrpc_internalencoding = "UTF-8"
 The encoding used internally by PHP.
 
static string $xmlrpc_methodname_format = '|^[ t]*[a-zA-Z0-9_.:/]+[ t]*$|'
 Used to validate received methodname values.
 
static bool $xmlrpc_null_apache_encoding = false
 Set to TRUE to enable encoding of php NULL values to <EX:NIL/> instead of <NIL>
 
static $xmlrpc_null_apache_encoding_ns = "http://ws.apache.org/xmlrpc/namespaces/extensions"
 
static bool $xmlrpc_null_extension = false
 Set to TRUE to enable correct decoding of <NIL> and <EX:NIL/> values.
 
static bool $xmlrpc_reject_invalid_values = false
 Set to TRUE to make the library reject incoming xml which uses invalid data for xml-rpc elements, such as base64 strings which can not be decoded, dateTime strings which do not represent a valid date, invalid bools, floats and integers, method names with forbidden characters, or struct members missing the value or name.
 
static bool $xmlrpc_return_datetimes = false
 Set to TRUE to make the library use DateTime objects instead of strings for all values parsed from incoming XML.
 
static bool $xmlrpc_silence_deprecations = true
 Set this to false to have a warning added to the log whenever user code uses a deprecated method/parameter/property.
 
static int[] $xmlrpcerr
 
static int $xmlrpcerruser = 800
 Let user errors start at 800.
 
static int $xmlrpcerrxml = 100
 Let XML parse errors start at 100.
 
static string $xmlrpcName = "XML-RPC for PHP"
 
static string[] $xmlrpcstr
 
static string $xmlrpcVersion = "4.10.1"
 

Member Function Documentation

◆ exportGlobals()

static PhpXmlRpc\PhpXmlRpc::exportGlobals ( )
static

A function to be used for compatibility with legacy code: it creates all global variables which used to be declared, such as library version etc...

Return values
void
Deprecated

◆ importGlobals()

static PhpXmlRpc\PhpXmlRpc::importGlobals ( )
static

A function to be used for compatibility with legacy code: it gets the values of all global variables which used to be declared, such as library version etc... and sets them to php classes.

It should be used by code which changed the values of those global variables to alter the working of the library. Example code:

  1. include xmlrpc.inc
  2. set the values, e.g. $GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
  3. import them: PhpXmlRpc\PhpXmlRpc\importGlobals();
  4. run your own code.
Return values
void
Deprecated
Todo
this function does not import back xmlrpc_valid_parents and xml_iso88591_Entities

◆ setLogger()

static PhpXmlRpc\PhpXmlRpc::setLogger ( $logger)
static

Inject a logger into all classes of the PhpXmlRpc library which use one.

Parameters
$logger
Return values
void

◆ useInteropFaults()

static PhpXmlRpc\PhpXmlRpc::useInteropFaults ( )
static

Makes the library use the error codes detailed at https://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php.

Return values
void

@tofo feature creep - allow switching back to the original set of codes; querying the current mode

Member Data Documentation

◆ $xmlpc_double_precision

int PhpXmlRpc\PhpXmlRpc::$xmlpc_double_precision = 128
static

Number of decimal digits used to serialize Double values.

Todo
rename :'-(

◆ $xmlrpc_datetime_format

string PhpXmlRpc\PhpXmlRpc::$xmlrpc_datetime_format = '/^([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9]|60)$/'
static

Used to validate received date values.

Alter this if the server/client you are communicating with uses date formats non-conformant with the spec NB: the string should not match any data which php can not successfully use in a DateTime object constructor call NB: atm, the Date helper uses this regexp and expects to find matches in a specific order

◆ $xmlrpc_detectencodings

string [] PhpXmlRpc\PhpXmlRpc::$xmlrpc_detectencodings = array()
static

The list of preferred encodings used by the server for requests and by the client for responses to detect the charset of the received payload when.

  • the charset cannot be determined by looking at http headers, xml declaration or BOM
  • mbstring extension is enabled

◆ $xmlrpc_double_format

string PhpXmlRpc\PhpXmlRpc::$xmlrpc_double_format = '/^[ t]*[-+]?[0-9]*::.?[0-9]+([eE][-+]?[0-9]+)?[ t]*$/'
static

Used to validate received double values.

Alter this if the server/client you are communicating with uses formats non-conformant with the spec, e.g. with leading/trailing spaces/tabs/newlines. We keep in spaces for BC, even though they are forbidden by the spec. NB: the string should not match any data which php can not successfully cast to a float

◆ $xmlrpc_int_format

string PhpXmlRpc\PhpXmlRpc::$xmlrpc_int_format = '/^[ t]*[+-]?[0-9]+[ t]*$/'
static

Used to validate received integer values.

Alter this if the server/client you are communicating with uses formats non-conformant with the spec. We keep in spaces for BC, even though they are forbidden by the spec. NB: the string should not match any data which php can not successfully cast to an integer

◆ $xmlrpc_internalencoding

string PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = "UTF-8"
static

The encoding used internally by PHP.

String values received as xml will be converted to this, and php strings will be converted to xml as if having been coded with this. Valid also when defining names of xml-rpc methods

◆ $xmlrpc_methodname_format

string PhpXmlRpc\PhpXmlRpc::$xmlrpc_methodname_format = '|^[ t]*[a-zA-Z0-9_.:/]+[ t]*$|'
static

Used to validate received methodname values.

According to the spec: "The string may only contain identifier characters, upper and lower-case A-Z, the numeric characters, 0-9, underscore, dot, colon and slash". We keep in leading and trailing spaces for BC, even though they are forbidden by the spec. But what about "identifier characters"? Is that meant to be 'identifier characters: upper and lower-case A-Z, ...' or something else? If the latter, there is no consensus across programming languages about what is a valid identifier character. PHP has one of the most crazy definitions of what is a valid identifier character, allowing bytes in range x80-xff, without even specifying a character set (and then lowercasing anyway in some cases)...

◆ $xmlrpc_return_datetimes

bool PhpXmlRpc\PhpXmlRpc::$xmlrpc_return_datetimes = false
static

Set to TRUE to make the library use DateTime objects instead of strings for all values parsed from incoming XML.

NB: if the received strings are not parseable as dates, NULL will be returned. To prevent that, enable as well xmlrpc_reject_invalid_values, so that invalid dates will be rejected by the library


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