@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/_prepend.php"; |
|
2 | +require_once __DIR__."/_prepend.php"; |
|
3 | 3 | |
4 | 4 | output('<html lang="en"> |
5 | 5 | <head><title>phpxmlrpc - Agesort demo</title></head> |
@@ -17,21 +17,21 @@ discard block |
||
17 | 17 | |
18 | 18 | $inAr = array( |
19 | 19 | array('name' => 'Dave', 'age' => 24), |
20 | - array('name' => 'Edd', 'age' => 45), |
|
21 | - array('name' => 'Joe', 'age' => 37), |
|
20 | + array('name' => 'Edd', 'age' => 45), |
|
21 | + array('name' => 'Joe', 'age' => 37), |
|
22 | 22 | array('name' => 'Fred', 'age' => 27), |
23 | 23 | ); |
24 | 24 | |
25 | 25 | output('This is the input data:<br/><pre>'); |
26 | 26 | foreach ($inAr as $val) { |
27 | - output($val['name'] . ", " . $val['age'] . "\n"); |
|
27 | + output($val['name'].", ".$val['age']."\n"); |
|
28 | 28 | } |
29 | 29 | output('</pre>'); |
30 | 30 | |
31 | 31 | // Create xml-rpc parameters from the input array: an array of structs |
32 | 32 | $encoder = new Encoder(); |
33 | 33 | $v = $encoder->encode($inAr); |
34 | -output("Encoded into xml-rpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n"); |
|
34 | +output("Encoded into xml-rpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n"); |
|
35 | 35 | |
36 | 36 | // create client and request objects |
37 | 37 | $req = new Request('examples.sortByAge', array($v)); |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | $value = $resp->value(); |
52 | 52 | foreach ($encoder->decode($value) as $struct) { |
53 | 53 | // note: here we are trusting the server's response to have the expected format |
54 | - output(htmlspecialchars($struct['name']) . ", " . htmlspecialchars($struct['age']) . "\n"); |
|
54 | + output(htmlspecialchars($struct['name']).", ".htmlspecialchars($struct['age'])."\n"); |
|
55 | 55 | } |
56 | 56 | |
57 | - output('</pre><hr/>For nerds: I got this value back<br/><pre>' . |
|
58 | - htmlentities($resp->serialize()) . "</pre><hr/>\n"); |
|
57 | + output('</pre><hr/>For nerds: I got this value back<br/><pre>'. |
|
58 | + htmlentities($resp->serialize())."</pre><hr/>\n"); |
|
59 | 59 | } else { |
60 | 60 | output('An error occurred:<pre>'); |
61 | - output('Code: ' . htmlspecialchars($resp->faultCode()) . |
|
62 | - "\nReason: '" . htmlspecialchars($resp->faultString()) . "'</pre><hr/>"); |
|
61 | + output('Code: '.htmlspecialchars($resp->faultCode()). |
|
62 | + "\nReason: '".htmlspecialchars($resp->faultString())."'</pre><hr/>"); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | output("</body></html>\n"); |
@@ -91,7 +91,7 @@ |
||
91 | 91 | |
92 | 92 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
93 | 93 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
94 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
94 | + "tests.utf8methodname.".'κόσμε' => array( |
|
95 | 95 | "function" => "exampleMethods::stringEcho", |
96 | 96 | "signature" => exampleMethods::$stringecho_sig, |
97 | 97 | "docstring" => exampleMethods::$stringecho_doc, |
@@ -69,11 +69,12 @@ |
||
69 | 69 | $a = $req->getParam(0); |
70 | 70 | $b = $req->getParam(1); |
71 | 71 | |
72 | - if ($a->scalarTyp() == Value::$xmlrpcNull) |
|
73 | - return new Response(new Value(plain_findstate($b->scalarVal()))); |
|
74 | - else |
|
75 | - return new Response(new Value(plain_findstate($a->scalarVal()))); |
|
76 | -} |
|
72 | + if ($a->scalarTyp() == Value::$xmlrpcNull) { |
|
73 | + return new Response(new Value(plain_findstate($b->scalarVal()))); |
|
74 | + } else { |
|
75 | + return new Response(new Value(plain_findstate($a->scalarVal()))); |
|
76 | + } |
|
77 | + } |
|
77 | 78 | |
78 | 79 | return array( |
79 | 80 | "tests.getallheaders" => array( |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | function plain_findstate($stateNo) |
28 | 28 | { |
29 | - if (isset(exampleMethods::$stateNames[$stateNo - 1])) { |
|
29 | + if (isset(exampleMethods::$stateNames[$stateNo - 1])) { |
|
30 | 30 | return exampleMethods::$stateNames[$stateNo - 1]; |
31 | 31 | } else { |
32 | 32 | // not, there so complain |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function plain_findstate($stateNo) |
28 | 28 | { |
29 | - if (isset(exampleMethods::$stateNames[$stateNo - 1])) { |
|
30 | - return exampleMethods::$stateNames[$stateNo - 1]; |
|
29 | + if (isset(exampleMethods::$stateNames[$stateNo-1])) { |
|
30 | + return exampleMethods::$stateNames[$stateNo-1]; |
|
31 | 31 | } else { |
32 | 32 | // not, there so complain |
33 | - throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
33 | + throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($req->getNumParams()) { |
70 | 70 | $p1 = $req->getParam(0); |
71 | 71 | if ($p1->kindOf() === 'scalar') { |
72 | - $errNum = (int)$p1->scalarVal(); |
|
72 | + $errNum = (int) $p1->scalarVal(); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | throw new Exception("it's just a test", $errNum); |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | |
142 | 142 | $findstate10_sig = array( |
143 | 143 | /// @todo add a demo and test with closure usage |
144 | - "function" => function ($req) { return exampleMethods::findState($req); }, |
|
144 | + "function" => function($req) { return exampleMethods::findState($req); }, |
|
145 | 145 | "signature" => array(array(Value::$xmlrpcString, Value::$xmlrpcInt)), |
146 | - "docstring" => 'When passed an integer between 1 and 51 returns the name of a US state, where the integer is the ' . |
|
146 | + "docstring" => 'When passed an integer between 1 and 51 returns the name of a US state, where the integer is the '. |
|
147 | 147 | 'index of that state name in an alphabetic order.', |
148 | 148 | ); |
149 | 149 | |
150 | -$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return plain_findstate($stateNo); }); |
|
150 | +$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return plain_findstate($stateNo); }); |
|
151 | 151 | |
152 | 152 | /// @todo do we really need a new instance ? |
153 | 153 | $c = new handlersContainer(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $namespaceSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'namespacetest.', 'replace_class_name' => true, 'method_filter' => '/^findState$/', 'method_type' => 'static')); |
158 | 158 | |
159 | -$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
159 | +$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
160 | 160 | |
161 | 161 | return array_merge( |
162 | 162 | array( |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/_prepend.php"; |
|
2 | +require_once __DIR__."/_prepend.php"; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Demoing the code-generation capabilities of the library: create a client class which exposes a bunch of methods |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | ); |
22 | 22 | |
23 | 23 | // the generated code does not have an autoloader included - we need to add in one |
24 | -$autoloader = __DIR__ . "/_prepend.php"; |
|
24 | +$autoloader = __DIR__."/_prepend.php"; |
|
25 | 25 | |
26 | 26 | $targetFile = '/tmp/MyClient.php'; |
27 | 27 | $generated = file_put_contents($targetFile, |
28 | - "<?php\n\n" . |
|
29 | - "require_once '$autoloader';\n\n" . |
|
28 | + "<?php\n\n". |
|
29 | + "require_once '$autoloader';\n\n". |
|
30 | 30 | $code['code'] |
31 | 31 | ); |
32 | 32 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $client = new MyClient(); |
47 | 47 | $sorted = $client->examples_sortByAge(array( |
48 | 48 | array('name' => 'Dave', 'age' => 24), |
49 | - array('name' => 'Edd', 'age' => 45), |
|
50 | - array('name' => 'Joe', 'age' => 37), |
|
49 | + array('name' => 'Edd', 'age' => 45), |
|
50 | + array('name' => 'Joe', 'age' => 37), |
|
51 | 51 | array('name' => 'Fred', 'age' => 27), |
52 | 52 | )); |
53 | 53 |
@@ -8,5 +8,5 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | // Use the custom class autoloader. These two lines are not needed when the phpxmlrpc library is installed using Composer |
11 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
11 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
12 | 12 | PhpXmlRpc\Autoloader::register(); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * `$functions_parameters_type` and `$exception_handling` |
9 | 9 | */ |
10 | 10 | |
11 | -require_once __DIR__ . "/_prepend.php"; |
|
11 | +require_once __DIR__."/_prepend.php"; |
|
12 | 12 | |
13 | 13 | require_once __DIR__.'/methodProviders/CommentManager.php'; |
14 | 14 | |
@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | |
20 | 20 | $addComment_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcString, Value::$xmlrpcString, Value::$xmlrpcString)); |
21 | 21 | |
22 | -$addComment_doc = 'Adds a comment to an item. The first parameter is the item ID, the second the name of the commenter, ' . |
|
22 | +$addComment_doc = 'Adds a comment to an item. The first parameter is the item ID, the second the name of the commenter, '. |
|
23 | 23 | 'and the third is the comment itself. Returns the number of comments against that ID.'; |
24 | 24 | |
25 | 25 | $getComments_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcString)); |
26 | 26 | |
27 | -$getComments_doc = 'Returns an array of comments for a given ID, which is the sole argument. Each array item is a struct ' . |
|
27 | +$getComments_doc = 'Returns an array of comments for a given ID, which is the sole argument. Each array item is a struct '. |
|
28 | 28 | 'containing name and comment text.'; |
29 | 29 | |
30 | 30 | $srv = new Server(); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/_prepend.php"; |
|
2 | +require_once __DIR__."/_prepend.php"; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Demoing the charset conversion of the library: create a client class which uses data in the CP-1252 character set, |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // Make sure we set the correct charset type for output, so that we can display all characters |
18 | 18 | header('Content-Type: text/html; charset=utf-8'); |
19 | 19 | |
20 | -include __DIR__ . '/common.php'; |
|
20 | +include __DIR__.'/common.php'; |
|
21 | 21 | if ($action == '') { |
22 | 22 | $action = 'list'; |
23 | 23 | } |
@@ -33,30 +33,30 @@ discard block |
||
33 | 33 | /// @const JSXMLRPC_PATH Path to the visual xml-rpc editing dialog's containing folder. Can be absolute, or |
34 | 34 | /// relative to this debugger's folder. |
35 | 35 | if (defined('JSXMLRPC_PATH')) { |
36 | - $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__ . '/' . JSXMLRPC_PATH)); |
|
36 | + $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__.'/'.JSXMLRPC_PATH)); |
|
37 | 37 | } else { |
38 | 38 | $editorpaths = array( |
39 | - __DIR__ . '/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile |
|
40 | - __DIR__ . '/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer inside the debugger |
|
41 | - __DIR__ . '/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm inside the debugger |
|
42 | - __DIR__ . '/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer |
|
43 | - __DIR__ . '/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm |
|
44 | - __DIR__ . '/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too |
|
45 | - __DIR__ . '/../../../../debugger/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level via taskfile (ie. jsonrpc) |
|
46 | - __DIR__ . '/../../../../debugger/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via composer |
|
47 | - __DIR__ . '/../../../../debugger/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via npm |
|
48 | - __DIR__ . '/../../../../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm in the top-level project |
|
39 | + __DIR__.'/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile |
|
40 | + __DIR__.'/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer inside the debugger |
|
41 | + __DIR__.'/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm inside the debugger |
|
42 | + __DIR__.'/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer |
|
43 | + __DIR__.'/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm |
|
44 | + __DIR__.'/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too |
|
45 | + __DIR__.'/../../../../debugger/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level via taskfile (ie. jsonrpc) |
|
46 | + __DIR__.'/../../../../debugger/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via composer |
|
47 | + __DIR__.'/../../../../debugger/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via npm |
|
48 | + __DIR__.'/../../../../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm in the top-level project |
|
49 | 49 | ); |
50 | 50 | } |
51 | - foreach($editorpaths as $editorpath) { |
|
52 | - if (is_file(realpath($editorpath . 'visualeditor.html'))) { |
|
51 | + foreach ($editorpaths as $editorpath) { |
|
52 | + if (is_file(realpath($editorpath.'visualeditor.html'))) { |
|
53 | 53 | $haseditor = true; |
54 | 54 | break; |
55 | 55 | } |
56 | 56 | } |
57 | 57 | if ($haseditor) { |
58 | - $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
59 | - $editorurlpath = $controllerRootUrl . '/' . preg_replace('|^' . preg_quote(__DIR__, '|') .'|', '', $editorpath); |
|
58 | + $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
59 | + $editorurlpath = $controllerRootUrl.'/'.preg_replace('|^'.preg_quote(__DIR__, '|').'|', '', $editorpath); |
|
60 | 60 | /// @todo for cases above 4 and up, look at $controllerRootUrl and check if the web root is not pointing directly |
61 | 61 | /// at this folder, as in that case the link to the visualeditor will not |
62 | 62 | /// work, as it will be in the form http(s)://domain/../../jsxmlrpc/debugger/visualeditor.html |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | function activateeditor() { |
236 | - var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array( "\\\\", "\\'"), $alt_payload); ?>'; |
|
236 | + var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array("\\\\", "\\'"), $alt_payload); ?>'; |
|
237 | 237 | if (document.frmaction.wstype.value == "1") |
238 | 238 | url += '&type=jsonrpc'; |
239 | 239 | var wnd = window.open(url, '_blank', 'width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1'); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | JSON-RPC'; |
279 | 279 | } ?> |
280 | 280 | Debugger</h1><h3>(based on <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a>, ver. <?php echo htmlspecialchars(\PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion)?> |
281 | -<?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> |
|
281 | +<?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> |
|
282 | 282 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
283 | 283 | |
284 | 284 | <table id="serverblock"> |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | </select> |
340 | 340 | </td> |
341 | 341 | <td class="labelcell">Timeout:</td> |
342 | - <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> |
|
342 | + <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> |
|
343 | 343 | <td></td> |
344 | 344 | <td></td> |
345 | 345 | </tr> |
@@ -66,7 +66,12 @@ discard block |
||
66 | 66 | <html lang="en"> |
67 | 67 | <head> |
68 | 68 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
69 | - <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
69 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
70 | + echo 'JSON-RPC'; |
|
71 | +} else { |
|
72 | + echo 'XML-RPC'; |
|
73 | +} |
|
74 | +?> Debugger</title> |
|
70 | 75 | <meta name="robots" content="index,nofollow"/> |
71 | 76 | <script type="text/javascript" language="Javascript"> |
72 | 77 | if (window.name != 'frmcontroller') |
@@ -266,19 +271,26 @@ discard block |
||
266 | 271 | </script> |
267 | 272 | </head> |
268 | 273 | <body |
269 | - onload="<?php if ($hasjsonrpcclient) echo "switchtransport($wstype); " ?>switchaction(); switchssl(); switchauth(); swicthcainfo();<?php if ($run) { |
|
274 | + onload="<?php if ($hasjsonrpcclient) { |
|
275 | + echo "switchtransport($wstype); " ?>switchaction(); switchssl(); switchauth(); swicthcainfo();<?php if ($run) { |
|
270 | 276 | echo ' document.frmaction.submit();'; |
277 | +} |
|
271 | 278 | } ?>"> |
272 | 279 | <h1>XML-RPC |
273 | 280 | <?php if ($hasjsonrpcclient) { |
274 | 281 | echo '<form name="frmxmlrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(0);"'; |
275 | 282 | // q: does this if make sense at all? |
276 | - if (!class_exists('\PhpXmlRpc\Client')) echo ' disabled="disabled"'; |
|
283 | + if (!class_exists('\PhpXmlRpc\Client')) { |
|
284 | + echo ' disabled="disabled"'; |
|
285 | + } |
|
277 | 286 | echo ' /></form> / <form name="frmjsonrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(1);"/></form> |
278 | 287 | JSON-RPC'; |
279 | 288 | } ?> |
280 | 289 | Debugger</h1><h3>(based on <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a>, ver. <?php echo htmlspecialchars(\PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion)?> |
281 | -<?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> |
|
290 | +<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) { |
|
291 | + echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. ' . htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); |
|
292 | +} |
|
293 | +?>)</h3> |
|
282 | 294 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
283 | 295 | |
284 | 296 | <table id="serverblock"> |
@@ -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) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
18 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
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 | <!-- |
@@ -367,7 +372,9 @@ discard block |
||
367 | 372 | echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
368 | 373 | if ($x->count() > 1) { |
369 | 374 | foreach($x as $k => $y) { |
370 | - if ($k == 0) continue; |
|
375 | + if ($k == 0) { |
|
376 | + continue; |
|
377 | + } |
|
371 | 378 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
372 | 379 | if ($wstype == 1) { |
373 | 380 | switch($y->scalarval()) { |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | <body> |
79 | 79 | <?php |
80 | 80 | |
81 | -include __DIR__ . '/common.php'; |
|
81 | +include __DIR__.'/common.php'; |
|
82 | 82 | |
83 | 83 | if ($action) { |
84 | 84 | |
85 | 85 | // avoid php hanging when using the builtin webserver and sending requests to itself |
86 | 86 | $skip = false; |
87 | - if (php_sapi_name() === 'cli-server' && ((int)getenv('PHP_CLI_SERVER_WORKERS') < 2)) { |
|
87 | + if (php_sapi_name() === 'cli-server' && ((int) getenv('PHP_CLI_SERVER_WORKERS')<2)) { |
|
88 | 88 | $localHost = explode(':', $_SERVER['HTTP_HOST']); |
89 | 89 | /// @todo support also case where port is null (on either side), and when there is a Proxy in the parameters, |
90 | 90 | /// and that proxy is us |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (!$skip) { |
98 | 98 | // make sure the script waits long enough for the call to complete... |
99 | 99 | if ($timeout) { |
100 | - set_time_limit($timeout + 10); |
|
100 | + set_time_limit($timeout+10); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($wstype == 1) { |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | $server = "$host$path"; |
119 | 119 | } |
120 | 120 | if ($protocol == 2 || $protocol == 3) { |
121 | - $server = 'https://' . $server; |
|
121 | + $server = 'https://'.$server; |
|
122 | 122 | } else { |
123 | - $server = 'http://' . $server; |
|
123 | + $server = 'http://'.$server; |
|
124 | 124 | } |
125 | 125 | if ($proxy != '') { |
126 | 126 | $pproxy = explode(':', $proxy); |
127 | - if (count($pproxy) > 1) { |
|
127 | + if (count($pproxy)>1) { |
|
128 | 128 | $pport = $pproxy[1]; |
129 | 129 | } else { |
130 | 130 | $pport = 8080; |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | case 'wrap': |
200 | 200 | $msg[0] = new $requestClass('system.methodHelp', array(), $id); |
201 | 201 | $msg[0]->addparam(new PhpXmlRpc\Value($method)); |
202 | - $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1); |
|
202 | + $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1); |
|
203 | 203 | $msg[1]->addparam(new PhpXmlRpc\Value($method)); |
204 | - $actionname = 'Description of method "' . $method . '"'; |
|
204 | + $actionname = 'Description of method "'.$method.'"'; |
|
205 | 205 | break; |
206 | 206 | case 'list': |
207 | 207 | $msg[0] = new $requestClass('system.listMethods', array(), $id); |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | $msg[0] = new $requestClass($method, array(), $id); |
215 | 215 | // hack! build payload by hand |
216 | 216 | if ($wstype == 1) { |
217 | - $payload = "{\n" . |
|
218 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
219 | - $payload . |
|
217 | + $payload = "{\n". |
|
218 | + '"method": "'.$method."\",\n\"params\": [". |
|
219 | + $payload. |
|
220 | 220 | "\n],\n\"id\": "; |
221 | 221 | // fix: if user gave an empty string, use NULL, or we'll break json syntax |
222 | 222 | if ($id == "") { |
@@ -231,22 +231,22 @@ discard block |
||
231 | 231 | $msg[0]->setPayload($payload); |
232 | 232 | } else { |
233 | 233 | $msg[0]->setPayload( |
234 | - $msg[0]->xml_header($inputcharset) . |
|
235 | - '<methodName>' . $method . "</methodName>\n<params>" . |
|
236 | - $payload . |
|
237 | - "</params>\n" . $msg[0]->xml_footer() |
|
234 | + $msg[0]->xml_header($inputcharset). |
|
235 | + '<methodName>'.$method."</methodName>\n<params>". |
|
236 | + $payload. |
|
237 | + "</params>\n".$msg[0]->xml_footer() |
|
238 | 238 | ); |
239 | 239 | } |
240 | - $actionname = 'Execution of method ' . $method; |
|
240 | + $actionname = 'Execution of method '.$method; |
|
241 | 241 | break; |
242 | 242 | default: // give a warning |
243 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; |
|
243 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
247 | 247 | // Before calling execute, echo out brief description of action taken + date and time ??? |
248 | 248 | // this gives good user feedback for long-running methods... |
249 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; |
|
249 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; |
|
250 | 250 | flush(); |
251 | 251 | |
252 | 252 | $response = null; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | break; |
264 | 264 | } |
265 | 265 | } |
266 | - $time = microtime(true) - $time; |
|
266 | + $time = microtime(true)-$time; |
|
267 | 267 | if ($debug) { |
268 | 268 | echo "</div>\n"; |
269 | 269 | } |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | // call failed! echo out error msg! |
274 | 274 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; |
275 | 275 | echo "<h3>$protoName call FAILED!</h3>\n"; |
276 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
277 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; |
|
276 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
277 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; |
|
278 | 278 | echo(date("d/M/Y:H:i:s\n")); |
279 | 279 | } else { |
280 | 280 | // call succeeded: parse results |
@@ -290,36 +290,36 @@ discard block |
||
290 | 290 | $max = $v->count(); |
291 | 291 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
292 | 292 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; |
293 | - foreach($v as $i => $rec) { |
|
293 | + foreach ($v as $i => $rec) { |
|
294 | 294 | if ($i % 2) { |
295 | 295 | $class = ' class="oddrow"'; |
296 | 296 | } else { |
297 | 297 | $class = ' class="evenrow"'; |
298 | 298 | } |
299 | - echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . |
|
300 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
301 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
302 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
303 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
304 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
305 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
306 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
307 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
308 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
309 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
310 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
311 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
312 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
313 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
314 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
315 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
316 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
317 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
318 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
319 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . |
|
320 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
321 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . |
|
322 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
299 | + echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". |
|
300 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
301 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
302 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
303 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
304 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
305 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
306 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
307 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
308 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
309 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
310 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
311 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
312 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
313 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
314 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
315 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
316 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
317 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
318 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
319 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". |
|
320 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
321 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". |
|
322 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
323 | 323 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); |
324 | 324 | //echo("</tr>\n"); |
325 | 325 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $r2 = $resp[1]->value(); |
347 | 347 | |
348 | 348 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
349 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
349 | + echo "<thead>\n<tr><th>Method</th><th>".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
350 | 350 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
351 | 351 | if ($desc == "") { |
352 | 352 | $desc = "-"; |
@@ -356,24 +356,24 @@ discard block |
||
356 | 356 | if ($r2->kindOf() != "array") { |
357 | 357 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; |
358 | 358 | } else { |
359 | - foreach($r2 as $i => $x) { |
|
359 | + foreach ($r2 as $i => $x) { |
|
360 | 360 | $payload = ""; |
361 | 361 | $alt_payload = ""; |
362 | - if ($i + 1 % 2) { |
|
362 | + if ($i+1 % 2) { |
|
363 | 363 | $class = ' class="oddrow"'; |
364 | 364 | } else { |
365 | 365 | $class = ' class="evenrow"'; |
366 | 366 | } |
367 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; |
|
367 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; |
|
368 | 368 | if ($x->kindOf() == "array") { |
369 | 369 | $ret = $x[0]; |
370 | - echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
|
371 | - if ($x->count() > 1) { |
|
372 | - foreach($x as $k => $y) { |
|
370 | + echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; |
|
371 | + if ($x->count()>1) { |
|
372 | + foreach ($x as $k => $y) { |
|
373 | 373 | if ($k == 0) continue; |
374 | 374 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
375 | 375 | if ($wstype == 1) { |
376 | - switch($y->scalarval()) { |
|
376 | + switch ($y->scalarval()) { |
|
377 | 377 | case 'string': |
378 | 378 | case 'dateTime.iso8601': |
379 | 379 | case 'base64': |
@@ -406,22 +406,22 @@ discard block |
||
406 | 406 | } else { |
407 | 407 | $type = $y->scalarval(); |
408 | 408 | $payload .= '<param><value>'; |
409 | - switch($type) { |
|
409 | + switch ($type) { |
|
410 | 410 | case 'undefined': |
411 | 411 | break; |
412 | 412 | case 'null'; |
413 | 413 | $type = 'nil'; |
414 | 414 | // fall thru intentionally |
415 | 415 | default: |
416 | - $payload .= '<' . |
|
417 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
418 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
416 | + $payload .= '<'. |
|
417 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
418 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
419 | 419 | '>'; |
420 | 420 | } |
421 | 421 | $payload .= "</value></param>\n"; |
422 | 422 | } |
423 | 423 | $alt_payload .= $y->scalarval(); |
424 | - if ($k < $x->count() - 1) { |
|
424 | + if ($k<$x->count()-1) { |
|
425 | 425 | $alt_payload .= ';'; |
426 | 426 | if ($wstype == 1) { |
427 | 427 | $payload .= ', '; |
@@ -437,63 +437,63 @@ discard block |
||
437 | 437 | echo '</td>'; |
438 | 438 | // button to test this method |
439 | 439 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; |
440 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
441 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
442 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
443 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
444 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
445 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
446 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
447 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
448 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
449 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
450 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
451 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
452 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
453 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
454 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
455 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
456 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
457 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
458 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
459 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
460 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
461 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
462 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
463 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
440 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
441 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
442 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
443 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
444 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
445 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
446 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
447 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
448 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
449 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
450 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
451 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
452 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
453 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
454 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
455 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
456 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
457 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
458 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
459 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
460 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
461 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
462 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
463 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
464 | 464 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; |
465 | 465 | //if ($wstype != 1) { |
466 | 466 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; |
467 | 467 | //} |
468 | 468 | echo "</form></td>\n"; |
469 | 469 | |
470 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
471 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
472 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
473 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
474 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
475 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
476 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
477 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
478 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
479 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
480 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
481 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
482 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
483 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
484 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
485 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
486 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
487 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
488 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
489 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
490 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
491 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . |
|
492 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
493 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
494 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
495 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . |
|
496 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
470 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
471 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
472 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
473 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
474 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
475 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
476 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
477 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
478 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
479 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
480 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
481 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
482 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
483 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
484 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
485 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
486 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
487 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
488 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
489 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
490 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
491 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". |
|
492 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
493 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
494 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
495 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". |
|
496 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
497 | 497 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; |
498 | 498 | echo "</form></td></tr>\n"; |
499 | 499 | } |
@@ -505,14 +505,14 @@ discard block |
||
505 | 505 | case 'wrap': |
506 | 506 | $r1 = $resp[0]->value(); |
507 | 507 | $r2 = $resp[1]->value(); |
508 | - if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { |
|
508 | + if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { |
|
509 | 509 | echo "Error: signature unknown\n"; |
510 | 510 | } else { |
511 | 511 | $mdesc = $r1->scalarval(); |
512 | 512 | $encoder = new PhpXmlRpc\Encoder(); |
513 | 513 | $msig = $encoder->decode($r2); |
514 | 514 | $msig = $msig[$methodsig]; |
515 | - $proto = ($protocol == 1) ? 'http11' : ( $protocol == 2 ? 'https' : ( $protocol == 3 ? 'h2' : ( $protocol == 4 ? 'h2c' : '' ) ) ); |
|
515 | + $proto = ($protocol == 1) ? 'http11' : ($protocol == 2 ? 'https' : ($protocol == 3 ? 'h2' : ($protocol == 4 ? 'h2c' : ''))); |
|
516 | 516 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && |
517 | 517 | $clientcookies == '') { |
518 | 518 | $opts = 1; // simple client copy in stub code |
@@ -533,12 +533,12 @@ discard block |
||
533 | 533 | $client, |
534 | 534 | $method, |
535 | 535 | array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix, 'throw_on_fault' => true), |
536 | - str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc |
|
536 | + str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc |
|
537 | 537 | ); |
538 | 538 | //if ($code) |
539 | 539 | //{ |
540 | 540 | echo "<div id=\"phpcode\">\n"; |
541 | - highlight_string("<?php\n" . $code['docstring'] . $code['source']); |
|
541 | + highlight_string("<?php\n".$code['docstring'].$code['source']); |
|
542 | 542 | echo "\n</div>"; |
543 | 543 | //} |
544 | 544 | //else |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | break; |
550 | 550 | |
551 | 551 | case 'execute': |
552 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; |
|
552 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; |
|
553 | 553 | break; |
554 | 554 | |
555 | 555 | default: // give a warning |