Merge branch 'master' of github.com:gggeek/phpxmlrpc
[plcapi.git] / debugger / action.php
index 076b1c0..09f9b88 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * @author Gaetano Giunta
- * @copyright (C) 2005-2020 G. Giunta
+ * @copyright (C) 2005-2021 G. Giunta
  * @license code licensed under the BSD License: see file license.txt
  *
  * @todo switch params for http compression from 0,1,2 to values to be used directly
@@ -16,7 +16,8 @@ header('Content-Type: text/html; charset=utf-8');
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
 <head>
-    <title>XMLRPC Debugger</title>
+    <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico">
+    <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSONRPC'; else echo 'XMLRPC'; ?> Debugger</title>
     <meta name="robots" content="index,nofollow"/>
     <style type="text/css">
         <!--
@@ -92,10 +93,8 @@ header('Content-Type: text/html; charset=utf-8');
 <?php
 
 include __DIR__ . '/common.php';
-if ($action) {
 
-    include_once __DIR__ . "/../src/Autoloader.php";
-    PhpXmlRpc\Autoloader::register();
+if ($action) {
 
     // make sure the script waits long enough for the call to complete...
     if ($timeout) {
@@ -103,16 +102,16 @@ if ($action) {
     }
 
     if ($wstype == 1) {
-        @include 'jsonrpc.inc';
-        if (!class_exists('jsonrpc_client')) {
-            die('Error: to debug the jsonrpc protocol the jsonrpc.inc file is needed');
+        //@include 'jsonrpc.inc';
+        if (!class_exists('\PhpXmlRpc\JsonRpc\Client')) {
+            die('Error: to debug the jsonrpc protocol the phpxmlrpc/jsonrpc package is needed');
         }
-        $clientClass = 'PhpJsRpc\Client';
-        $requestClass = 'PhpJsRpc\Request';
+        $clientClass = '\PhpXmlRpc\JsonRpc\Client';
+        $requestClass = '\PhpXmlRpc\JsonRpc\Request';
         $protoName = 'JSONRPC';
     } else {
-        $clientClass = 'PhpXmlRpc\Client';
-        $requestClass = 'PhpXmlRpc\Request';
+        $clientClass = '\PhpXmlRpc\Client';
+        $requestClass = '\PhpXmlRpc\Request';
         $protoName = 'XMLRPC';
     }