Cheetah
|
Go to the source code of this file.
Classes | |
class | xmlrpc_client |
class | xmlrpcresp |
class | xmlrpcmsg |
class | xmlrpcval |
Functions | |
xmlrpc_encode_entitites ($data, $src_encoding='', $dest_encoding='') | |
xmlrpc_se ($parser, $name, $attrs, $accept_single_vals=false) | |
xml parser handler function for opening element tags More... | |
xmlrpc_se_any ($parser, $name, $attrs) | |
Used in decoding xml chunks that might represent single xmlrpc values. More... | |
xmlrpc_ee ($parser, $name, $rebuild_xmlrpcvals=true) | |
xml parser handler function for close element tags More... | |
xmlrpc_ee_fast ($parser, $name) | |
Used in decoding xmlrpc requests/responses without rebuilding xmlrpc values. More... | |
xmlrpc_cd ($parser, $data) | |
xml parser handler function for character data More... | |
xmlrpc_dh ($parser, $data) | |
iso8601_encode ($timet, $utc=0) | |
iso8601_decode ($idate, $utc=0) | |
php_xmlrpc_decode ($xmlrpc_val, $options=array()) | |
& | php_xmlrpc_encode ($php_val, $options=array()) |
php_xmlrpc_decode_xml ($xml_val, $options=array()) | |
decode_chunked ($buffer) | |
guess_encoding ($httpheader='', $xmlchunk='', $encoding_prefs=null) | |
is_valid_charset ($encoding, $validlist) | |
Variables | |
if(!function_exists('xml_parser_create')) | $phpversion = phpversion() |
if($phpversion[0]=='4' && $phpversion[2]< 2) | $GLOBALS ['xmlrpcI4'] ='i4' |
$GLOBALS ['xmlrpcInt'] ='int' | |
$GLOBALS ['xmlrpcBoolean'] ='boolean' | |
$GLOBALS ['xmlrpcDouble'] ='double' | |
$GLOBALS ['xmlrpcString'] ='string' | |
$GLOBALS ['xmlrpcDateTime'] ='dateTime.iso8601' | |
$GLOBALS ['xmlrpcBase64'] ='base64' | |
$GLOBALS ['xmlrpcArray'] ='array' | |
$GLOBALS ['xmlrpcStruct'] ='struct' | |
$GLOBALS ['xmlrpcValue'] ='undefined' | |
$GLOBALS ['xmlrpcTypes'] | |
$GLOBALS ['xmlrpc_valid_parents'] | |
$GLOBALS ['xmlrpcNull'] ='null' | |
$GLOBALS ['xmlrpcTypes']['null'] =1 | |
$GLOBALS ['xmlEntities'] | |
$GLOBALS ['xml_iso88591_Entities'] =array() | |
$GLOBALS ['xml_iso88591_Entities']['in'] = array() | |
$GLOBALS ['xml_iso88591_Entities']['out'] = array() | |
for($i=0; $i< 32; $i++) for($i=160; $i< 256; $i++) | $GLOBALS ['xmlrpcerr'] |
$GLOBALS ['xmlrpcstr'] | |
$GLOBALS ['xmlrpc_defencoding'] ='UTF-8' | |
$GLOBALS ['xmlrpc_internalencoding'] ='ISO-8859-1' | |
$GLOBALS ['xmlrpcName'] ='XML-RPC for PHP' | |
$GLOBALS ['xmlrpcVersion'] ='2.2.1' | |
$GLOBALS ['xmlrpcerruser'] =800 | |
$GLOBALS ['xmlrpcerrxml'] =100 | |
$GLOBALS ['xmlrpc_backslash'] =chr(92).chr(92) | |
$GLOBALS ['xmlrpc_null_extension'] =false | |
$GLOBALS ['_xh'] =null | |
if(function_exists('xmlrpc_decode')) | else |
decode_chunked | ( | $buffer | ) |
decode a string that is encoded w/ "chunked" transfer encoding as defined in rfc2068 par. 19.4.6 code shamelessly stolen from nusoap library by Dietrich Ayala
string | $buffer | the string to be decoded |
Definition at line 3534 of file xmlrpc.inc.
guess_encoding | ( | $httpheader = '' , |
|
$xmlchunk = '' , |
|||
$encoding_prefs = null |
|||
) |
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 unconforming (legacy?) clients/servers, which will be most probably using UTF-8 anyway...
string | $httpheaders | the http Content-type header |
string | $xmlchunk | xml content buffer |
string | $encoding_prefs | comma separated list of character encodings to be used as default (when mb extension is enabled) |
Definition at line 3595 of file xmlrpc.inc.
is_valid_charset | ( | $encoding, | |
$validlist | |||
) |
Checks if a given charset encoding is present in a list of encodings or if it is a valid subset of any encoding in the list
string | $encoding | charset to be tested |
mixed | $validlist | comma separated list of valid charsets (or array of charsets) |
Definition at line 3682 of file xmlrpc.inc.
iso8601_decode | ( | $idate, | |
$utc = 0 |
|||
) |
Given an ISO8601 date string, return a timet in the localtime, or UTC
string | $idate | |
int | $utc | either 0 or 1 |
Definition at line 3206 of file xmlrpc.inc.
iso8601_encode | ( | $timet, | |
$utc = 0 |
|||
) |
Given a timestamp, return the corresponding ISO8601 encoded string.
Really, timezones ought to be supported but the XML-RPC spec says:
"Don't assume a timezone. It should be specified by the server in its documentation what assumptions it makes about timezones."
These routines always assume localtime unless $utc is set to 1, in which case UTC is assumed and an adjustment for locale is made when encoding
int | $timet | (timestamp) |
int | $utc | (0 or 1) |
Definition at line 3178 of file xmlrpc.inc.
php_xmlrpc_decode | ( | $xmlrpc_val, | |
$options = array() |
|||
) |
Takes an xmlrpc value in PHP xmlrpcval object format and translates it into native PHP types.
Works with xmlrpc message objects as input, too.
Given proper options parameter, can rebuild generic php object instances (provided those have been encoded to xmlrpc format using a corresponding option in php_xmlrpc_encode()) PLEASE NOTE that rebuilding php objects involves calling their constructor function. This means that the remote communication end can decide which php code will get executed on your server, leaving the door possibly open to 'php-injection' style of attacks (provided you have some classes defined on your server that might wreak havoc if instances are built outside an appropriate context). Make sure you trust the remote server/client before eanbling this!
xmlrpcval | $xmlrpc_val | |
array | $options | if 'decode_php_objs' is set in the options array, xmlrpc structs can be decoded into php objects |
Definition at line 3244 of file xmlrpc.inc.
php_xmlrpc_decode_xml | ( | $xml_val, | |
$options = array() |
|||
) |
Convert the xml representation of a method response, method request or single xmlrpc value into the appropriate object (a.k.a. deserialize)
string | $xml_val | |
array | $options |
Definition at line 3454 of file xmlrpc.inc.
& php_xmlrpc_encode | ( | $php_val, | |
$options = array() |
|||
) |
Takes native php types and encodes them into xmlrpc PHP object format. It will not re-encode xmlrpcval objects.
Feature creep – could support more types via optional type argument (string => datetime support has been added, ??? => base64 not yet)
If given a proper options parameter, php object instances will be encoded into 'special' xmlrpc values, that can later be decoded into php objects by calling php_xmlrpc_decode() with a corresponding option
mixed | $php_val | the value to be converted into an xmlrpcval object |
array | $options | can include 'encode_php_objs', 'auto_dates', 'null_extension' or 'extension_api' |
Definition at line 3342 of file xmlrpc.inc.
xmlrpc_cd | ( | $parser, | |
$data | |||
) |
xml parser handler function for character data
Definition at line 774 of file xmlrpc.inc.
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 802 of file xmlrpc.inc.
xmlrpc_ee | ( | $parser, | |
$name, | |||
$rebuild_xmlrpcvals = true |
|||
) |
xml parser handler function for close element tags
Definition at line 560 of file xmlrpc.inc.
xmlrpc_ee_fast | ( | $parser, | |
$name | |||
) |
Used in decoding xmlrpc requests/responses without rebuilding xmlrpc values.
Definition at line 768 of file xmlrpc.inc.
xmlrpc_encode_entitites | ( | $data, | |
$src_encoding = '' , |
|||
$dest_encoding = '' |
|||
) |
Convert a string to the correct XML representation in a target charset To help correct communication of non-ascii chars inside strings, regardless of the charset used when sending requests, parsing them, sending responses and parsing responses, an option is to convert all non-ascii chars present in the message into their equivalent 'charset entity'. Charset entities enumerated this way are independent of the charset encoding used to transmit them, and all XML parsers are bound to understand them. Note that in the std case we are not sending a charset encoding mime type along with http headers, so we are bound by RFC 3023 to emit strict us-ascii.
Definition at line 276 of file xmlrpc.inc.
xmlrpc_se | ( | $parser, | |
$name, | |||
$attrs, | |||
$accept_single_vals = false |
|||
) |
xml parser handler function for opening element tags
INVALID ELEMENT: RAISE ISF so that it is later recognized!!!
Definition at line 408 of file xmlrpc.inc.
xmlrpc_se_any | ( | $parser, | |
$name, | |||
$attrs | |||
) |
Used in decoding xml chunks that might represent single xmlrpc values.
Definition at line 554 of file xmlrpc.inc.
$GLOBALS[ '_xh'] =null |
Definition at line 260 of file xmlrpc.inc.
$GLOBALS[ 'xml_iso88591_Entities'] =array() |
Definition at line 134 of file xmlrpc.inc.
$GLOBALS[ 'xml_iso88591_Entities'][ 'in'] = array() |
Definition at line 135 of file xmlrpc.inc.
$GLOBALS[ 'xml_iso88591_Entities'][ 'out'] = array() |
Definition at line 136 of file xmlrpc.inc.
$GLOBALS[ 'xmlEntities'] |
Definition at line 124 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpc_backslash'] =chr(92).chr(92) |
Definition at line 244 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpc_defencoding'] ='UTF-8' |
Definition at line 226 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpc_internalencoding'] ='ISO-8859-1' |
Definition at line 231 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpc_null_extension'] =false |
Definition at line 247 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpc_valid_parents'] |
Definition at line 97 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcArray'] ='array' |
Definition at line 81 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcBase64'] ='base64' |
Definition at line 80 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcBoolean'] ='boolean' |
Definition at line 76 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcDateTime'] ='dateTime.iso8601' |
Definition at line 79 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcDouble'] ='double' |
Definition at line 77 of file xmlrpc.inc.
Definition at line 169 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcerruser'] =800 |
Definition at line 237 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcerrxml'] =100 |
Definition at line 239 of file xmlrpc.inc.
if ( $phpversion[0]=='4' &&$phpversion[2]< 2) $GLOBALS[ 'xmlrpcI4'] ='i4' |
Definition at line 74 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcInt'] ='int' |
Definition at line 75 of file xmlrpc.inc.
Definition at line 233 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcNull'] ='null' |
Definition at line 119 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcstr'] |
Definition at line 196 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcString'] ='string' |
Definition at line 78 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcStruct'] ='struct' |
Definition at line 82 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcTypes'] |
Definition at line 85 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcTypes'][ 'null'] =1 |
Definition at line 120 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcValue'] ='undefined' |
Definition at line 83 of file xmlrpc.inc.
$GLOBALS[ 'xmlrpcVersion'] ='2.2.1' |
Definition at line 234 of file xmlrpc.inc.
if (!function_exists( 'xml_parser_create')) $phpversion = phpversion() |
Definition at line 49 of file xmlrpc.inc.
if (function_exists( 'xmlrpc_decode')) else |
Definition at line 3320 of file xmlrpc.inc.