7 static public $xmlrpcerr = array(
10 'incorrect_params' => 3,
11 'introspect_unknown' => 4,
16 'invalid_request' => 15,
19 'multicall_error' => 18,
20 'multicall_notstruct' => 9,
21 'multicall_nomethod' => 10,
22 'multicall_notstring' => 11,
23 'multicall_recursion' => 12,
24 'multicall_noparams' => 13,
25 'multicall_notarray' => 14,
27 'cannot_decompress' => 103,
28 'decompress_fail' => 104,
29 'dechunk_fail' => 105,
30 'server_cannot_decompress' => 106,
31 'server_decompress_fail' => 107,
34 static public $xmlrpcstr = array(
35 'unknown_method' => 'Unknown method',
36 'invalid_return' => 'Invalid return payload: enable debugging to examine incoming payload',
37 'incorrect_params' => 'Incorrect parameters passed to method',
38 'introspect_unknown' => "Can't introspect: method unknown",
39 'http_error' => "Didn't receive 200 OK from remote server.",
40 'no_data' => 'No data received from server.',
41 'no_ssl' => 'No SSL support compiled in.',
42 'curl_fail' => 'CURL error',
43 'invalid_request' => 'Invalid request payload',
44 'no_curl' => 'No CURL support compiled in.',
45 'server_error' => 'Internal server error',
46 'multicall_error' => 'Received from server invalid multicall response',
47 'multicall_notstruct' => 'system.multicall expected struct',
48 'multicall_nomethod' => 'missing methodName',
49 'multicall_notstring' => 'methodName is not a string',
50 'multicall_recursion' => 'recursive system.multicall forbidden',
51 'multicall_noparams' => 'missing params',
52 'multicall_notarray' => 'params is not an array',
54 'cannot_decompress' => 'Received from server compressed HTTP and cannot decompress',
55 'decompress_fail' => 'Received from server invalid compressed HTTP',
56 'dechunk_fail' => 'Received from server invalid chunked HTTP',
57 'server_cannot_decompress' => 'Received from client compressed HTTP request and cannot decompress',
58 'server_decompress_fail' => 'Received from client invalid compressed HTTP request',
61 // The charset encoding used by the server for received requests and
62 // by the client for received responses when received charset cannot be determined
63 // or is not supported
64 public static $xmlrpc_defencoding = "UTF-8";
66 // The encoding used internally by PHP.
67 // String values received as xml will be converted to this, and php strings will be converted to xml
68 // as if having been coded with this
69 public static $xmlrpc_internalencoding = "ISO-8859-1"; // TODO: maybe this would be better as UTF-8, or atleast configurable?
71 public static $xmlrpcName = "XML-RPC for PHP";
72 public static $xmlrpcVersion = "4.0.0.beta";
74 // let user errors start at 800
75 public static $xmlrpcerruser = 800;
76 // let XML parse errors start at 100
77 public static $xmlrpcerrxml = 100;
79 // set to TRUE to enable correct decoding of <NIL/> and <EX:NIL/> values
80 public static $xmlrpc_null_extension = false;
82 // set to TRUE to enable encoding of php NULL values to <EX:NIL/> instead of <NIL/>
83 public static $xmlrpc_null_apache_encoding = false;
85 public static $xmlrpc_null_apache_encoding_ns = "http://ws.apache.org/xmlrpc/namespaces/extensions";
88 * A function to be used for compatibility with legacy code: it creates all global variables which used to be declared,
89 * such as library version etc...
91 public static function exportGlobals()
93 $reflection = new \ReflectionClass('PhpXmlRpc\PhpXmlRpc');
94 foreach ($reflection->getStaticProperties() as $name => $value) {
95 $GLOBALS[$name] = $value;
98 $reflection = new \ReflectionClass('PhpXmlRpc\Value');
99 foreach ($reflection->getStaticProperties() as $name => $value) {
100 $GLOBALS[$name] = $value;
105 * A function to be used for compatibility with legacy code: it gets the values of all global variables which used
106 * to be declared, such as library version etc... and sets them to php classes.
107 * It should be used by code which changed the values of those global variables to alter the working of the library.
109 * 1. include xmlrpc.inc
110 * 2. set the values, e.g. $GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
111 * 3. import them: PhpXmlRpc\PhpXmlRpc::importGlobals();
112 * 4. run your own code.
114 public static function importGlobals()
116 $reflection = new \ReflectionClass('PhpXmlRpc\PhpXmlRpc');
117 $staticProperties = $reflection->getStaticProperties();
118 foreach ($staticProperties as $name => $value) {
119 if (isset($GLOBALS[$name])) {
120 self::$$name = $GLOBALS[$name];