| 3 |
## $Id$ |
## $Id$ |
| 4 |
## -------------------------------------------------------------------------- |
## -------------------------------------------------------------------------- |
| 5 |
## $Log$ |
## $Log$ |
| 6 |
|
## Revision 1.6 2003/02/03 03:37:45 jonen |
| 7 |
|
## - removed unused argument '$decode' at function '_call()' |
| 8 |
|
## + added argument '$options=array()' at function '_call()' |
| 9 |
|
## which will be passed to function '&decodeData()' for e.g. utf8 decoding |
| 10 |
|
## + added '$encoder->toISO()' at '&decodeData()', (re)moved from 'ProxyObject.php' |
| 11 |
|
## |
| 12 |
## Revision 1.5 2002/12/22 13:24:09 jonen |
## Revision 1.5 2002/12/22 13:24:09 jonen |
| 13 |
## + added utf8 encoding at 'send()' toggled by option |
## + added utf8 encoding at 'send()' toggled by option |
| 14 |
## |
## |
| 54 |
$encoder->toUTF8(); |
$encoder->toUTF8(); |
| 55 |
} |
} |
| 56 |
// call '_call' with 'decode' |
// call '_call' with 'decode' |
| 57 |
return $this->_call($command, $data, 1); |
return $this->_call($command, $data, $options); |
| 58 |
} |
} |
| 59 |
|
|
| 60 |
function _call($command, $data = "", $decode = 0) { |
function _call($command, $data = "", $options = array() ) { |
| 61 |
|
|
| 62 |
//print "call: $command<hr>"; |
//print "call: $command<hr>"; |
| 63 |
|
|
| 82 |
$response_enc = $msg_response->value(); |
$response_enc = $msg_response->value(); |
| 83 |
|
|
| 84 |
// TODO: what's this? prematurely returning here should not be considered "stable".... |
// TODO: what's this? prematurely returning here should not be considered "stable".... |
| 85 |
return $this->decodeData($response_enc); |
return $this->decodeData($response_enc, $options); |
|
|
|
|
if ($decode) { |
|
|
return $this->decodeData($response_enc); |
|
|
} else { |
|
|
return $response_enc; |
|
|
} |
|
|
|
|
| 86 |
} |
} |
| 87 |
|
|
| 88 |
function &decodeData(&$payload) { |
function &decodeData(&$payload, $options = array() ) { |
| 89 |
//if (!is_object($payload)) { return; } |
//if (!is_object($payload)) { return; } |
| 90 |
if ($payload) { |
if ($payload) { |
| 91 |
// data |
// data |
| 92 |
$data = XML_RPC_decode($payload); |
$data = XML_RPC_decode($payload); |
| 93 |
//print "data: " . dumpVar($response); |
//print "data: " . dumpVar($response); |
| 94 |
|
|
| 95 |
|
// decode UTF8 to ISO if wanted |
| 96 |
|
if($options[utf8]) { |
| 97 |
|
$encoder = new TextEncode($data); |
| 98 |
|
$encoder->toISO(); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
return $data; |
return $data; |
| 102 |
} else { |
} else { |
| 103 |
//print "ERROR!<br>"; |
//print "ERROR!<br>"; |