@@ -176,8 +176,7 @@ |
||
176 | 176 | } else { |
177 | 177 | $escapedData .= $ch; |
178 | 178 | } |
179 | - } |
|
180 | - else if ($ii < 128) { |
|
179 | + } else if ($ii < 128) { |
|
181 | 180 | /// @todo shall we replace this with a (supposedly) faster str_replace? |
182 | 181 | /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? |
183 | 182 | switch ($ii) { |
@@ -66,11 +66,12 @@ |
||
66 | 66 | $a = $req->getParam(0); |
67 | 67 | $b = $req->getParam(1); |
68 | 68 | |
69 | - if ($a->scalartyp() == Value::$xmlrpcNull) |
|
70 | - return new Response(new Value(plain_findstate($b->scalarval()))); |
|
71 | - else |
|
72 | - return new Response(new Value(plain_findstate($a->scalarval()))); |
|
73 | -} |
|
69 | + if ($a->scalartyp() == Value::$xmlrpcNull) { |
|
70 | + return new Response(new Value(plain_findstate($b->scalarval()))); |
|
71 | + } else { |
|
72 | + return new Response(new Value(plain_findstate($a->scalarval()))); |
|
73 | + } |
|
74 | + } |
|
74 | 75 | |
75 | 76 | return array( |
76 | 77 | "tests.getallheaders" => array( |
@@ -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()) { |
@@ -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) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
16 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
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" |
@@ -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"> |
@@ -605,8 +605,9 @@ |
||
605 | 605 | } |
606 | 606 | foreach ($parsVariations as $i => $pars) { |
607 | 607 | $innerCode .= " if (\$paramCount == " . count($pars) . ") \$retVal = {$catchWarnings}$realFuncName(" . implode(',', $pars) . ");\n"; |
608 | - if ($i < (count($parsVariations) - 1)) |
|
609 | - $innerCode .= " else\n"; |
|
608 | + if ($i < (count($parsVariations) - 1)) { |
|
609 | + $innerCode .= " else\n"; |
|
610 | + } |
|
610 | 611 | } |
611 | 612 | $innerCode .= " if (is_a(\$retVal, '" . static::$namespace . "Response'))\n return \$retVal;\n else\n"; |
612 | 613 | /// q: why not do the same for int, float, bool, string? |
@@ -21,14 +21,16 @@ |
||
21 | 21 | protected function set_up() |
22 | 22 | { |
23 | 23 | $this->args = argParser::getArgs(); |
24 | - if ($this->args['DEBUG'] == 1) |
|
25 | - ob_start(); |
|
24 | + if ($this->args['DEBUG'] == 1) { |
|
25 | + ob_start(); |
|
26 | + } |
|
26 | 27 | } |
27 | 28 | |
28 | 29 | protected function tear_down() |
29 | 30 | { |
30 | - if ($this->args['DEBUG'] != 1) |
|
31 | - return; |
|
31 | + if ($this->args['DEBUG'] != 1) { |
|
32 | + return; |
|
33 | + } |
|
32 | 34 | $out = ob_get_clean(); |
33 | 35 | $status = $this->getStatus(); |
34 | 36 | if ($status == BaseTestRunner::STATUS_ERROR |
@@ -201,8 +201,7 @@ discard block |
||
201 | 201 | { |
202 | 202 | $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy'); |
203 | 203 | return; |
204 | - } |
|
205 | - else if ($this->args['PROXYSERVER'] == '') |
|
204 | + } else if ($this->args['PROXYSERVER'] == '') |
|
206 | 205 | { |
207 | 206 | $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1'); |
208 | 207 | return; |
@@ -226,8 +225,7 @@ discard block |
||
226 | 225 | { |
227 | 226 | $this->markTestSkipped('CURL missing: cannot test https functionality'); |
228 | 227 | return; |
229 | - } |
|
230 | - else if ($this->args['HTTPSSERVER'] == '') |
|
228 | + } else if ($this->args['HTTPSSERVER'] == '') |
|
231 | 229 | { |
232 | 230 | $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https'); |
233 | 231 | return; |
@@ -278,13 +276,11 @@ discard block |
||
278 | 276 | { |
279 | 277 | $this->markTestSkipped('CURL missing: cannot test https w. proxy'); |
280 | 278 | return; |
281 | - } |
|
282 | - else if ($this->args['PROXYSERVER'] == '') |
|
279 | + } else if ($this->args['PROXYSERVER'] == '') |
|
283 | 280 | { |
284 | 281 | $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https'); |
285 | 282 | return; |
286 | - } |
|
287 | - else if ($this->args['HTTPSSERVER'] == '') |
|
283 | + } else if ($this->args['HTTPSSERVER'] == '') |
|
288 | 284 | { |
289 | 285 | $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https w. proxy'); |
290 | 286 | return; |
@@ -23,14 +23,16 @@ |
||
23 | 23 | { |
24 | 24 | $this->args = argParser::getArgs(); |
25 | 25 | // hide parsing errors unless in debug mode |
26 | - if ($this->args['DEBUG'] == 1) |
|
27 | - ob_start(); |
|
26 | + if ($this->args['DEBUG'] == 1) { |
|
27 | + ob_start(); |
|
28 | + } |
|
28 | 29 | } |
29 | 30 | |
30 | 31 | protected function tear_down() |
31 | 32 | { |
32 | - if ($this->args['DEBUG'] != 1) |
|
33 | - return; |
|
33 | + if ($this->args['DEBUG'] != 1) { |
|
34 | + return; |
|
35 | + } |
|
34 | 36 | $out = ob_get_clean(); |
35 | 37 | $status = $this->getStatus(); |
36 | 38 | if ($status == BaseTestRunner::STATUS_ERROR |