3 * Defines functions and signatures which can be registered as methods exposed by an XMLRPC Server.
5 * To use this, use something akin to:
6 * $signatures = include('interop.php');
8 * Trivial interop tests
9 * http://www.xmlrpc.com/stories/storyReader$1636
12 use PhpXmlRpc\Response;
15 $i_echoString_sig = array(array(Value::$xmlrpcString, Value::$xmlrpcString));
16 $i_echoString_doc = "Echoes string.";
18 $i_echoStringArray_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray));
19 $i_echoStringArray_doc = "Echoes string array.";
21 $i_echoInteger_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcInt));
22 $i_echoInteger_doc = "Echoes integer.";
24 $i_echoIntegerArray_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray));
25 $i_echoIntegerArray_doc = "Echoes integer array.";
27 $i_echoFloat_sig = array(array(Value::$xmlrpcDouble, Value::$xmlrpcDouble));
28 $i_echoFloat_doc = "Echoes float.";
30 $i_echoFloatArray_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray));
31 $i_echoFloatArray_doc = "Echoes float array.";
33 $i_echoStruct_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcStruct));
34 $i_echoStruct_doc = "Echoes struct.";
36 $i_echoStructArray_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray));
37 $i_echoStructArray_doc = "Echoes struct array.";
39 $i_echoValue_doc = "Echoes any value back.";
40 $i_echoValue_sig = array(array(Value::$xmlrpcValue, Value::$xmlrpcValue));
42 $i_echoBase64_sig = array(array(Value::$xmlrpcBase64, Value::$xmlrpcBase64));
43 $i_echoBase64_doc = "Echoes base64.";
45 $i_echoDate_sig = array(array(Value::$xmlrpcDateTime, Value::$xmlrpcDateTime));
46 $i_echoDate_doc = "Echoes dateTime.";
48 function i_echoParam($req)
50 $s = $req->getParam(0);
52 return new Response($s);
55 function i_echoString($req)
57 return i_echoParam($req);
60 function i_echoInteger($req)
62 return i_echoParam($req);
65 function i_echoFloat($req)
67 return i_echoParam($req);
70 function i_echoStruct($req)
72 return i_echoParam($req);
75 function i_echoStringArray($req)
77 return i_echoParam($req);
80 function i_echoIntegerArray($req)
82 return i_echoParam($req);
85 function i_echoFloatArray($req)
87 return i_echoParam($req);
90 function i_echoStructArray($req)
92 return i_echoParam($req);
95 function i_echoValue($req)
97 return i_echoParam($req);
100 function i_echoBase64($req)
102 return i_echoParam($req);
105 function i_echoDate($req)
107 return i_echoParam($req);
110 $i_whichToolkit_sig = array(array(Value::$xmlrpcStruct));
111 $i_whichToolkit_doc = "Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
113 function i_whichToolkit($req)
115 global $SERVER_SOFTWARE;
117 "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
118 "toolkitName" => PhpXmlRpc\PhpXmlRpc::$xmlrpcName,
119 "toolkitVersion" => PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion,
120 "toolkitOperatingSystem" => isset($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE'],
123 $encoder = new PhpXmlRpc\Encoder();
124 return new Response($encoder->encode($ret));
128 "interopEchoTests.echoString" => array(
129 "function" => "i_echoString",
130 "signature" => $i_echoString_sig,
131 "docstring" => $i_echoString_doc,
133 "interopEchoTests.echoStringArray" => array(
134 "function" => "i_echoStringArray",
135 "signature" => $i_echoStringArray_sig,
136 "docstring" => $i_echoStringArray_doc,
138 "interopEchoTests.echoInteger" => array(
139 "function" => "i_echoInteger",
140 "signature" => $i_echoInteger_sig,
141 "docstring" => $i_echoInteger_doc,
143 "interopEchoTests.echoIntegerArray" => array(
144 "function" => "i_echoIntegerArray",
145 "signature" => $i_echoIntegerArray_sig,
146 "docstring" => $i_echoIntegerArray_doc,
148 "interopEchoTests.echoFloat" => array(
149 "function" => "i_echoFloat",
150 "signature" => $i_echoFloat_sig,
151 "docstring" => $i_echoFloat_doc,
153 "interopEchoTests.echoFloatArray" => array(
154 "function" => "i_echoFloatArray",
155 "signature" => $i_echoFloatArray_sig,
156 "docstring" => $i_echoFloatArray_doc,
158 "interopEchoTests.echoStruct" => array(
159 "function" => "i_echoStruct",
160 "signature" => $i_echoStruct_sig,
161 "docstring" => $i_echoStruct_doc,
163 "interopEchoTests.echoStructArray" => array(
164 "function" => "i_echoStructArray",
165 "signature" => $i_echoStructArray_sig,
166 "docstring" => $i_echoStructArray_doc,
168 "interopEchoTests.echoValue" => array(
169 "function" => "i_echoValue",
170 "signature" => $i_echoValue_sig,
171 "docstring" => $i_echoValue_doc,
173 "interopEchoTests.echoBase64" => array(
174 "function" => "i_echoBase64",
175 "signature" => $i_echoBase64_sig,
176 "docstring" => $i_echoBase64_doc,
178 "interopEchoTests.echoDate" => array(
179 "function" => "i_echoDate",
180 "signature" => $i_echoDate_sig,
181 "docstring" => $i_echoDate_doc,
183 "interopEchoTests.whichToolkit" => array(
184 "function" => "i_whichToolkit",
185 "signature" => $i_whichToolkit_sig,
186 "docstring" => $i_whichToolkit_doc,