+
+ // number of decimal digits used to serialize Double values
+ public static $xmlpc_double_precision = 128;
+
+ /**
+ * A function to be used for compatibility with legacy code: it creates all global variables which used to be declared,
+ * such as library version etc...
+ */
+ public static function exportGlobals()
+ {
+ $reflection = new \ReflectionClass('PhpXmlRpc\PhpXmlRpc');
+ foreach ($reflection->getStaticProperties() as $name => $value) {
+ $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');
+ }
+
+ /**
+ * A function to be used for compatibility with legacy code: it gets the values of all global variables which used
+ * to be declared, such as library version etc... and sets them to php classes.
+ * It should be used by code which changed the values of those global variables to alter the working of the library.
+ * Example code:
+ * 1. include xmlrpc.inc
+ * 2. set the values, e.g. $GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
+ * 3. import them: PhpXmlRpc\PhpXmlRpc::importGlobals();
+ * 4. run your own code.
+ */
+ public static function importGlobals()
+ {
+ $reflection = new \ReflectionClass('PhpXmlRpc\PhpXmlRpc');
+ $staticProperties = $reflection->getStaticProperties();
+ foreach ($staticProperties as $name => $value) {
+ if (isset($GLOBALS[$name])) {
+ self::$$name = $GLOBALS[$name];
+ }
+ }
+ }
+