From dc6db7f4aee82a39caa7eab7c3322b4119488e24 Mon Sep 17 00:00:00 2001 From: gggeek Date: Tue, 10 Jan 2023 10:15:16 +0000 Subject: [PATCH] fixes for recent changes to demo code --- demo/server/methodProviders/functions.php | 8 ++++---- demo/server/methodProviders/testsuite.php | 3 ++- demo/server/server.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/demo/server/methodProviders/functions.php b/demo/server/methodProviders/functions.php index cdb0e9be..44ef0a19 100644 --- a/demo/server/methodProviders/functions.php +++ b/demo/server/methodProviders/functions.php @@ -146,7 +146,7 @@ And the array will be returned with the entries sorted by their numbers.'; public static $stringecho_sig = array(array('string', 'string')); public static $stringecho_doc = 'Accepts a string parameter, returns the string.'; - function stringEcho($req) + public static function stringEcho($req) { // just sends back a string return new Response(new Value($req->getParam(0)->scalarval())); @@ -154,7 +154,7 @@ And the array will be returned with the entries sorted by their numbers.'; public static $echoback_sig = array(array('string', 'string')); public static $echoback_doc = 'Accepts a string parameter, returns the entire incoming payload'; - function echoBack($req) + public static function echoBack($req) { // just sends back a string with what I got sent to me, that's all (escaping for xml is automatic) $s = "I got the following message:\n" . $req->serialize(); @@ -164,7 +164,7 @@ And the array will be returned with the entries sorted by their numbers.'; public static $echosixtyfour_sig = array(array('string', 'base64')); public static $echosixtyfour_doc = 'Accepts a base64 parameter and returns it decoded as a string'; - function echoSixtyFour($req) + public static function echoSixtyFour($req) { // Accepts an encoded value, but sends it back as a normal string. // This is to test that base64 encoding is working as expected @@ -175,7 +175,7 @@ And the array will be returned with the entries sorted by their numbers.'; public static $bitflipper_sig = array(array('array', 'array')); public static $bitflipper_doc = 'Accepts an array of booleans, and returns them inverted'; - function bitFlipper($req) + public static function bitFlipper($req) { $v = $req->getParam(0); $rv = new Value(array(), Value::$xmlrpcArray); diff --git a/demo/server/methodProviders/testsuite.php b/demo/server/methodProviders/testsuite.php index 58f26b30..45c26dbb 100644 --- a/demo/server/methodProviders/testsuite.php +++ b/demo/server/methodProviders/testsuite.php @@ -4,6 +4,7 @@ * * To use this, use something akin to: * $signatures = include('tests.php'); + * NB: requires 'functions.php' to be included first * * Methods used by the phpxmlrpc testsuite */ @@ -92,7 +93,7 @@ return array( // 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" => "\\exampleMethods::stringEcho", + "function" => "exampleMethods::stringEcho", "signature" => exampleMethods::$stringecho_sig, "docstring" => exampleMethods::$stringecho_doc, ), diff --git a/demo/server/server.php b/demo/server/server.php index 41779279..bca8d122 100644 --- a/demo/server/server.php +++ b/demo/server/server.php @@ -30,7 +30,7 @@ $signatures3 = include(__DIR__.'/methodProviders/validator1.php'); $signatures = array_merge($signatures1, $signatures2, $signatures3); -if (defined('TESTMODE') || true) { +if (defined('TESTMODE')) { // Webservices used only by the testsuite - do not use them in production $signatures4 = include(__DIR__.'/methodProviders/testsuite.php'); $signatures5 = include(__DIR__.'/methodProviders/wrapper.php'); -- 2.47.0