X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Faction.php;h=3e22c692ad1085c680fadf78eeb50518e22e43c8;hb=e1923b6d55b69e592b2fba8ce0f097751416823e;hp=4c39c6297f1ad95c35ca36137e12479626805e13;hpb=885d7355f6b00f4b7f931d4d50c0e7b31d29bb32;p=plcapi.git
diff --git a/debugger/action.php b/debugger/action.php
index 4c39c62..3e22c69 100644
--- a/debugger/action.php
+++ b/debugger/action.php
@@ -2,12 +2,15 @@
/**
* @author Gaetano Giunta
* @copyright (C) 2005-2015 G. Giunta
- * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
+ * @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
* @todo use ob_start to catch debug info and echo it AFTER method call results?
* @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj
**/
+
+header('Content-Type: text/html; charset=utf-8');
+
?>
@@ -91,31 +94,33 @@
include __DIR__ . '/common.php';
if ($action) {
+ include_once __DIR__ . "/../src/Autoloader.php";
+ PhpXmlRpc\Autoloader::register();
+
// make sure the script waits long enough for the call to complete...
if ($timeout) {
set_time_limit($timeout + 10);
}
- include 'xmlrpc.inc';
if ($wstype == 1) {
@include 'jsonrpc.inc';
if (!class_exists('jsonrpc_client')) {
die('Error: to debug the jsonrpc protocol the jsonrpc.inc file is needed');
}
- $clientclass = 'jsonrpc_client';
- $msgclass = 'jsonrpcmsg';
- $protoname = 'JSONRPC';
+ $clientClass = 'PhpJsRpc\Client';
+ $requestClass = 'PhpJsRpc\Request';
+ $protoName = 'JSONRPC';
} else {
- $clientclass = 'xmlrpc_client';
- $msgclass = 'xmlrpcmsg';
- $protoname = 'XMLRPC';
+ $clientClass = 'PhpXmlRpc\Client';
+ $requestClass = 'PhpXmlRpc\Request';
+ $protoName = 'XMLRPC';
}
if ($port != "") {
- $client = new $clientclass($path, $host, $port);
+ $client = new $clientClass($path, $host, $port);
$server = "$host:$port$path";
} else {
- $client = new $clientclass($path, $host);
+ $client = new $clientClass($path, $host);
$server = "$host$path";
}
if ($protocol == 2) {
@@ -189,30 +194,24 @@ if ($action) {
$msg = array();
switch ($action) {
-
- case 'wrap':
- @include 'xmlrpc_wrappers.inc';
- if (!function_exists('build_remote_method_wrapper_code')) {
- die('Error: to enable creation of method stubs the xmlrpc_wrappers.inc file is needed');
- }
// fall thru intentionally
case 'describe':
case 'wrap':
- $msg[0] = new $msgclass('system.methodHelp', array(), $id);
- $msg[0]->addparam(new xmlrpcval($method));
- $msg[1] = new $msgclass('system.methodSignature', array(), $id + 1);
- $msg[1]->addparam(new xmlrpcval($method));
+ $msg[0] = new $requestClass('system.methodHelp', array(), $id);
+ $msg[0]->addparam(new PhpXmlRpc\Value($method));
+ $msg[1] = new $requestClass('system.methodSignature', array(), $id + 1);
+ $msg[1]->addparam(new PhpXmlRpc\Value($method));
$actionname = 'Description of method "' . $method . '"';
break;
case 'list':
- $msg[0] = new $msgclass('system.listMethods', array(), $id);
+ $msg[0] = new $requestClass('system.listMethods', array(), $id);
$actionname = 'List of available methods';
break;
case 'execute':
if (!payload_is_safe($payload)) {
die("Tsk tsk tsk, please stop it or I will have to call in the cops!");
}
- $msg[0] = new $msgclass($method, array(), $id);
+ $msg[0] = new $requestClass($method, array(), $id);
// hack! build xml payload by hand
if ($wstype == 1) {
$msg[0]->payload = "{\n" .
@@ -230,7 +229,7 @@ if ($action) {
}
}
} else {
- $msg[0]->payload = $msg[0]->xml_header() .
+ $msg[0]->payload = $msg[0]->xml_header($inputcharset) .
'
Fault code: [" . htmlspecialchars($response->faultCode()) . - "] Reason: '" . htmlspecialchars($response->faultString()) . "'
\n"; + //echo 'Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . + "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'
\n"; echo(strftime("%d/%b/%Y:%H:%M:%S\n")); } else { // call succeeded: parse results - //echo 'Method | " . htmlspecialchars($method) . " | ||
---|---|---|---|
Method | " . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . " | \n";
@@ -504,7 +506,7 @@ if ($action) {
// no action taken yet: give some instructions on debugger usage
?>
- Instructions on usage of the debugger:+Instructions on usage of the debugger
Example:+Example
Server Address: phpxmlrpc.sourceforge.net Notice:+Noticeall usernames and passwords entered on the above form will be written to the web server logs of this server. Use with care. Changelog
|