namespace PhpXmlRpc;
-use PhpXmlRpc\Helper\Charset;
+//use PhpXmlRpc\Helper\Charset;
use PhpXmlRpc\Helper\Logger;
use PhpXmlRpc\Helper\XMLParser;
'ac' => '',
'stack' => array(),
'valuestack' => array(),
-
+ 'lv' => 0,
'isf' => 0,
'isf_reason' => '',
'value' => null,
* the constructor. String-key options are used independently
* @return void the caller has to look into $this->_xh to find the results
* @throws \Exception this can happen if a callback function is set and it does throw (i.e. we do not catch exceptions)
+ *
+ * @todo refactor? we could 1. return the parsed data structure, and 2. move $returnType and $accept into options
*/
public function parse($data, $returnType = self::RETURN_XMLRPCVALS, $accept = 3, $options = array())
{
'ac' => '',
'stack' => array(),
'valuestack' => array(),
-
+ 'lv' => 0,
'isf' => 0,
'isf_reason' => '',
'value' => null,
}
foreach ($mergedOptions as $key => $val) {
- if (is_string($key)) {
+ if (is_string($key) && !ctype_digit($key)) {
switch($key) {
case 'target_charset':
if (function_exists('mb_convert_encoding')) {
namespace PhpXmlRpc;
+use PhpXmlRpc\Helper\Charset;
+
/**
* Manages global configuration for operation of the library.
*/
}
}
- $charset = Helper\Charset::instance();
+ $charset = Charset::instance();
$GLOBALS['xml_iso88591_Entities'] = $charset->getEntities('iso88591');
}
$result .= "<fault>\n" .
"<value>\n<struct><member><name>faultCode</name>\n<value><int>" . $this->errno .
"</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>" .
- Charset::instance()->encodeEntities($this->errstr, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</string></value>\n</member>\n" .
+ $this->getCharsetEncoder()->encodeEntities($this->errstr, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</string></value>\n</member>\n" .
"</struct>\n</value>\n</fault>";
} else {
if (!is_object($this->val) || !is_a($this->val, 'PhpXmlRpc\Value')) {