X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FPhpXmlRpc.php;h=84597e6b4d739d898c6c7e59f4dc187627d8b648;hb=cc67a43993662a5a3f92801b96b89ee6e3998532;hp=dff3896701b0b599ffc5921f0decb54f5a6f90fc;hpb=35d2340eea9a168983b8f20d54c399422790f816;p=plcapi.git diff --git a/src/PhpXmlRpc.php b/src/PhpXmlRpc.php index dff3896..84597e6 100644 --- a/src/PhpXmlRpc.php +++ b/src/PhpXmlRpc.php @@ -65,8 +65,9 @@ class PhpXmlRpc // The encoding used internally by PHP. // String values received as xml will be converted to this, and php strings will be converted to xml - // as if having been coded with this - public static $xmlrpc_internalencoding = "ISO-8859-1"; // TODO: maybe this would be better as UTF-8, or atleast configurable? + // as if having been coded with this. + // Valid also when defining names of xmlrpc methods + public static $xmlrpc_internalencoding = "UTF-8"; public static $xmlrpcName = "XML-RPC for PHP"; public static $xmlrpcVersion = "4.0.0.beta"; @@ -95,10 +96,25 @@ class PhpXmlRpc $GLOBALS[$name] = $value; } + // NB: all the variables exported into the global namespace below here do NOT guarantee 100% + // compatibility, as they are NOT reimported back during calls to importGlobals() + $reflection = new \ReflectionClass('PhpXmlRpc\Value'); foreach ($reflection->getStaticProperties() as $name => $value) { $GLOBALS[$name] = $value; } + + $parser = new Helper\XMLParser(); + $reflection = new \ReflectionClass('PhpXmlRpc\Helper\XMLParser'); + foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $name => $value) { + if (in_array($value->getName(), array('xmlrpc_valid_parents'))) + { + $GLOBALS[$value->getName()] = $value->getValue($parser); + } + } + + $charset = Helper\Charset::instance(); + $GLOBALS['xml_iso88591_Entities'] = $charset->getEntities('iso88591'); } /** @@ -121,4 +137,5 @@ class PhpXmlRpc } } } + }