@@ -18,8 +18,8 @@ |
||
18 | 18 | header('Content-Type: text/html; charset=utf-8'); |
19 | 19 | |
20 | 20 | global $inputcharset, $debug, $protocol, $run, $hasjsonrpcclient, $wstype, $id, $host, $port, $path, $action, $method, $methodsig, |
21 | - $payload, $alt_payload, $username, $password, $authtype, $verifyhost, $verifypeer, $cainfo, $proxy, $proxyuser, |
|
22 | - $proxypwd, $timeout, $requestcompression, $responsecompression, $clientcookies; |
|
21 | + $payload, $alt_payload, $username, $password, $authtype, $verifyhost, $verifypeer, $cainfo, $proxy, $proxyuser, |
|
22 | + $proxypwd, $timeout, $requestcompression, $responsecompression, $clientcookies; |
|
23 | 23 | |
24 | 24 | include __DIR__ . '/common.php'; |
25 | 25 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $payload, $alt_payload, $username, $password, $authtype, $verifyhost, $verifypeer, $cainfo, $proxy, $proxyuser, |
22 | 22 | $proxypwd, $timeout, $requestcompression, $responsecompression, $clientcookies; |
23 | 23 | |
24 | -include __DIR__ . '/common.php'; |
|
24 | +include __DIR__.'/common.php'; |
|
25 | 25 | |
26 | 26 | if ($action == '') { |
27 | 27 | $action = 'list'; |
@@ -38,30 +38,30 @@ discard block |
||
38 | 38 | /// @const JSXMLRPC_PATH Path to the visual xml-rpc editing dialog's containing folder. Can be absolute, or |
39 | 39 | /// relative to this debugger's folder. |
40 | 40 | if (defined('JSXMLRPC_PATH')) { |
41 | - $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__ . '/' . JSXMLRPC_PATH)); |
|
41 | + $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__.'/'.JSXMLRPC_PATH)); |
|
42 | 42 | } else { |
43 | 43 | $editorpaths = array( |
44 | - __DIR__ . '/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile |
|
45 | - __DIR__ . '/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer inside the debugger |
|
46 | - __DIR__ . '/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm inside the debugger |
|
47 | - __DIR__ . '/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer |
|
48 | - __DIR__ . '/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm |
|
49 | - __DIR__ . '/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too |
|
50 | - __DIR__ . '/../../../../debugger/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level via taskfile (ie. jsonrpc) |
|
51 | - __DIR__ . '/../../../../debugger/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via composer |
|
52 | - __DIR__ . '/../../../../debugger/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via npm |
|
53 | - __DIR__ . '/../../../../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm in the top-level project |
|
44 | + __DIR__.'/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile |
|
45 | + __DIR__.'/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer inside the debugger |
|
46 | + __DIR__.'/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm inside the debugger |
|
47 | + __DIR__.'/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer |
|
48 | + __DIR__.'/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm |
|
49 | + __DIR__.'/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too |
|
50 | + __DIR__.'/../../../../debugger/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level via taskfile (ie. jsonrpc) |
|
51 | + __DIR__.'/../../../../debugger/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via composer |
|
52 | + __DIR__.'/../../../../debugger/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via npm |
|
53 | + __DIR__.'/../../../../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm in the top-level project |
|
54 | 54 | ); |
55 | 55 | } |
56 | - foreach($editorpaths as $editorpath) { |
|
57 | - if (is_file(realpath($editorpath . 'visualeditor.html'))) { |
|
56 | + foreach ($editorpaths as $editorpath) { |
|
57 | + if (is_file(realpath($editorpath.'visualeditor.html'))) { |
|
58 | 58 | $haseditor = true; |
59 | 59 | break; |
60 | 60 | } |
61 | 61 | } |
62 | 62 | if ($haseditor) { |
63 | - $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
64 | - $editorurlpath = $controllerRootUrl . '/' . preg_replace('|^' . preg_quote(__DIR__, '|') .'|', '', $editorpath); |
|
63 | + $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
64 | + $editorurlpath = $controllerRootUrl.'/'.preg_replace('|^'.preg_quote(__DIR__, '|').'|', '', $editorpath); |
|
65 | 65 | /// @todo for cases above 4 and up, look at $controllerRootUrl and check if the web root is not pointing directly |
66 | 66 | /// at this folder, as in that case the link to the visualeditor will not |
67 | 67 | /// work, as it will be in the form http(s)://domain/../../jsxmlrpc/debugger/visualeditor.html |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | function activateeditor() { |
249 | - var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array( "\\\\", "\\'"), $alt_payload); ?>'; |
|
249 | + var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array("\\\\", "\\'"), $alt_payload); ?>'; |
|
250 | 250 | if (document.frmaction.wstype.value == "1" || document.frmaction.wstype.value == "2") |
251 | 251 | url += '&type=jsonrpc'; |
252 | 252 | var wnd = window.open(url, '_blank', 'width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1'); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | JSON-RPC 1.0 '; |
295 | 295 | } ?> |
296 | 296 | Debugger</h1><h3>(based on <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a>, ver. <?php echo htmlspecialchars(\PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion)?> |
297 | -<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. ' . htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); ?>)</h3> |
|
297 | +<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. '.htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); ?>)</h3> |
|
298 | 298 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
299 | 299 | |
300 | 300 | <table id="serverblock"> |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | </select> |
356 | 356 | </td> |
357 | 357 | <td class="labelcell">Timeout:</td> |
358 | - <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> |
|
358 | + <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> |
|
359 | 359 | <td></td> |
360 | 360 | <td></td> |
361 | 361 | </tr> |
@@ -71,7 +71,12 @@ discard block |
||
71 | 71 | <html lang="en"> |
72 | 72 | <head> |
73 | 73 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
74 | - <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
74 | + <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) { |
|
75 | + echo 'JSON-RPC'; |
|
76 | +} else { |
|
77 | + echo 'XML-RPC'; |
|
78 | +} |
|
79 | +?> Debugger</title> |
|
75 | 80 | <meta name="robots" content="index,nofollow"/> |
76 | 81 | <script type="text/javascript" language="Javascript"> |
77 | 82 | if (window.name != 'frmcontroller') |
@@ -279,14 +284,18 @@ discard block |
||
279 | 284 | </script> |
280 | 285 | </head> |
281 | 286 | <body |
282 | - onload="<?php if ($hasjsonrpcclient) echo "switchtransport($wstype); " ?>switchaction(); switchssl(); switchauth(); swicthcainfo();<?php if ($run) { |
|
287 | + onload="<?php if ($hasjsonrpcclient) { |
|
288 | + echo "switchtransport($wstype); " ?>switchaction(); switchssl(); switchauth(); swicthcainfo();<?php if ($run) { |
|
283 | 289 | echo ' document.frmaction.submit();'; |
290 | +} |
|
284 | 291 | } ?>"> |
285 | 292 | <h1>XML-RPC |
286 | 293 | <?php if ($hasjsonrpcclient) { |
287 | 294 | echo '<form name="frmxmlrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(0);"'; |
288 | 295 | // q: does this if make sense at all? |
289 | - if (!class_exists('\PhpXmlRpc\Client')) echo ' disabled="disabled"'; |
|
296 | + if (!class_exists('\PhpXmlRpc\Client')) { |
|
297 | + echo ' disabled="disabled"'; |
|
298 | + } |
|
290 | 299 | echo ' /></form>'; |
291 | 300 | echo ' / <form name="frmjsonrpc2" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(2);"/></form> |
292 | 301 | JSON-RPC 2.0 '; |
@@ -294,7 +303,10 @@ discard block |
||
294 | 303 | JSON-RPC 1.0 '; |
295 | 304 | } ?> |
296 | 305 | Debugger</h1><h3>(based on <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a>, ver. <?php echo htmlspecialchars(\PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion)?> |
297 | -<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. ' . htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); ?>)</h3> |
|
306 | +<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) { |
|
307 | + echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. ' . htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); |
|
308 | +} |
|
309 | +?>)</h3> |
|
298 | 310 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
299 | 311 | |
300 | 312 | <table id="serverblock"> |
@@ -13,7 +13,12 @@ |
||
13 | 13 | <html lang="en"> |
14 | 14 | <head> |
15 | 15 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
16 | - <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
16 | + <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) { |
|
17 | + echo 'JSON-RPC'; |
|
18 | +} else { |
|
19 | + echo 'XML-RPC'; |
|
20 | +} |
|
21 | +?> Debugger</title> |
|
17 | 22 | </head> |
18 | 23 | <frameset rows="360,*"> |
19 | 24 | <frame name="frmcontroller" src="controller.php<?php echo htmlspecialchars($query); ?>" marginwidth="0" |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | // assume this is either a standalone install, or installed as Composer dependency |
21 | 21 | /// @todo if the latter is true, should we just not skip using the custom Autoloader, and let a top-level |
22 | 22 | /// debugger include this one, taking care of autoloading? |
23 | - include_once __DIR__ . "/../src/Autoloader.php"; |
|
23 | + include_once __DIR__."/../src/Autoloader.php"; |
|
24 | 24 | PhpXmlRpc\Autoloader::register(); |
25 | 25 | } |
26 | 26 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | // Variables that shouldn't be unset |
37 | - $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); |
|
37 | + $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); |
|
38 | 38 | |
39 | 39 | $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, |
40 | 40 | isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array() |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | $wstype = defined('DEFAULT_WSTYPE') ? DEFAULT_WSTYPE : 0; |
86 | 86 | $id = ''; |
87 | 87 | if (isset($_GET['action'])) { |
88 | - if (isset($_GET['wstype']) && ($_GET['wstype'] == '2' || $_GET['wstype'] == '1' || $_GET['wstype'] == '0')) { |
|
89 | - $wstype = (int)$_GET['wstype']; |
|
88 | + if (isset($_GET['wstype']) && ($_GET['wstype'] == '2' || $_GET['wstype'] == '1' || $_GET['wstype'] == '0')) { |
|
89 | + $wstype = (int) $_GET['wstype']; |
|
90 | 90 | if (($wstype === 1 || $wstype === 2) && !$hasjsonrpcclient) { |
91 | 91 | $wstype = 0; |
92 | 92 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $host = isset($_GET['host']) ? $_GET['host'] : 'localhost'; // using '' will trigger an xml-rpc error... |
98 | 98 | if (isset($_GET['protocol']) && ($_GET['protocol'] == '1' || $_GET['protocol'] == '2' || $_GET['protocol'] == '3' |
99 | 99 | || $_GET['protocol'] == '4')) { |
100 | - $protocol = (int)$_GET['protocol']; |
|
100 | + $protocol = (int) $_GET['protocol']; |
|
101 | 101 | } |
102 | 102 | if (strpos($host, 'http://') === 0) { |
103 | 103 | // NB: if protocol is https or h2, it will override http:// |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | $protocol = 2; |
110 | 110 | } |
111 | 111 | } |
112 | - $port = isset($_GET['port']) ? (int)$_GET['port'] : ''; |
|
112 | + $port = isset($_GET['port']) ? (int) $_GET['port'] : ''; |
|
113 | 113 | if ($port === 0) { |
114 | 114 | $port = ''; |
115 | 115 | } |
116 | 116 | $path = isset($_GET['path']) ? $_GET['path'] : ''; |
117 | 117 | // in case user forgot initial '/' in xml-rpc server path, add it back |
118 | 118 | if ($path && ($path[0]) != '/') { |
119 | - $path = '/' . $path; |
|
119 | + $path = '/'.$path; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | if (isset($_GET['debug']) && ($_GET['debug'] == '1' || $_GET['debug'] == '2')) { |
123 | - $debug = (int)$_GET['debug']; |
|
123 | + $debug = (int) $_GET['debug']; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | $verifyhost = (isset($_GET['verifyhost']) && ($_GET['verifyhost'] == '1' || $_GET['verifyhost'] == '2')) ? $_GET['verifyhost'] : 0; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | /// @todo what about an https proxy? |
138 | 138 | $proxyuser = isset($_GET['proxyuser']) ? $_GET['proxyuser'] : ''; |
139 | 139 | $proxypwd = isset($_GET['proxypwd']) ? $_GET['proxypwd'] : ''; |
140 | - $timeout = isset($_GET['timeout']) ? (int)$_GET['timeout'] : 0; |
|
140 | + $timeout = isset($_GET['timeout']) ? (int) $_GET['timeout'] : 0; |
|
141 | 141 | $action = $_GET['action']; |
142 | 142 | |
143 | 143 | $method = isset($_GET['method']) ? $_GET['method'] : ''; |
@@ -152,15 +152,15 @@ discard block |
||
152 | 152 | $username = isset($_GET['username']) ? $_GET['username'] : ''; |
153 | 153 | $password = isset($_GET['password']) ? $_GET['password'] : ''; |
154 | 154 | |
155 | - $authtype = (isset($_GET['authtype']) && ($_GET['authtype'] == '2' || $_GET['authtype'] == '8')) ? (int)$_GET['authtype'] : 1; |
|
155 | + $authtype = (isset($_GET['authtype']) && ($_GET['authtype'] == '2' || $_GET['authtype'] == '8')) ? (int) $_GET['authtype'] : 1; |
|
156 | 156 | |
157 | 157 | if (isset($_GET['requestcompression']) && ($_GET['requestcompression'] == '1' || $_GET['requestcompression'] == '2')) { |
158 | - (int)$requestcompression = $_GET['requestcompression']; |
|
158 | + (int) $requestcompression = $_GET['requestcompression']; |
|
159 | 159 | } else { |
160 | 160 | $requestcompression = 0; |
161 | 161 | } |
162 | 162 | if (isset($_GET['responsecompression']) && ($_GET['responsecompression'] == '1' || $_GET['responsecompression'] == '2' || $_GET['responsecompression'] == '3')) { |
163 | - $responsecompression = (int)$_GET['responsecompression']; |
|
163 | + $responsecompression = (int) $_GET['responsecompression']; |
|
164 | 164 | } else { |
165 | 165 | $responsecompression = 0; |
166 | 166 | } |
@@ -79,8 +79,8 @@ |
||
79 | 79 | <?php |
80 | 80 | |
81 | 81 | global $inputcharset, $debug, $protocol, $run, $hasjsonrpcclient, $wstype, $id, $host, $port, $path, $action, $method, $methodsig, |
82 | - $payload, $alt_payload, $username, $password, $authtype, $verifyhost, $verifypeer, $cainfo, $proxy, $proxyuser, |
|
83 | - $proxypwd, $timeout, $requestcompression, $responsecompression, $clientcookies; |
|
82 | + $payload, $alt_payload, $username, $password, $authtype, $verifyhost, $verifypeer, $cainfo, $proxy, $proxyuser, |
|
83 | + $proxypwd, $timeout, $requestcompression, $responsecompression, $clientcookies; |
|
84 | 84 | |
85 | 85 | include __DIR__ . '/common.php'; |
86 | 86 |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $payload, $alt_payload, $username, $password, $authtype, $verifyhost, $verifypeer, $cainfo, $proxy, $proxyuser, |
83 | 83 | $proxypwd, $timeout, $requestcompression, $responsecompression, $clientcookies; |
84 | 84 | |
85 | -include __DIR__ . '/common.php'; |
|
85 | +include __DIR__.'/common.php'; |
|
86 | 86 | |
87 | 87 | if ($action) { |
88 | 88 | |
89 | 89 | // avoid php hanging when using the builtin webserver and sending requests to itself |
90 | 90 | $skip = false; |
91 | - if (php_sapi_name() === 'cli-server' && ((int)getenv('PHP_CLI_SERVER_WORKERS') < 2)) { |
|
91 | + if (php_sapi_name() === 'cli-server' && ((int) getenv('PHP_CLI_SERVER_WORKERS')<2)) { |
|
92 | 92 | $localHost = explode(':', $_SERVER['HTTP_HOST']); |
93 | 93 | /// @todo support also case where port is null (on either side), and when there is a Proxy in the parameters, |
94 | 94 | /// and that proxy is us |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if (!$skip) { |
102 | 102 | // make sure the script waits long enough for the call to complete... |
103 | 103 | if ($timeout) { |
104 | - set_time_limit($timeout + 10); |
|
104 | + set_time_limit($timeout+10); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if ($wstype == 1 || $wstype == 2) { |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | $server = "$host$path"; |
123 | 123 | } |
124 | 124 | if ($protocol == 2 || $protocol == 3) { |
125 | - $server = 'https://' . $server; |
|
125 | + $server = 'https://'.$server; |
|
126 | 126 | } else { |
127 | - $server = 'http://' . $server; |
|
127 | + $server = 'http://'.$server; |
|
128 | 128 | } |
129 | 129 | if ($proxy != '') { |
130 | 130 | $pproxy = explode(':', $proxy); |
131 | - if (count($pproxy) > 1) { |
|
131 | + if (count($pproxy)>1) { |
|
132 | 132 | $pport = $pproxy[1]; |
133 | 133 | } else { |
134 | 134 | $pport = 8080; |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | // fall thru intentionally |
202 | 202 | case 'describe': |
203 | 203 | case 'wrap': |
204 | - $msg[0] = new $requestClass('system.methodHelp', array(), (int)$id); |
|
204 | + $msg[0] = new $requestClass('system.methodHelp', array(), (int) $id); |
|
205 | 205 | $msg[0]->addparam(new PhpXmlRpc\Value($method)); |
206 | - $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1); |
|
206 | + $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1); |
|
207 | 207 | $msg[1]->addparam(new PhpXmlRpc\Value($method)); |
208 | 208 | if ($wstype == 2) { |
209 | 209 | $msg[0]->setJsonRpcVersion('2.0'); |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | $msg[0]->setJsonRpcVersion('1.0'); |
213 | 213 | $msg[1]->setJsonRpcVersion('1.0'); |
214 | 214 | } |
215 | - $actionname = 'Description of method "' . $method . '"'; |
|
215 | + $actionname = 'Description of method "'.$method.'"'; |
|
216 | 216 | break; |
217 | 217 | case 'list': |
218 | - $msg[0] = new $requestClass('system.listMethods', array(), (int)$id); |
|
218 | + $msg[0] = new $requestClass('system.listMethods', array(), (int) $id); |
|
219 | 219 | if ($wstype == 2) { |
220 | 220 | $msg[0]->setJsonRpcVersion('2.0'); |
221 | 221 | } elseif ($wstype == 1) { |
@@ -230,10 +230,10 @@ discard block |
||
230 | 230 | $msg[0] = new $requestClass($method, array(), $id); |
231 | 231 | // hack! build payload by hand |
232 | 232 | if ($wstype == 2) { |
233 | - $payload = "{\n" . |
|
234 | - '"jsonrpc": "2.0"' . "\n" . |
|
235 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
236 | - $payload . |
|
233 | + $payload = "{\n". |
|
234 | + '"jsonrpc": "2.0"'."\n". |
|
235 | + '"method": "'.$method."\",\n\"params\": [". |
|
236 | + $payload. |
|
237 | 237 | "\n],\n"; |
238 | 238 | // fix: if user gave an empty string, use NULL, or we'll break json syntax |
239 | 239 | if ($id != "") { |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | $msg[0]->setPayload($payload); |
248 | 248 | $msg[0]->setJsonRpcVersion('2.0'); |
249 | 249 | } elseif ($wstype == 1) { |
250 | - $payload = "{\n" . |
|
251 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
252 | - $payload . |
|
250 | + $payload = "{\n". |
|
251 | + '"method": "'.$method."\",\n\"params\": [". |
|
252 | + $payload. |
|
253 | 253 | "\n],\n\"id\": "; |
254 | 254 | // fix: if user gave an empty string, use NULL, or we'll break json syntax |
255 | 255 | if ($id == "") { |
@@ -265,22 +265,22 @@ discard block |
||
265 | 265 | $msg[0]->setJsonRpcVersion('1.0'); |
266 | 266 | } else { |
267 | 267 | $msg[0]->setPayload( |
268 | - $msg[0]->xml_header($inputcharset) . |
|
269 | - '<methodName>' . $method . "</methodName>\n<params>" . |
|
270 | - $payload . |
|
271 | - "</params>\n" . $msg[0]->xml_footer() |
|
268 | + $msg[0]->xml_header($inputcharset). |
|
269 | + '<methodName>'.$method."</methodName>\n<params>". |
|
270 | + $payload. |
|
271 | + "</params>\n".$msg[0]->xml_footer() |
|
272 | 272 | ); |
273 | 273 | } |
274 | - $actionname = 'Execution of method ' . $method; |
|
274 | + $actionname = 'Execution of method '.$method; |
|
275 | 275 | break; |
276 | 276 | default: // give a warning |
277 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; |
|
277 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; |
|
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
281 | 281 | // Before calling execute, echo out brief description of action taken + date and time ??? |
282 | 282 | // this gives good user feedback for long-running methods... |
283 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; |
|
283 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; |
|
284 | 284 | flush(); |
285 | 285 | |
286 | 286 | $response = null; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | break; |
298 | 298 | } |
299 | 299 | } |
300 | - $time = microtime(true) - $time; |
|
300 | + $time = microtime(true)-$time; |
|
301 | 301 | if ($debug) { |
302 | 302 | echo "</div>\n"; |
303 | 303 | } |
@@ -307,8 +307,8 @@ discard block |
||
307 | 307 | // call failed! echo out error msg! |
308 | 308 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; |
309 | 309 | echo "<h3>$protoName call FAILED!</h3>\n"; |
310 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
311 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; |
|
310 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
311 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; |
|
312 | 312 | echo(date("d/M/Y:H:i:s\n")); |
313 | 313 | } else { |
314 | 314 | // call succeeded: parse results |
@@ -324,36 +324,36 @@ discard block |
||
324 | 324 | $max = $v->count(); |
325 | 325 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
326 | 326 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; |
327 | - foreach($v as $i => $rec) { |
|
327 | + foreach ($v as $i => $rec) { |
|
328 | 328 | if ($i % 2) { |
329 | 329 | $class = ' class="oddrow"'; |
330 | 330 | } else { |
331 | 331 | $class = ' class="evenrow"'; |
332 | 332 | } |
333 | - echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . |
|
334 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
335 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
336 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
337 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
338 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
339 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
340 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
341 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
342 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
343 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
344 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
345 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
346 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
347 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
348 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
349 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
350 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
351 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
352 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
353 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . |
|
354 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
355 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . |
|
356 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
333 | + echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". |
|
334 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
335 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
336 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
337 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
338 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
339 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
340 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
341 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
342 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
343 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
344 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
345 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
346 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
347 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
348 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
349 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
350 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
351 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
352 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
353 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". |
|
354 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
355 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". |
|
356 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
357 | 357 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); |
358 | 358 | //echo("</tr>\n"); |
359 | 359 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $r2 = $resp[1]->value(); |
381 | 381 | |
382 | 382 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
383 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
383 | + echo "<thead>\n<tr><th>Method</th><th>".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
384 | 384 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
385 | 385 | if ($desc == "") { |
386 | 386 | $desc = "-"; |
@@ -390,24 +390,24 @@ discard block |
||
390 | 390 | if ($r2->kindOf() != "array") { |
391 | 391 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; |
392 | 392 | } else { |
393 | - foreach($r2 as $i => $x) { |
|
393 | + foreach ($r2 as $i => $x) { |
|
394 | 394 | $payload = ""; |
395 | 395 | $alt_payload = ""; |
396 | - if ($i + 1 % 2) { |
|
396 | + if ($i+1 % 2) { |
|
397 | 397 | $class = ' class="oddrow"'; |
398 | 398 | } else { |
399 | 399 | $class = ' class="evenrow"'; |
400 | 400 | } |
401 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; |
|
401 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; |
|
402 | 402 | if ($x->kindOf() == "array") { |
403 | 403 | $ret = $x[0]; |
404 | - echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
|
405 | - if ($x->count() > 1) { |
|
406 | - foreach($x as $k => $y) { |
|
404 | + echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; |
|
405 | + if ($x->count()>1) { |
|
406 | + foreach ($x as $k => $y) { |
|
407 | 407 | if ($k == 0) continue; |
408 | 408 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
409 | 409 | if ($wstype == 1 || $wstype == 2) { |
410 | - switch($y->scalarval()) { |
|
410 | + switch ($y->scalarval()) { |
|
411 | 411 | case 'string': |
412 | 412 | case 'dateTime.iso8601': |
413 | 413 | case 'base64': |
@@ -440,22 +440,22 @@ discard block |
||
440 | 440 | } else { |
441 | 441 | $type = $y->scalarval(); |
442 | 442 | $payload .= '<param><value>'; |
443 | - switch($type) { |
|
443 | + switch ($type) { |
|
444 | 444 | case 'undefined': |
445 | 445 | break; |
446 | 446 | case 'null': |
447 | 447 | $type = 'nil'; |
448 | 448 | // fall thru intentionally |
449 | 449 | default: |
450 | - $payload .= '<' . |
|
451 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
452 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
450 | + $payload .= '<'. |
|
451 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
452 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
453 | 453 | '>'; |
454 | 454 | } |
455 | 455 | $payload .= "</value></param>\n"; |
456 | 456 | } |
457 | 457 | $alt_payload .= $y->scalarval(); |
458 | - if ($k < $x->count() - 1) { |
|
458 | + if ($k<$x->count()-1) { |
|
459 | 459 | $alt_payload .= ';'; |
460 | 460 | if ($wstype == 1 || $wstype == 2) { |
461 | 461 | $payload .= ', '; |
@@ -471,63 +471,63 @@ discard block |
||
471 | 471 | echo '</td>'; |
472 | 472 | // button to test this method |
473 | 473 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; |
474 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
475 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
476 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
477 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
478 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
479 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
480 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
481 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
482 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
483 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
484 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
485 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
486 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
487 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
488 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
489 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
490 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
491 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
492 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
493 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
494 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
495 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
496 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
497 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
474 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
475 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
476 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
477 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
478 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
479 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
480 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
481 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
482 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
483 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
484 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
485 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
486 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
487 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
488 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
489 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
490 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
491 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
492 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
493 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
494 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
495 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
496 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
497 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
498 | 498 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; |
499 | 499 | //if ($wstype != 1) { |
500 | 500 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; |
501 | 501 | //} |
502 | 502 | echo "</form></td>\n"; |
503 | 503 | |
504 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
505 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
506 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
507 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
508 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
509 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
510 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
511 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
512 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
513 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
514 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
515 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
516 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
517 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
518 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
519 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
520 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
521 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
522 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
523 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
524 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
525 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . |
|
526 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
527 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
528 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
529 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . |
|
530 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
504 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
505 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
506 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
507 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
508 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
509 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
510 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
511 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
512 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
513 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
514 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
515 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
516 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
517 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
518 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
519 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
520 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
521 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
522 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
523 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
524 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
525 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". |
|
526 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
527 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
528 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
529 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". |
|
530 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
531 | 531 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; |
532 | 532 | echo "</form></td></tr>\n"; |
533 | 533 | } |
@@ -539,14 +539,14 @@ discard block |
||
539 | 539 | case 'wrap': |
540 | 540 | $r1 = $resp[0]->value(); |
541 | 541 | $r2 = $resp[1]->value(); |
542 | - if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { |
|
542 | + if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { |
|
543 | 543 | echo "Error: signature unknown\n"; |
544 | 544 | } else { |
545 | 545 | $mdesc = $r1->scalarval(); |
546 | 546 | $encoder = new PhpXmlRpc\Encoder(); |
547 | 547 | $msig = $encoder->decode($r2); |
548 | 548 | $msig = $msig[$methodsig]; |
549 | - $proto = ($protocol == 1) ? 'http11' : ( $protocol == 2 ? 'https' : ( $protocol == 3 ? 'h2' : ( $protocol == 4 ? 'h2c' : '' ) ) ); |
|
549 | + $proto = ($protocol == 1) ? 'http11' : ($protocol == 2 ? 'https' : ($protocol == 3 ? 'h2' : ($protocol == 4 ? 'h2c' : ''))); |
|
550 | 550 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && |
551 | 551 | $clientcookies == '') { |
552 | 552 | $opts = 1; // simple client copy in stub code |
@@ -567,12 +567,12 @@ discard block |
||
567 | 567 | $client, |
568 | 568 | $method, |
569 | 569 | array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix, 'throw_on_fault' => true), |
570 | - str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc |
|
570 | + str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc |
|
571 | 571 | ); |
572 | 572 | //if ($code) |
573 | 573 | //{ |
574 | 574 | echo "<div id=\"phpcode\">\n"; |
575 | - highlight_string("<?php\n" . $code['docstring'] . $code['source']); |
|
575 | + highlight_string("<?php\n".$code['docstring'].$code['source']); |
|
576 | 576 | echo "\n</div>"; |
577 | 577 | //} |
578 | 578 | //else |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | break; |
584 | 584 | |
585 | 585 | case 'execute': |
586 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; |
|
586 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; |
|
587 | 587 | break; |
588 | 588 | |
589 | 589 | default: // give a warning |
@@ -15,7 +15,12 @@ discard block |
||
15 | 15 | <html lang="en"> |
16 | 16 | <head> |
17 | 17 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
18 | - <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
18 | + <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) { |
|
19 | + echo 'JSON-RPC'; |
|
20 | +} else { |
|
21 | + echo 'XML-RPC'; |
|
22 | +} |
|
23 | +?> Debugger</title> |
|
19 | 24 | <meta name="robots" content="index,nofollow"/> |
20 | 25 | <style type="text/css"> |
21 | 26 | <!-- |
@@ -404,7 +409,9 @@ discard block |
||
404 | 409 | echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
405 | 410 | if ($x->count() > 1) { |
406 | 411 | foreach($x as $k => $y) { |
407 | - if ($k == 0) continue; |
|
412 | + if ($k == 0) { |
|
413 | + continue; |
|
414 | + } |
|
408 | 415 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
409 | 416 | if ($wstype == 1 || $wstype == 2) { |
410 | 417 | switch($y->scalarval()) { |