fixes for recent changes to demo code
authorgggeek <giunta.gaetano@gmail.com>
Tue, 10 Jan 2023 10:15:16 +0000 (10:15 +0000)
committergggeek <giunta.gaetano@gmail.com>
Tue, 10 Jan 2023 10:15:16 +0000 (10:15 +0000)
demo/server/methodProviders/functions.php
demo/server/methodProviders/testsuite.php
demo/server/server.php

index cdb0e9b..44ef0a1 100644 (file)
@@ -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);
index 58f26b3..45c26db 100644 (file)
@@ -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,
     ),
index 4177927..bca8d12 100644 (file)
@@ -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');