phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Procedural File: _xmlrpc.inc.php

Source Location: /qp_inc/_ext/xmlrpc/_xmlrpc.inc.php

Page Details

Empty DocBlock Title

Filesource:  Source Code for this file
Classes
Class Description
xmlrpc_client dummy docblock makes error-free autodocs
xmlrpcresp dummy docblock makes error-free autodocs
xmlrpcmsg dummy docblock makes error-free autodocs
xmlrpcval dummy docblock makes error-free autodocs
Constants
XMLRPC_EPI_ENABLED  [line 3340]

XMLRPC_EPI_ENABLED = '1'

[ Top ]


Functions
decode_chunked  [line 3556]

string decode_chunked( string $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

Parameters:
string   $buffer:  the string to be decoded


[ Top ]
guess_encoding  [line 3617]

void guess_encoding( [ $httpheader = ''], [string $xmlchunk = ''], [string $encoding_prefs = null], string $httpheaders  )

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...

Parameters:
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)
   $httpheader: 

Information Tags:
Todo:  explore usage of mb_http_input(): does it detect http headers + post data? if so, use it instead of hand-detection!!!

[ Top ]
iso8601_decode  [line 3228]

int iso8601_decode( string $idate, [int $utc = 0]  )

Given an ISO8601 date string, return a timet in the localtime, or UTC

Parameters:
string   $idate: 
int   $utc:  either 0 or 1

API Tags:
Return:  (datetime)


[ Top ]
iso8601_encode  [line 3200]

string iso8601_encode( int $timet, [int $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

Parameters:
int   $timet:  (timestamp)
int   $utc:  (0 or 1)


[ Top ]
is_valid_charset  [line 3704]

void is_valid_charset( string $encoding, mixed $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

Parameters:
string   $encoding:  charset to be tested
mixed   $validlist:  comma separated list of valid charsets (or array of charsets)


[ Top ]
php_xmlrpc_decode  [line 3266]

mixed php_xmlrpc_decode( xmlrpcval $xmlrpc_val, [array $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!

Parameters:
xmlrpcval   $xmlrpc_val: 
array   $options:  if 'decode_php_objs' is set in the options array, xmlrpc structs can be decoded into php objects

Information Tags:
Author:  Dan Libby (dan@libby.com)

[ Top ]
php_xmlrpc_decode_xml  [line 3476]

mixed php_xmlrpc_decode_xml( string $xml_val, [array $options = array()]  )

Convert the xml representation of a method response, method request or single

xmlrpc value into the appropriate object (a.k.a. deserialize)

Parameters:
string   $xml_val: 
array   $options: 

API Tags:
Return:  false on error, or an instance of either xmlrpcval, xmlrpcmsg or xmlrpcresp


[ Top ]
php_xmlrpc_encode  [line 3364]

xmlrpcval &php_xmlrpc_encode( mixed $php_val, [array $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

Parameters:
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'

Information Tags:
Author:  Dan Libby (dan@libby.com)

[ Top ]
xmlrpc_cd  [line 748]

void xmlrpc_cd( $parser, $data  )
Parameters:
   $parser: 
   $data: 


[ Top ]
xmlrpc_dh  [line 776]

void xmlrpc_dh( $parser, $data  )
Parameters:
   $parser: 
   $data: 


[ Top ]
xmlrpc_ee  [line 534]

void xmlrpc_ee( $parser, $name, [ $rebuild_xmlrpcvals = true]  )
Parameters:
   $parser: 
   $name: 
   $rebuild_xmlrpcvals: 


[ Top ]
xmlrpc_ee_fast  [line 742]

void xmlrpc_ee_fast( $parser, $name  )
Parameters:
   $parser: 
   $name: 


[ Top ]
xmlrpc_encode_entitites  [line 250]

void 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.

Parameters:
   $data: 
   $src_encoding: 
   $dest_encoding: 

Information Tags:
Todo:  do a bit of basic benchmarking (strtr vs. str_replace)
Todo:  make usage of iconv() or recode_string() or mb_string() where available

[ Top ]
xmlrpc_se  [line 382]

void xmlrpc_se( $parser, $name, $attrs, [ $accept_single_vals = false]  )
Parameters:
   $parser: 
   $name: 
   $attrs: 
   $accept_single_vals: 


[ Top ]
xmlrpc_se_any  [line 528]

void xmlrpc_se_any( $parser, $name, $attrs  )
Parameters:
   $parser: 
   $name: 
   $attrs: 


[ Top ]