@@ -14,20 +14,20 @@ discard block |
||
14 | 14 | * @todo if js libs are not available, do not try to load them |
15 | 15 | **/ |
16 | 16 | |
17 | -if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_prepend.php"; |
|
17 | +if (getenv('TESTMODE') === 'true') require_once __DIR__."../demo/server/_prepend.php"; |
|
18 | 18 | |
19 | 19 | // Make sure we set the correct charset type for output, so that we can display all characters |
20 | 20 | header('Content-Type: text/html; charset=utf-8'); |
21 | 21 | |
22 | -include __DIR__ . '/common.php'; |
|
22 | +include __DIR__.'/common.php'; |
|
23 | 23 | if ($action == '') { |
24 | 24 | $action = 'list'; |
25 | 25 | } |
26 | 26 | |
27 | 27 | // Relative path to the visual xmlrpc editing dialog |
28 | 28 | // We allow to easily configure this path via defines |
29 | -$editorpath = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..') . '/jsxmlrpc/debugger/'; |
|
30 | -$editorlibs = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..') . '/jsxmlrpc/lib/'; |
|
29 | +$editorpath = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..').'/jsxmlrpc/debugger/'; |
|
30 | +$editorlibs = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..').'/jsxmlrpc/lib/'; |
|
31 | 31 | ?> |
32 | 32 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
33 | 33 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
@@ -233,9 +233,9 @@ discard block |
||
233 | 233 | echo ' document.forms[2].submit();'; |
234 | 234 | } ?>"> |
235 | 235 | <h1>XMLRPC |
236 | - <form name="frmxmlrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(0);" <?php if (!class_exists('\PhpXmlRpc\Client')) { echo 'disabled="disabled"';} ?>/></form> |
|
236 | + <form name="frmxmlrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(0);" <?php if (!class_exists('\PhpXmlRpc\Client')) { echo 'disabled="disabled"'; } ?>/></form> |
|
237 | 237 | / |
238 | - <form name="frmjsonrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(1);" <?php if (!class_exists('\PhpXmlRpc\JsonRpc\Client')) { echo 'disabled="disabled"';} ?>/></form> |
|
238 | + <form name="frmjsonrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(1);" <?php if (!class_exists('\PhpXmlRpc\JsonRpc\Client')) { echo 'disabled="disabled"'; } ?>/></form> |
|
239 | 239 | JSONRPC Debugger (based on the <a href="http://gggeek.github.io/phpxmlrpc/">PHP-XMLRPC</a> library) |
240 | 240 | </h1> |
241 | 241 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | </select> |
291 | 291 | </td> |
292 | 292 | <td class="labelcell">Timeout:</td> |
293 | - <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> |
|
293 | + <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> |
|
294 | 294 | <td class="labelcell">Protocol:</td> |
295 | 295 | <td><select name="protocol" onchange="switchssl(); switchauth(); swicthcainfo();"> |
296 | 296 | <option value="0"<?php if ($protocol == 0) { echo ' selected="selected"'; } ?>>HTTP 1.0</option> |
@@ -361,4 +361,4 @@ discard block |
||
361 | 361 | </form> |
362 | 362 | </body> |
363 | 363 | </html> |
364 | -<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_append.php"; ?> |
|
364 | +<?php if (getenv('TESTMODE') === 'true') require_once __DIR__."../demo/server/_append.php"; ?> |
@@ -14,7 +14,9 @@ discard block |
||
14 | 14 | * @todo if js libs are not available, do not try to load them |
15 | 15 | **/ |
16 | 16 | |
17 | -if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_prepend.php"; |
|
17 | +if (getenv('TESTMODE') === 'true') { |
|
18 | + require_once __DIR__ . "../demo/server/_prepend.php"; |
|
19 | +} |
|
18 | 20 | |
19 | 21 | // Make sure we set the correct charset type for output, so that we can display all characters |
20 | 22 | header('Content-Type: text/html; charset=utf-8'); |
@@ -34,7 +36,12 @@ discard block |
||
34 | 36 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
35 | 37 | <head> |
36 | 38 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
37 | - <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSONRPC'; else echo 'XMLRPC'; ?> Debugger</title> |
|
39 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
40 | + echo 'JSONRPC'; |
|
41 | +} else { |
|
42 | + echo 'XMLRPC'; |
|
43 | +} |
|
44 | +?> Debugger</title> |
|
38 | 45 | <meta name="robots" content="index,nofollow"/> |
39 | 46 | <script type="text/javascript" language="Javascript"> |
40 | 47 | if (window.name != 'frmcontroller') |
@@ -361,4 +368,7 @@ discard block |
||
361 | 368 | </form> |
362 | 369 | </body> |
363 | 370 | </html> |
364 | -<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_append.php"; ?> |
|
371 | +<?php if (getenv('TESTMODE') === 'true') { |
|
372 | + require_once __DIR__ . "../demo/server/_append.php"; |
|
373 | +} |
|
374 | +?> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj |
10 | 10 | **/ |
11 | 11 | |
12 | -if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_prepend.php"; |
|
12 | +if (getenv('TESTMODE') === 'true') require_once __DIR__."../demo/server/_prepend.php"; |
|
13 | 13 | |
14 | 14 | header('Content-Type: text/html; charset=utf-8'); |
15 | 15 | |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | <body> |
95 | 95 | <?php |
96 | 96 | |
97 | -include __DIR__ . '/common.php'; |
|
97 | +include __DIR__.'/common.php'; |
|
98 | 98 | |
99 | 99 | if ($action) { |
100 | 100 | |
101 | 101 | // make sure the script waits long enough for the call to complete... |
102 | 102 | if ($timeout) { |
103 | - set_time_limit($timeout + 10); |
|
103 | + set_time_limit($timeout+10); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | if ($wstype == 1) { |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | $server = "$host$path"; |
126 | 126 | } |
127 | 127 | if ($protocol == 2) { |
128 | - $server = 'https://' . $server; |
|
128 | + $server = 'https://'.$server; |
|
129 | 129 | } else { |
130 | - $server = 'http://' . $server; |
|
130 | + $server = 'http://'.$server; |
|
131 | 131 | } |
132 | 132 | if ($proxy != '') { |
133 | 133 | $pproxy = explode(':', $proxy); |
134 | - if (count($pproxy) > 1) { |
|
134 | + if (count($pproxy)>1) { |
|
135 | 135 | $pport = $pproxy[1]; |
136 | 136 | } else { |
137 | 137 | $pport = 8080; |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | case 'wrap': |
201 | 201 | $msg[0] = new $requestClass('system.methodHelp', array(), $id); |
202 | 202 | $msg[0]->addparam(new PhpXmlRpc\Value($method)); |
203 | - $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1); |
|
203 | + $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1); |
|
204 | 204 | $msg[1]->addparam(new PhpXmlRpc\Value($method)); |
205 | - $actionname = 'Description of method "' . $method . '"'; |
|
205 | + $actionname = 'Description of method "'.$method.'"'; |
|
206 | 206 | break; |
207 | 207 | case 'list': |
208 | 208 | $msg[0] = new $requestClass('system.listMethods', array(), $id); |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | $msg[0] = new $requestClass($method, array(), $id); |
216 | 216 | // hack! build xml payload by hand |
217 | 217 | if ($wstype == 1) { |
218 | - $msg[0]->payload = "{\n" . |
|
219 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
220 | - $payload . |
|
218 | + $msg[0]->payload = "{\n". |
|
219 | + '"method": "'.$method."\",\n\"params\": [". |
|
220 | + $payload. |
|
221 | 221 | "\n],\n\"id\": "; |
222 | 222 | // fix: if user gave an empty string, use NULL, or we'll break json syntax |
223 | 223 | if ($id == "") { |
@@ -230,20 +230,20 @@ discard block |
||
230 | 230 | } |
231 | 231 | } |
232 | 232 | } else { |
233 | - $msg[0]->payload = $msg[0]->xml_header($inputcharset) . |
|
234 | - '<methodName>' . $method . "</methodName>\n<params>" . |
|
235 | - $payload . |
|
236 | - "</params>\n" . $msg[0]->xml_footer(); |
|
233 | + $msg[0]->payload = $msg[0]->xml_header($inputcharset). |
|
234 | + '<methodName>'.$method."</methodName>\n<params>". |
|
235 | + $payload. |
|
236 | + "</params>\n".$msg[0]->xml_footer(); |
|
237 | 237 | } |
238 | - $actionname = 'Execution of method ' . $method; |
|
238 | + $actionname = 'Execution of method '.$method; |
|
239 | 239 | break; |
240 | 240 | default: // give a warning |
241 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; |
|
241 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | // Before calling execute, echo out brief description of action taken + date and time ??? |
245 | 245 | // this gives good user feedback for long-running methods... |
246 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; |
|
246 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; |
|
247 | 247 | flush(); |
248 | 248 | |
249 | 249 | $response = null; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | break; |
262 | 262 | } |
263 | 263 | } |
264 | - $time = microtime(true) - $time; |
|
264 | + $time = microtime(true)-$time; |
|
265 | 265 | if ($debug) { |
266 | 266 | echo "</div>\n"; |
267 | 267 | } |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | // call failed! echo out error msg! |
272 | 272 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; |
273 | 273 | echo "<h3>$protoName call FAILED!</h3>\n"; |
274 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
275 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; |
|
274 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
275 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; |
|
276 | 276 | echo(date("d/M/Y:H:i:s\n")); |
277 | 277 | } else { |
278 | 278 | // call succeeded: parse results |
@@ -288,36 +288,36 @@ discard block |
||
288 | 288 | $max = $v->count(); |
289 | 289 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
290 | 290 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; |
291 | - foreach($v as $i => $rec) { |
|
291 | + foreach ($v as $i => $rec) { |
|
292 | 292 | if ($i % 2) { |
293 | 293 | $class = ' class="oddrow"'; |
294 | 294 | } else { |
295 | 295 | $class = ' class="evenrow"'; |
296 | 296 | } |
297 | - echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . |
|
298 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
299 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
300 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
301 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
302 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
303 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
304 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
305 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
306 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
307 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
308 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
309 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
310 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
311 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
312 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
313 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
314 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
315 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
316 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
317 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . |
|
318 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
319 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . |
|
320 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
297 | + echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". |
|
298 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
299 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
300 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
301 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
302 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
303 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
304 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
305 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
306 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
307 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
308 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
309 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
310 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
311 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
312 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
313 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
314 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
315 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
316 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
317 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". |
|
318 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
319 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". |
|
320 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
321 | 321 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); |
322 | 322 | //echo("</tr>\n"); |
323 | 323 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $r2 = $resp[1]->value(); |
345 | 345 | |
346 | 346 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
347 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
347 | + echo "<thead>\n<tr><th>Method</th><th>".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
348 | 348 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
349 | 349 | if ($desc == "") { |
350 | 350 | $desc = "-"; |
@@ -354,41 +354,41 @@ discard block |
||
354 | 354 | if ($r2->kindOf() != "array") { |
355 | 355 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; |
356 | 356 | } else { |
357 | - foreach($r2 as $i => $x) { |
|
357 | + foreach ($r2 as $i => $x) { |
|
358 | 358 | $payload = ""; |
359 | 359 | $alt_payload = ""; |
360 | - if ($i + 1 % 2) { |
|
360 | + if ($i+1 % 2) { |
|
361 | 361 | $class = ' class="oddrow"'; |
362 | 362 | } else { |
363 | 363 | $class = ' class="evenrow"'; |
364 | 364 | } |
365 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; |
|
365 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; |
|
366 | 366 | if ($x->kindOf() == "array") { |
367 | 367 | $ret = $x[0]; |
368 | - echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
|
369 | - if ($x->count() > 1) { |
|
370 | - foreach($x as $k => $y) { |
|
368 | + echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; |
|
369 | + if ($x->count()>1) { |
|
370 | + foreach ($x as $k => $y) { |
|
371 | 371 | if ($k == 0) continue; |
372 | 372 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
373 | 373 | if ($wstype != 1) { |
374 | 374 | $type = $y->scalarval(); |
375 | 375 | $payload .= '<param><value>'; |
376 | - switch($type) { |
|
376 | + switch ($type) { |
|
377 | 377 | case 'undefined': |
378 | 378 | break; |
379 | 379 | case 'null'; |
380 | 380 | $type = 'nil'; |
381 | 381 | // fall thru intentionally |
382 | 382 | default: |
383 | - $payload .= '<' . |
|
384 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
385 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
383 | + $payload .= '<'. |
|
384 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
385 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
386 | 386 | '>'; |
387 | 387 | } |
388 | 388 | $payload .= "</value></param>\n"; |
389 | 389 | } |
390 | 390 | $alt_payload .= $y->scalarval(); |
391 | - if ($k < $x->count() - 1) { |
|
391 | + if ($k<$x->count()-1) { |
|
392 | 392 | $alt_payload .= ';'; |
393 | 393 | echo ", "; |
394 | 394 | } |
@@ -401,63 +401,63 @@ discard block |
||
401 | 401 | echo '</td>'; |
402 | 402 | // button to test this method |
403 | 403 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; |
404 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
405 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
406 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
407 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
408 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
409 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
410 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
411 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
412 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
413 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
414 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
415 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
416 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
417 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
418 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
419 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
420 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
421 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
422 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
423 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
424 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
425 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
426 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
427 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
404 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
405 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
406 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
407 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
408 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
409 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
410 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
411 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
412 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
413 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
414 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
415 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
416 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
417 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
418 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
419 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
420 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
421 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
422 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
423 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
424 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
425 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
426 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
427 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
428 | 428 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; |
429 | 429 | if ($wstype != 1) { |
430 | 430 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; |
431 | 431 | } |
432 | 432 | echo "</form></td>\n"; |
433 | 433 | |
434 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
435 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
436 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
437 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
438 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
439 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
440 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
441 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
442 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
443 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
444 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
445 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
446 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
447 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
448 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
449 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
450 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
451 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
452 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
453 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
454 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
455 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . |
|
456 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
457 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
458 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
459 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
460 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . |
|
434 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
435 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
436 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
437 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
438 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
439 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
440 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
441 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
442 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
443 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
444 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
445 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
446 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
447 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
448 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
449 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
450 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
451 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
452 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
453 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
454 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
455 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". |
|
456 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
457 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
458 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
459 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
460 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". |
|
461 | 461 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; |
462 | 462 | echo "</form></td></tr>\n"; |
463 | 463 | } |
@@ -469,14 +469,14 @@ discard block |
||
469 | 469 | case 'wrap': |
470 | 470 | $r1 = $resp[0]->value(); |
471 | 471 | $r2 = $resp[1]->value(); |
472 | - if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { |
|
472 | + if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { |
|
473 | 473 | echo "Error: signature unknown\n"; |
474 | 474 | } else { |
475 | 475 | $mdesc = $r1->scalarval(); |
476 | 476 | $encoder = new PhpXmlRpc\Encoder(); |
477 | 477 | $msig = $encoder->decode($r2); |
478 | 478 | $msig = $msig[$methodsig]; |
479 | - $proto = $protocol == 2 ? 'https' : ( $protocol == 1 ? 'http11' : '' ); |
|
479 | + $proto = $protocol == 2 ? 'https' : ($protocol == 1 ? 'http11' : ''); |
|
480 | 480 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && |
481 | 481 | $clientcookies == '' |
482 | 482 | ) { |
@@ -490,11 +490,11 @@ discard block |
||
490 | 490 | $prefix = 'xmlrpc'; |
491 | 491 | } |
492 | 492 | $wrapper = new PhpXmlRpc\Wrapper(); |
493 | - $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc); |
|
493 | + $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc); |
|
494 | 494 | //if ($code) |
495 | 495 | //{ |
496 | 496 | echo "<div id=\"phpcode\">\n"; |
497 | - highlight_string("<?php\n" . $code['docstring'] . $code['source'] . '?>'); |
|
497 | + highlight_string("<?php\n".$code['docstring'].$code['source'].'?>'); |
|
498 | 498 | echo "\n</div>"; |
499 | 499 | //} |
500 | 500 | //else |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | break; |
506 | 506 | |
507 | 507 | case 'execute': |
508 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; |
|
508 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; |
|
509 | 509 | break; |
510 | 510 | |
511 | 511 | default: // give a warning |
@@ -565,4 +565,4 @@ discard block |
||
565 | 565 | ?> |
566 | 566 | </body> |
567 | 567 | </html> |
568 | -<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_append.php"; ?> |
|
568 | +<?php if (getenv('TESTMODE') === 'true') require_once __DIR__."../demo/server/_append.php"; ?> |
@@ -9,7 +9,9 @@ discard block |
||
9 | 9 | * @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj |
10 | 10 | **/ |
11 | 11 | |
12 | -if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_prepend.php"; |
|
12 | +if (getenv('TESTMODE') === 'true') { |
|
13 | + require_once __DIR__ . "../demo/server/_prepend.php"; |
|
14 | +} |
|
13 | 15 | |
14 | 16 | header('Content-Type: text/html; charset=utf-8'); |
15 | 17 | |
@@ -19,7 +21,12 @@ discard block |
||
19 | 21 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
20 | 22 | <head> |
21 | 23 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
22 | - <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSONRPC'; else echo 'XMLRPC'; ?> Debugger</title> |
|
24 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
25 | + echo 'JSONRPC'; |
|
26 | +} else { |
|
27 | + echo 'XMLRPC'; |
|
28 | +} |
|
29 | +?> Debugger</title> |
|
23 | 30 | <meta name="robots" content="index,nofollow"/> |
24 | 31 | <style type="text/css"> |
25 | 32 | <!-- |
@@ -368,7 +375,9 @@ discard block |
||
368 | 375 | echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
369 | 376 | if ($x->count() > 1) { |
370 | 377 | foreach($x as $k => $y) { |
371 | - if ($k == 0) continue; |
|
378 | + if ($k == 0) { |
|
379 | + continue; |
|
380 | + } |
|
372 | 381 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
373 | 382 | if ($wstype != 1) { |
374 | 383 | $type = $y->scalarval(); |
@@ -565,4 +574,7 @@ discard block |
||
565 | 574 | ?> |
566 | 575 | </body> |
567 | 576 | </html> |
568 | -<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_append.php"; ?> |
|
577 | +<?php if (getenv('TESTMODE') === 'true') { |
|
578 | + require_once __DIR__ . "../demo/server/_append.php"; |
|
579 | +} |
|
580 | +?> |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_prepend.php"; |
|
3 | +if (getenv('TESTMODE') === 'true') require_once __DIR__."../demo/server/_prepend.php"; |
|
4 | 4 | |
5 | 5 | $query = ''; |
6 | 6 | if (isset($_GET['run'])) { |
7 | 7 | $path = parse_url($_GET['run']); |
8 | 8 | if (isset($path['query'])) { |
9 | - $query = '?' . $path['query']; |
|
9 | + $query = '?'.$path['query']; |
|
10 | 10 | } |
11 | 11 | } |
12 | 12 | ?> |
@@ -23,4 +23,4 @@ discard block |
||
23 | 23 | <frame name="frmaction" src="action.php" marginwidth="0" marginheight="0" frameborder="0"/> |
24 | 24 | </frameset> |
25 | 25 | </html> |
26 | -<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_append.php"; ?> |
|
26 | +<?php if (getenv('TESTMODE') === 'true') require_once __DIR__."../demo/server/_append.php"; ?> |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_prepend.php"; |
|
3 | +if (getenv('TESTMODE') === 'true') { |
|
4 | + require_once __DIR__ . "../demo/server/_prepend.php"; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | $query = ''; |
6 | 8 | if (isset($_GET['run'])) { |
@@ -15,7 +17,12 @@ discard block |
||
15 | 17 | <html lang="en"> |
16 | 18 | <head> |
17 | 19 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
18 | - <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSONRPC'; else echo 'XMLRPC'; ?> Debugger</title> |
|
20 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
21 | + echo 'JSONRPC'; |
|
22 | +} else { |
|
23 | + echo 'XMLRPC'; |
|
24 | +} |
|
25 | +?> Debugger</title> |
|
19 | 26 | </head> |
20 | 27 | <frameset rows="360,*"> |
21 | 28 | <frame name="frmcontroller" src="controller.php<?php echo htmlspecialchars($query); ?>" marginwidth="0" |
@@ -23,4 +30,7 @@ discard block |
||
23 | 30 | <frame name="frmaction" src="action.php" marginwidth="0" marginheight="0" frameborder="0"/> |
24 | 31 | </frameset> |
25 | 32 | </html> |
26 | -<?php if (getenv('TESTMODE') === 'true') require_once __DIR__ . "../demo/server/_append.php"; ?> |
|
33 | +<?php if (getenv('TESTMODE') === 'true') { |
|
34 | + require_once __DIR__ . "../demo/server/_append.php"; |
|
35 | +} |
|
36 | +?> |
@@ -151,35 +151,35 @@ discard block |
||
151 | 151 | public function serialize($charsetEncoding = '') |
152 | 152 | { |
153 | 153 | if ($charsetEncoding != '') { |
154 | - $this->content_type = 'text/xml; charset=' . $charsetEncoding; |
|
154 | + $this->content_type = 'text/xml; charset='.$charsetEncoding; |
|
155 | 155 | } else { |
156 | 156 | $this->content_type = 'text/xml'; |
157 | 157 | } |
158 | 158 | if (PhpXmlRpc::$xmlrpc_null_apache_encoding) { |
159 | - $result = "<methodResponse xmlns:ex=\"" . PhpXmlRpc::$xmlrpc_null_apache_encoding_ns . "\">\n"; |
|
159 | + $result = "<methodResponse xmlns:ex=\"".PhpXmlRpc::$xmlrpc_null_apache_encoding_ns."\">\n"; |
|
160 | 160 | } else { |
161 | 161 | $result = "<methodResponse>\n"; |
162 | 162 | } |
163 | 163 | if ($this->errno) { |
164 | 164 | // Let non-ASCII response messages be tolerated by clients by xml-encoding non ascii chars |
165 | - $result .= "<fault>\n" . |
|
166 | - "<value>\n<struct><member><name>faultCode</name>\n<value><int>" . $this->errno . |
|
167 | - "</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>" . |
|
168 | - Charset::instance()->encodeEntities($this->errstr, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</string></value>\n</member>\n" . |
|
165 | + $result .= "<fault>\n". |
|
166 | + "<value>\n<struct><member><name>faultCode</name>\n<value><int>".$this->errno. |
|
167 | + "</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>". |
|
168 | + Charset::instance()->encodeEntities($this->errstr, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</string></value>\n</member>\n". |
|
169 | 169 | "</struct>\n</value>\n</fault>"; |
170 | 170 | } else { |
171 | 171 | if (!is_object($this->val) || !is_a($this->val, 'PhpXmlRpc\Value')) { |
172 | 172 | if (is_string($this->val) && $this->valtyp == 'xml') { |
173 | - $result .= "<params>\n<param>\n" . |
|
174 | - $this->val . |
|
173 | + $result .= "<params>\n<param>\n". |
|
174 | + $this->val. |
|
175 | 175 | "</param>\n</params>"; |
176 | 176 | } else { |
177 | 177 | /// @todo try to build something serializable using the Encoder... |
178 | 178 | throw new \Exception('cannot serialize xmlrpc response objects whose content is native php values'); |
179 | 179 | } |
180 | 180 | } else { |
181 | - $result .= "<params>\n<param>\n" . |
|
182 | - $this->val->serialize($charsetEncoding) . |
|
181 | + $result .= "<params>\n<param>\n". |
|
182 | + $this->val->serialize($charsetEncoding). |
|
183 | 183 | "</param>\n</params>"; |
184 | 184 | } |
185 | 185 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | //trigger_error('getting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED); |
197 | 197 | |
198 | - switch($name) { |
|
198 | + switch ($name) { |
|
199 | 199 | case 'hdrs': |
200 | 200 | return $this->httpResponse['headers']; |
201 | 201 | case '_cookies': |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | return $this->httpResponse['raw_data']; |
205 | 205 | default: |
206 | 206 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
207 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
207 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
208 | 208 | return null; |
209 | 209 | } |
210 | 210 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | //trigger_error('setting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED); |
215 | 215 | |
216 | - switch($name) { |
|
216 | + switch ($name) { |
|
217 | 217 | case 'hdrs': |
218 | 218 | $this->httpResponse['headers'] = $value; |
219 | 219 | break; |
@@ -225,13 +225,13 @@ discard block |
||
225 | 225 | break; |
226 | 226 | default: |
227 | 227 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
228 | - trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
228 | + trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | 232 | public function __isset($name) |
233 | 233 | { |
234 | - switch($name) { |
|
234 | + switch ($name) { |
|
235 | 235 | case 'hdrs': |
236 | 236 | return isset($this->httpResponse['headers']); |
237 | 237 | case '_cookies': |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | public function __unset($name) |
247 | 247 | { |
248 | - switch($name) { |
|
248 | + switch ($name) { |
|
249 | 249 | case 'hdrs': |
250 | 250 | unset($this->httpResponse['headers']); |
251 | 251 | break; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | break; |
258 | 258 | default: |
259 | 259 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
260 | - trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
260 | + trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | public function xml_header($charsetEncoding = '') |
91 | 91 | { |
92 | 92 | if ($charsetEncoding != '') { |
93 | - return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?" . ">\n<methodCall>\n"; |
|
93 | + return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?".">\n<methodCall>\n"; |
|
94 | 94 | } else { |
95 | - return "<?xml version=\"1.0\"?" . ">\n<methodCall>\n"; |
|
95 | + return "<?xml version=\"1.0\"?".">\n<methodCall>\n"; |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | public function createPayload($charsetEncoding = '') |
113 | 113 | { |
114 | 114 | if ($charsetEncoding != '') { |
115 | - $this->content_type = 'text/xml; charset=' . $charsetEncoding; |
|
115 | + $this->content_type = 'text/xml; charset='.$charsetEncoding; |
|
116 | 116 | } else { |
117 | 117 | $this->content_type = 'text/xml'; |
118 | 118 | } |
119 | 119 | $this->payload = $this->xml_header($charsetEncoding); |
120 | - $this->payload .= '<methodName>' . $this->getCharsetEncoder()->encodeEntities( |
|
121 | - $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n"; |
|
120 | + $this->payload .= '<methodName>'.$this->getCharsetEncoder()->encodeEntities( |
|
121 | + $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</methodName>\n"; |
|
122 | 122 | $this->payload .= "<params>\n"; |
123 | 123 | foreach ($this->params as $p) { |
124 | - $this->payload .= "<param>\n" . $p->serialize($charsetEncoding) . |
|
124 | + $this->payload .= "<param>\n".$p->serialize($charsetEncoding). |
|
125 | 125 | "</param>\n"; |
126 | 126 | } |
127 | 127 | $this->payload .= "</params>\n"; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array()); |
249 | 249 | |
250 | 250 | if ($data == '') { |
251 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': no response received from server.'); |
|
251 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': no response received from server.'); |
|
252 | 252 | return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']); |
253 | 253 | } |
254 | 254 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | // failed processing of HTTP response headers |
262 | 262 | // save into response obj the full payload received, for debugging |
263 | 263 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data, 'status_code', $e->statusCode())); |
264 | - } catch(\Exception $e) { |
|
264 | + } catch (\Exception $e) { |
|
265 | 265 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data)); |
266 | 266 | } |
267 | 267 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // idea from Luca Mariano <[email protected]> originally in PEARified version of the lib |
276 | 276 | $pos = strrpos($data, '</methodResponse>'); |
277 | 277 | if ($pos !== false) { |
278 | - $data = substr($data, 0, $pos + 17); |
|
278 | + $data = substr($data, 0, $pos+17); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | // try to 'guestimate' the character encoding of the received response |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | if ($start) { |
287 | 287 | $start += strlen('<!-- SERVER DEBUG INFO (BASE64 ENCODED):'); |
288 | 288 | $end = strpos($data, '-->', $start); |
289 | - $comments = substr($data, $start, $end - $start); |
|
290 | - $this->getLogger()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t" . |
|
291 | - str_replace("\n", "\n\t", base64_decode($comments)) . "\n---END---", $respEncoding); |
|
289 | + $comments = substr($data, $start, $end-$start); |
|
290 | + $this->getLogger()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t". |
|
291 | + str_replace("\n", "\n\t", base64_decode($comments))."\n---END---", $respEncoding); |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if (extension_loaded('mbstring')) { |
312 | 312 | $data = mb_convert_encoding($data, 'UTF-8', $respEncoding); |
313 | 313 | } else { |
314 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received response: ' . $respEncoding); |
|
314 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': invalid charset encoding of received response: '.$respEncoding); |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | } |
@@ -332,12 +332,12 @@ discard block |
||
332 | 332 | $xmlRpcParser->parse($data, $returnType, XMLParser::ACCEPT_RESPONSE, $options); |
333 | 333 | |
334 | 334 | // first error check: xml not well formed |
335 | - if ($xmlRpcParser->_xh['isf'] > 2) { |
|
335 | + if ($xmlRpcParser->_xh['isf']>2) { |
|
336 | 336 | |
337 | 337 | // BC break: in the past for some cases we used the error message: 'XML error at line 1, check URL' |
338 | 338 | |
339 | 339 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_xml'], |
340 | - PhpXmlRpc::$xmlrpcstr['invalid_xml'] . ' ' . $xmlRpcParser->_xh['isf_reason'], '', |
|
340 | + PhpXmlRpc::$xmlrpcstr['invalid_xml'].' '.$xmlRpcParser->_xh['isf_reason'], '', |
|
341 | 341 | $this->httpResponse |
342 | 342 | ); |
343 | 343 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | // second error check: xml well formed but not xml-rpc compliant |
349 | 349 | elseif ($xmlRpcParser->_xh['isf'] == 2) { |
350 | 350 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_not_compliant'], |
351 | - PhpXmlRpc::$xmlrpcstr['xml_not_compliant'] . ' ' . $xmlRpcParser->_xh['isf_reason'], '', |
|
351 | + PhpXmlRpc::$xmlrpcstr['xml_not_compliant'].' '.$xmlRpcParser->_xh['isf_reason'], '', |
|
352 | 352 | $this->httpResponse |
353 | 353 | ); |
354 | 354 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | '', $this->httpResponse |
365 | 365 | ); |
366 | 366 | } else { |
367 | - if ($this->debug > 1) { |
|
367 | + if ($this->debug>1) { |
|
368 | 368 | $this->getLogger()->debugMessage( |
369 | 369 | "---PARSED---\n".var_export($xmlRpcParser->_xh['value'], true)."\n---END---" |
370 | 370 | ); |