+function i_echoDate($req)
+{
+ return i_echoParam($req);
+}
+
+$i_whichToolkit_sig = array(array(Value::$xmlrpcStruct));
+$i_whichToolkit_doc = "Returns a struct containing the following strings: toolkitDocsUrl, toolkitName, toolkitVersion, toolkitOperatingSystem.";
+
+function i_whichToolkit($req)
+{
+ global $SERVER_SOFTWARE;
+ $ret = array(
+ "toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/",
+ "toolkitName" => PhpXmlRpc\PhpXmlRpc::$xmlrpcName,
+ "toolkitVersion" => PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion,
+ "toolkitOperatingSystem" => isset($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE'],
+ );
+
+ $encoder = new PhpXmlRpc\Encoder();
+ return new PhpXmlRpc\Response($encoder->encode($ret));
+}
+
+$object = new xmlrpcServerMethodsContainer();
+$signatures = array(
+ "examples.getStateName" => array(
+ "function" => "findState",
+ "signature" => $findstate_sig,
+ "docstring" => $findstate_doc,
+ ),
+ "examples.sortByAge" => array(
+ "function" => "ageSorter",
+ "signature" => $agesorter_sig,
+ "docstring" => $agesorter_doc,
+ ),
+ "examples.addtwo" => array(
+ "function" => "addTwo",
+ "signature" => $addtwo_sig,
+ "docstring" => $addtwo_doc,
+ ),
+ "examples.addtwodouble" => array(
+ "function" => "addTwoDouble",
+ "signature" => $addtwodouble_sig,
+ "docstring" => $addtwodouble_doc,
+ ),
+ "examples.stringecho" => array(
+ "function" => "stringEcho",
+ "signature" => $stringecho_sig,
+ "docstring" => $stringecho_doc,
+ ),
+ "examples.echo" => array(
+ "function" => "echoBack",
+ "signature" => $echoback_sig,
+ "docstring" => $echoback_doc,
+ ),
+ "examples.decode64" => array(
+ "function" => "echoSixtyFour",
+ "signature" => $echosixtyfour_sig,
+ "docstring" => $echosixtyfour_doc,
+ ),
+ "examples.invertBooleans" => array(
+ "function" => "bitFlipper",
+ "signature" => $bitflipper_sig,
+ "docstring" => $bitflipper_doc,
+ ),
+ // signature omitted on purpose
+ "tests.generatePHPWarning" => array(
+ "function" => array($object, "phpWarningGenerator"),
+ ),
+ // signature omitted on purpose
+ "tests.raiseException" => array(
+ "function" => array($object, "exceptionGenerator"),
+ ),
+ // Greek word 'kosme'. NB: NOT a valid ISO8859 string!
+ // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods
+ "tests.utf8methodname." . 'κόσμε' => array(
+ "function" => "stringEcho",
+ "signature" => $stringecho_sig,
+ "docstring" => $stringecho_doc,
+ ),
+ /*"tests.iso88591methodname." . chr(224) . chr(252) . chr(232) => array(
+ "function" => "stringEcho",
+ "signature" => $stringecho_sig,
+ "docstring" => $stringecho_doc,
+ ),*/
+ "examples.getallheaders" => array(
+ "function" => 'getAllHeaders_xmlrpc',
+ "signature" => $getallheaders_sig,
+ "docstring" => $getallheaders_doc,
+ ),
+ "examples.setcookies" => array(
+ "function" => 'setCookies',
+ "signature" => $setcookies_sig,
+ "docstring" => $setcookies_doc,
+ ),
+ "examples.getcookies" => array(
+ "function" => 'getCookies',
+ "signature" => $getcookies_sig,
+ "docstring" => $getcookies_doc,
+ ),
+ "mail.send" => array(
+ "function" => "mailSend",
+ "signature" => $mailsend_sig,
+ "docstring" => $mailsend_doc,
+ ),
+ "validator1.arrayOfStructsTest" => array(
+ "function" => "v1_arrayOfStructs",
+ "signature" => $v1_arrayOfStructs_sig,
+ "docstring" => $v1_arrayOfStructs_doc,
+ ),
+ "validator1.easyStructTest" => array(
+ "function" => "v1_easyStruct",
+ "signature" => $v1_easyStruct_sig,
+ "docstring" => $v1_easyStruct_doc,
+ ),
+ "validator1.echoStructTest" => array(
+ "function" => "v1_echoStruct",
+ "signature" => $v1_echoStruct_sig,
+ "docstring" => $v1_echoStruct_doc,
+ ),
+ "validator1.manyTypesTest" => array(
+ "function" => "v1_manyTypes",
+ "signature" => $v1_manyTypes_sig,
+ "docstring" => $v1_manyTypes_doc,
+ ),
+ "validator1.moderateSizeArrayCheck" => array(
+ "function" => "v1_moderateSizeArrayCheck",
+ "signature" => $v1_moderateSizeArrayCheck_sig,
+ "docstring" => $v1_moderateSizeArrayCheck_doc,
+ ),
+ "validator1.simpleStructReturnTest" => array(
+ "function" => "v1_simpleStructReturn",
+ "signature" => $v1_simpleStructReturn_sig,
+ "docstring" => $v1_simpleStructReturn_doc,
+ ),
+ "validator1.nestedStructTest" => array(
+ "function" => "v1_nestedStruct",
+ "signature" => $v1_nestedStruct_sig,
+ "docstring" => $v1_nestedStruct_doc,
+ ),
+ "validator1.countTheEntities" => array(
+ "function" => "v1_countTheEntities",
+ "signature" => $v1_countTheEntities_sig,
+ "docstring" => $v1_countTheEntities_doc,
+ ),
+ "interopEchoTests.echoString" => array(
+ "function" => "i_echoString",
+ "signature" => $i_echoString_sig,
+ "docstring" => $i_echoString_doc,
+ ),
+ "interopEchoTests.echoStringArray" => array(
+ "function" => "i_echoStringArray",
+ "signature" => $i_echoStringArray_sig,
+ "docstring" => $i_echoStringArray_doc,
+ ),
+ "interopEchoTests.echoInteger" => array(
+ "function" => "i_echoInteger",
+ "signature" => $i_echoInteger_sig,
+ "docstring" => $i_echoInteger_doc,
+ ),
+ "interopEchoTests.echoIntegerArray" => array(
+ "function" => "i_echoIntegerArray",
+ "signature" => $i_echoIntegerArray_sig,
+ "docstring" => $i_echoIntegerArray_doc,
+ ),
+ "interopEchoTests.echoFloat" => array(
+ "function" => "i_echoFloat",
+ "signature" => $i_echoFloat_sig,
+ "docstring" => $i_echoFloat_doc,
+ ),
+ "interopEchoTests.echoFloatArray" => array(
+ "function" => "i_echoFloatArray",
+ "signature" => $i_echoFloatArray_sig,
+ "docstring" => $i_echoFloatArray_doc,
+ ),
+ "interopEchoTests.echoStruct" => array(
+ "function" => "i_echoStruct",
+ "signature" => $i_echoStruct_sig,
+ "docstring" => $i_echoStruct_doc,
+ ),
+ "interopEchoTests.echoStructArray" => array(
+ "function" => "i_echoStructArray",
+ "signature" => $i_echoStructArray_sig,
+ "docstring" => $i_echoStructArray_doc,
+ ),
+ "interopEchoTests.echoValue" => array(
+ "function" => "i_echoValue",
+ "signature" => $i_echoValue_sig,
+ "docstring" => $i_echoValue_doc,
+ ),
+ "interopEchoTests.echoBase64" => array(
+ "function" => "i_echoBase64",
+ "signature" => $i_echoBase64_sig,
+ "docstring" => $i_echoBase64_doc,
+ ),
+ "interopEchoTests.echoDate" => array(
+ "function" => "i_echoDate",
+ "signature" => $i_echoDate_sig,
+ "docstring" => $i_echoDate_doc,
+ ),
+ "interopEchoTests.whichToolkit" => array(
+ "function" => "i_whichToolkit",
+ "signature" => $i_whichToolkit_sig,
+ "docstring" => $i_whichToolkit_doc,
+ ),
+
+ 'tests.getStateName.2' => $findstate2_sig,
+ 'tests.getStateName.3' => $findstate3_sig,
+ 'tests.getStateName.4' => $findstate4_sig,
+ 'tests.getStateName.5' => $findstate5_sig,
+ 'tests.getStateName.6' => $findstate6_sig,
+ 'tests.getStateName.7' => $findstate7_sig,
+ 'tests.getStateName.8' => $findstate8_sig,
+ 'tests.getStateName.9' => $findstate9_sig,
+ 'tests.getStateName.10' => $findstate10_sig,
+
+);
+
+$signatures = array_merge($signatures, $moreSignatures);
+
+$s = new PhpXmlRpc\Server($signatures, false);
+$s->setdebug(3);
+$s->compress_response = true;
+
+// out-of-band information: let the client manipulate the server operations.
+// we do this to help the testsuite script: do not reproduce in production!
+if (isset($_GET['RESPONSE_ENCODING'])) {
+ $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
+}
+if (isset($_GET['EXCEPTION_HANDLING'])) {
+ $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
+}
+$s->service();
+// that should do all we need!
+
+// out-of-band information: let the client manipulate the server operations.
+// we do this to help the testsuite script: do not reproduce in production!
+if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
+ include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php";
+}