|
| decode ($xmlrpcVal, $options=array()) |
| Takes an xmlrpc value in object format and translates it into native PHP types.
|
|
| decodeXml ($xmlVal, $options=array()) |
| Convert the xml representation of a method response, method request or single xmlrpc value into the appropriate object (a.k.a.
|
|
| encode ($phpVal, $options=array()) |
| Takes native php types and encodes them into xmlrpc PHP object format.
|
|
| getLogger () |
|
| getParser () |
|
|
static | setLogger ($logger) |
|
static | setParser ($parser) |
|
|
static | $logger |
|
static | $parser |
|
◆ decode()
PhpXmlRpc\Encoder::decode |
( |
| $xmlrpcVal, |
|
|
| $options = array() ) |
Takes an xmlrpc value in object format and translates it into native PHP types.
Works with xmlrpc requests 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 enabling this!
- Author
- Dan Libby (dan@l.nosp@m.ibby.nosp@m..com)
- Parameters
-
Value | Request | $xmlrpcVal | |
array | $options | if 'decode_php_objs' is set in the options array, xmlrpc structs can be decoded into php objects; if 'dates_as_objects' is set xmlrpc datetimes are decoded as php DateTime objects |
- Return values
-
◆ decodeXml()
PhpXmlRpc\Encoder::decodeXml |
( |
| $xmlVal, |
|
|
| $options = array() ) |
Convert the xml representation of a method response, method request or single xmlrpc value into the appropriate object (a.k.a.
deserialize).
- Todo
- is this a good name/class for this method? It does something quite different from 'decode' after all (returning objects vs returns plain php values)... In fact it belongs rather to a Parser class
- Parameters
-
string | $xmlVal | |
array | $options | |
- Return values
-
Value|Request|Response|false | false on error, or an instance of either Value, Request or Response |
◆ encode()
PhpXmlRpc\Encoder::encode |
( |
| $phpVal, |
|
|
| $options = array() ) |
Takes native php types and encodes them into xmlrpc PHP object format.
It will not re-encode xmlrpc value 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
- Author
- Dan Libby (dan@l.nosp@m.ibby.nosp@m..com)
- Parameters
-
mixed | $phpVal | the value to be converted into an xmlrpc value object |
array | $options | can include 'encode_php_objs', 'auto_dates', 'null_extension' or 'extension_api' |
- Return values
-
The documentation for this class was generated from the following file:
- lib/phpxmlrpc/Encoder.php