43 require_once
'XML/RPC2/Exception.php';
44 require_once
'XML/RPC2/Backend/Php/Value/Scalar.php';
79 if ((is_object($nativeValue)) &&(strtolower(get_class($nativeValue)) ==
'stdclass') && (isset($nativeValue->xmlrpc_type))) {
80 $scalar = $nativeValue->scalar;
82 if (!is_string($nativeValue)) {
85 $scalar = $nativeValue;
87 $tmp =
new stdclass();
88 $tmp->scalar = $scalar;
89 $tmp->xmlrpc_type =
'base64';
104 return '<base64>' . base64_encode($native->scalar) .
'</base64>';
119 $xml = simplexml_load_string($xml->asXML());
120 $value = $xml->xpath(
'/value/base64/text()');
121 if (!array_key_exists(0, $value)) {
122 $value = $xml->xpath(
'/value/text()');
125 $result =
new stdclass();
126 $result->scalar = base64_decode($value[0]);
127 $result->xmlrpc_type =
'base64';