Open Monograph Press  3.3.0
PhpXmlRpc\Helper\XMLParser Class Reference

Public Member Functions

 xmlrpc_cd ($parser, $data)
 
 xmlrpc_dh ($parser, $data)
 
 xmlrpc_ee ($parser, $name, $rebuildXmlrpcvals=true)
 
 xmlrpc_ee_fast ($parser, $name)
 
 xmlrpc_se ($parser, $name, $attrs, $acceptSingleVals=false)
 
 xmlrpc_se_any ($parser, $name, $attrs)
 

Static Public Member Functions

static guessEncoding ($httpHeader='', $xmlChunk='', $encodingPrefs=null)
 
static hasEncoding ($xmlChunk)
 

Data Fields

 $_xh
 
 $xmlrpc_valid_parents
 

Detailed Description

Deals with parsing the XML.

Definition at line 11 of file XMLParser.php.

Member Function Documentation

◆ guessEncoding()

static PhpXmlRpc\Helper\XMLParser::guessEncoding (   $httpHeader = '',
  $xmlChunk = '',
  $encodingPrefs = null 
)
static

xml charset encoding guessing helper function. Tries to determine the charset encoding of an XML chunk received over HTTP. NB: according to the spec (RFC 3023), if text/xml content-type is received over HTTP without a content-type, we SHOULD assume it is strictly US-ASCII. But we try to be more tolerant of non conforming (legacy?) clients/servers, which will be most probably using UTF-8 anyway... In order of importance checks:

  1. http headers
  2. BOM
  3. XML declaration
  4. guesses using mb_detect_encoding()
Parameters
string$httpHeaderthe http Content-type header
string$xmlChunkxml content buffer
string$encodingPrefscomma separated list of character encodings to be used as default (when mb extension is enabled). This can also be set globally using PhpXmlRpc::$xmlrpc_detectencodings
Returns
string the encoding determined. Null if it can't be determined and mbstring is enabled, PhpXmlRpc::$xmlrpc_defencoding if it can't be determined and mbstring is not enabled
Todo:
explore usage of mb_http_input(): does it detect http headers + post data? if so, use it instead of hand-detection!!!

Definition at line 444 of file XMLParser.php.

References PhpXmlRpc\PhpXmlRpc\$xmlrpc_defencoding, and PhpXmlRpc\PhpXmlRpc\$xmlrpc_detectencodings.

◆ hasEncoding()

static PhpXmlRpc\Helper\XMLParser::hasEncoding (   $xmlChunk)
static

Helper function: checks if an xml chunk as a charset declaration (BOM or in the xml declaration)

Parameters
string$xmlChunk
Returns
bool

Definition at line 523 of file XMLParser.php.

◆ xmlrpc_cd()

PhpXmlRpc\Helper\XMLParser::xmlrpc_cd (   $parser,
  $data 
)

xml parser handler function for character data.

Definition at line 395 of file XMLParser.php.

◆ xmlrpc_dh()

PhpXmlRpc\Helper\XMLParser::xmlrpc_dh (   $parser,
  $data 
)

xml parser handler function for 'other stuff', ie. not char data or element start/end tag. In fact it only gets called on unknown entities...

Definition at line 411 of file XMLParser.php.

◆ xmlrpc_ee()

PhpXmlRpc\Helper\XMLParser::xmlrpc_ee (   $parser,
  $name,
  $rebuildXmlrpcvals = true 
)

xml parser handler function for close element tags.

Definition at line 212 of file XMLParser.php.

References PhpXmlRpc\PhpXmlRpc\$xmlrpc_null_extension, PhpXmlRpc\Value\$xmlrpcDateTime, and PhpXmlRpc\Value\$xmlrpcString.

Referenced by PhpXmlRpc\Helper\XMLParser\xmlrpc_ee_fast().

◆ xmlrpc_ee_fast()

PhpXmlRpc\Helper\XMLParser::xmlrpc_ee_fast (   $parser,
  $name 
)

Used in decoding xmlrpc requests/responses without rebuilding xmlrpc Values.

Definition at line 387 of file XMLParser.php.

References PhpXmlRpc\Helper\XMLParser\xmlrpc_ee().

◆ xmlrpc_se()

PhpXmlRpc\Helper\XMLParser::xmlrpc_se (   $parser,
  $name,
  $attrs,
  $acceptSingleVals = false 
)

xml parser handler function for opening element tags.

Definition at line 64 of file XMLParser.php.

References PhpXmlRpc\PhpXmlRpc\$xmlrpc_null_extension.

Referenced by PhpXmlRpc\Helper\XMLParser\xmlrpc_se_any().

◆ xmlrpc_se_any()

PhpXmlRpc\Helper\XMLParser::xmlrpc_se_any (   $parser,
  $name,
  $attrs 
)

Used in decoding xml chunks that might represent single xmlrpc values.

Definition at line 204 of file XMLParser.php.

References PhpXmlRpc\Helper\XMLParser\xmlrpc_se().

Field Documentation

◆ $_xh

PhpXmlRpc\Helper\XMLParser::$_xh
Initial value:
= array(
'ac' => '',
'stack' => array(),
'valuestack' => array(),
'isf' => 0,
'isf_reason' => '',
'method' => false,
'params' => array(),
'pt' => array(),
'rt' => '',
)

Definition at line 27 of file XMLParser.php.

◆ $xmlrpc_valid_parents

PhpXmlRpc\Helper\XMLParser::$xmlrpc_valid_parents
Initial value:
= array(
'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT'),
'BOOLEAN' => array('VALUE'),
'I4' => array('VALUE'),
'INT' => array('VALUE'),
'STRING' => array('VALUE'),
'DOUBLE' => array('VALUE'),
'DATETIME.ISO8601' => array('VALUE'),
'BASE64' => array('VALUE'),
'MEMBER' => array('STRUCT'),
'NAME' => array('MEMBER'),
'DATA' => array('ARRAY'),
'ARRAY' => array('VALUE'),
'STRUCT' => array('VALUE'),
'PARAM' => array('PARAMS'),
'METHODNAME' => array('METHODCALL'),
'PARAMS' => array('METHODCALL', 'METHODRESPONSE'),
'FAULT' => array('METHODRESPONSE'),
'NIL' => array('VALUE'),
'EX:NIL' => array('VALUE'),
)

Definition at line 39 of file XMLParser.php.


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