@@ -91,15 +91,15 @@ discard block |
||
91 | 91 | <body> |
92 | 92 | <?php |
93 | 93 | |
94 | -include __DIR__ . '/common.php'; |
|
94 | +include __DIR__.'/common.php'; |
|
95 | 95 | if ($action) { |
96 | 96 | |
97 | - include_once __DIR__ . "/../src/Autoloader.php"; |
|
97 | + include_once __DIR__."/../src/Autoloader.php"; |
|
98 | 98 | PhpXmlRpc\Autoloader::register(); |
99 | 99 | |
100 | 100 | // make sure the script waits long enough for the call to complete... |
101 | 101 | if ($timeout) { |
102 | - set_time_limit($timeout + 10); |
|
102 | + set_time_limit($timeout+10); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | if ($wstype == 1) { |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | $server = "$host$path"; |
125 | 125 | } |
126 | 126 | if ($protocol == 2) { |
127 | - $server = 'https://' . $server; |
|
127 | + $server = 'https://'.$server; |
|
128 | 128 | } else { |
129 | - $server = 'http://' . $server; |
|
129 | + $server = 'http://'.$server; |
|
130 | 130 | } |
131 | 131 | if ($proxy != '') { |
132 | 132 | $pproxy = explode(':', $proxy); |
133 | - if (count($pproxy) > 1) { |
|
133 | + if (count($pproxy)>1) { |
|
134 | 134 | $pport = $pproxy[1]; |
135 | 135 | } else { |
136 | 136 | $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 xml payload by hand |
216 | 216 | if ($wstype == 1) { |
217 | - $msg[0]->payload = "{\n" . |
|
218 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
219 | - $payload . |
|
217 | + $msg[0]->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 == "") { |
@@ -229,20 +229,20 @@ discard block |
||
229 | 229 | } |
230 | 230 | } |
231 | 231 | } else { |
232 | - $msg[0]->payload = $msg[0]->xml_header($inputcharset) . |
|
233 | - '<methodName>' . $method . "</methodName>\n<params>" . |
|
234 | - $payload . |
|
235 | - "</params>\n" . $msg[0]->xml_footer(); |
|
232 | + $msg[0]->payload = $msg[0]->xml_header($inputcharset). |
|
233 | + '<methodName>'.$method."</methodName>\n<params>". |
|
234 | + $payload. |
|
235 | + "</params>\n".$msg[0]->xml_footer(); |
|
236 | 236 | } |
237 | - $actionname = 'Execution of method ' . $method; |
|
237 | + $actionname = 'Execution of method '.$method; |
|
238 | 238 | break; |
239 | 239 | default: // give a warning |
240 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; |
|
240 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | // Before calling execute, echo out brief description of action taken + date and time ??? |
244 | 244 | // this gives good user feedback for long-running methods... |
245 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; |
|
245 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; |
|
246 | 246 | flush(); |
247 | 247 | |
248 | 248 | $response = null; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | break; |
261 | 261 | } |
262 | 262 | } |
263 | - $time = microtime(true) - $time; |
|
263 | + $time = microtime(true)-$time; |
|
264 | 264 | if ($debug) { |
265 | 265 | echo "</div>\n"; |
266 | 266 | } |
@@ -270,8 +270,8 @@ discard block |
||
270 | 270 | // call failed! echo out error msg! |
271 | 271 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; |
272 | 272 | echo "<h3>$protoName call FAILED!</h3>\n"; |
273 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
274 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; |
|
273 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
274 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; |
|
275 | 275 | echo(strftime("%d/%b/%Y:%H:%M:%S\n")); |
276 | 276 | } else { |
277 | 277 | // call succeeded: parse results |
@@ -287,36 +287,36 @@ discard block |
||
287 | 287 | $max = $v->count(); |
288 | 288 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
289 | 289 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; |
290 | - foreach($v as $i => $rec) { |
|
290 | + foreach ($v as $i => $rec) { |
|
291 | 291 | if ($i % 2) { |
292 | 292 | $class = ' class="oddrow"'; |
293 | 293 | } else { |
294 | 294 | $class = ' class="evenrow"'; |
295 | 295 | } |
296 | - echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . |
|
297 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
298 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
299 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
300 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
301 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
302 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
303 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
304 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
305 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
306 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
307 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
308 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
309 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
310 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
311 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
312 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
313 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
314 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
315 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
316 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . |
|
317 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
318 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . |
|
319 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
296 | + echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". |
|
297 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
298 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
299 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
300 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
301 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
302 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
303 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
304 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
305 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
306 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
307 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
308 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
309 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
310 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
311 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
312 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
313 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
314 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
315 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
316 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". |
|
317 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
318 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". |
|
319 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
320 | 320 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); |
321 | 321 | //echo("</tr>\n"); |
322 | 322 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $r2 = $resp[1]->value(); |
344 | 344 | |
345 | 345 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
346 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
346 | + 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 | 347 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
348 | 348 | if ($desc == "") { |
349 | 349 | $desc = "-"; |
@@ -353,41 +353,41 @@ discard block |
||
353 | 353 | if ($r2->kindOf() != "array") { |
354 | 354 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; |
355 | 355 | } else { |
356 | - foreach($r2 as $i => $x) { |
|
356 | + foreach ($r2 as $i => $x) { |
|
357 | 357 | $payload = ""; |
358 | 358 | $alt_payload = ""; |
359 | - if ($i + 1 % 2) { |
|
359 | + if ($i+1 % 2) { |
|
360 | 360 | $class = ' class="oddrow"'; |
361 | 361 | } else { |
362 | 362 | $class = ' class="evenrow"'; |
363 | 363 | } |
364 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; |
|
364 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; |
|
365 | 365 | if ($x->kindOf() == "array") { |
366 | 366 | $ret = $x[0]; |
367 | - echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
|
368 | - if ($x->count() > 1) { |
|
369 | - foreach($x as $k => $y) { |
|
367 | + echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; |
|
368 | + if ($x->count()>1) { |
|
369 | + foreach ($x as $k => $y) { |
|
370 | 370 | if ($k == 0) continue; |
371 | 371 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
372 | 372 | if ($wstype != 1) { |
373 | 373 | $type = $y->scalarval(); |
374 | 374 | $payload .= '<param><value>'; |
375 | - switch($type) { |
|
375 | + switch ($type) { |
|
376 | 376 | case 'undefined': |
377 | 377 | break; |
378 | 378 | case 'null'; |
379 | 379 | $type = 'nil'; |
380 | 380 | // fall thru intentionally |
381 | 381 | default: |
382 | - $payload .= '<' . |
|
383 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
384 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
382 | + $payload .= '<'. |
|
383 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
384 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
385 | 385 | '>'; |
386 | 386 | } |
387 | 387 | $payload .= "</value></param>\n"; |
388 | 388 | } |
389 | 389 | $alt_payload .= $y->scalarval(); |
390 | - if ($k < $x->count() - 1) { |
|
390 | + if ($k<$x->count()-1) { |
|
391 | 391 | $alt_payload .= ';'; |
392 | 392 | echo ", "; |
393 | 393 | } |
@@ -400,63 +400,63 @@ discard block |
||
400 | 400 | echo '</td>'; |
401 | 401 | // button to test this method |
402 | 402 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; |
403 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
404 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
405 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
406 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
407 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
408 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
409 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
410 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
411 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
412 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
413 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
414 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
415 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
416 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
417 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
418 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
419 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
420 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
421 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
422 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
423 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
424 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
425 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
426 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
403 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
404 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
405 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
406 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
407 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
408 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
409 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
410 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
411 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
412 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
413 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
414 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
415 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
416 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
417 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
418 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
419 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
420 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
421 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
422 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
423 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
424 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
425 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
426 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
427 | 427 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; |
428 | 428 | if ($wstype != 1) { |
429 | 429 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; |
430 | 430 | } |
431 | 431 | echo "</form></td>\n"; |
432 | 432 | |
433 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
434 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
435 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
436 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
437 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
438 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
439 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
440 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
441 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
442 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
443 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
444 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
445 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
446 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
447 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
448 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
449 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
450 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
451 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
452 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
453 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
454 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . |
|
455 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
456 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
457 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
458 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
459 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . |
|
433 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
434 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
435 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
436 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
437 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
438 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
439 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
440 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
441 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
442 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
443 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
444 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
445 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
446 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
447 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
448 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
449 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
450 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
451 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
452 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
453 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
454 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". |
|
455 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
456 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
457 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
458 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
459 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". |
|
460 | 460 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; |
461 | 461 | echo "</form></td></tr>\n"; |
462 | 462 | } |
@@ -468,14 +468,14 @@ discard block |
||
468 | 468 | case 'wrap': |
469 | 469 | $r1 = $resp[0]->value(); |
470 | 470 | $r2 = $resp[1]->value(); |
471 | - if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { |
|
471 | + if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { |
|
472 | 472 | echo "Error: signature unknown\n"; |
473 | 473 | } else { |
474 | 474 | $mdesc = $r1->scalarval(); |
475 | 475 | $encoder = new PhpXmlRpc\Encoder(); |
476 | 476 | $msig = $encoder->decode($r2); |
477 | 477 | $msig = $msig[$methodsig]; |
478 | - $proto = $protocol == 2 ? 'https' : ( $protocol == 1 ? 'http11' : '' ); |
|
478 | + $proto = $protocol == 2 ? 'https' : ($protocol == 1 ? 'http11' : ''); |
|
479 | 479 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && |
480 | 480 | $clientcookies == '' |
481 | 481 | ) { |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | $prefix = 'xmlrpc'; |
490 | 490 | } |
491 | 491 | $wrapper = new PhpXmlRpc\Wrapper(); |
492 | - $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc); |
|
492 | + $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc); |
|
493 | 493 | //if ($code) |
494 | 494 | //{ |
495 | 495 | echo "<div id=\"phpcode\">\n"; |
496 | - highlight_string("<?php\n" . $code['docstring'] . $code['source'] . '?>'); |
|
496 | + highlight_string("<?php\n".$code['docstring'].$code['source'].'?>'); |
|
497 | 497 | echo "\n</div>"; |
498 | 498 | //} |
499 | 499 | //else |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | break; |
505 | 505 | |
506 | 506 | case 'execute': |
507 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; |
|
507 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; |
|
508 | 508 | break; |
509 | 509 | |
510 | 510 | default: // give a warning |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | // check for command line (env vars) vs. web page input params |
45 | 45 | if (!isset($_SERVER['REQUEST_METHOD'])) { |
46 | - foreach($_SERVER as $key => $val) { |
|
46 | + foreach ($_SERVER as $key => $val) { |
|
47 | 47 | if (array_key_exists($key, $args)) { |
48 | 48 | $$key = $val; |
49 | 49 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | if ($HTTPURI[0] != '/') { |
90 | - $HTTPURI = '/' . $HTTPURI; |
|
90 | + $HTTPURI = '/'.$HTTPURI; |
|
91 | 91 | } |
92 | 92 | $args['HTTPURI'] = $HTTPURI; |
93 | 93 | |
@@ -101,21 +101,21 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($HTTPSIGNOREPEER)) { |
104 | - $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER; |
|
104 | + $args['HTTPSIGNOREPEER'] = (bool) $HTTPSIGNOREPEER; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if (isset($HTTPSVERIFYHOST)) { |
108 | - $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST; |
|
108 | + $args['HTTPSVERIFYHOST'] = (int) $HTTPSVERIFYHOST; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | if (isset($SSLVERSION)) { |
112 | - $args['SSLVERSION'] = (int)$SSLVERSION; |
|
112 | + $args['SSLVERSION'] = (int) $SSLVERSION; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (isset($PROXYSERVER)) { |
116 | 116 | $arr = explode(':', $PROXYSERVER); |
117 | 117 | $args['PROXYSERVER'] = $arr[0]; |
118 | - if (count($arr) > 1) { |
|
118 | + if (count($arr)>1) { |
|
119 | 119 | $args['PROXYPORT'] = $arr[1]; |
120 | 120 | } else { |
121 | 121 | $args['PROXYPORT'] = 8080; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LocalFileTestCase.php'; |
|
3 | +include_once __DIR__.'/LocalFileTestCase.php'; |
|
4 | 4 | |
5 | 5 | class DebuggerTest extends PhpXmlRpc_LocalFileTestCase |
6 | 6 | { |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | { |
9 | 9 | $this->args = argParser::getArgs(); |
10 | 10 | |
11 | - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['HTTPURI'] ); |
|
11 | + $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/debugger/', $this->args['HTTPURI']); |
|
12 | 12 | |
13 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
13 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function testIndex() |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LocalFileTestCase.php'; |
|
3 | +include_once __DIR__.'/LocalFileTestCase.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests for php files in the 'demo' directory |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | $this->args = argParser::getArgs(); |
13 | 13 | |
14 | - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['HTTPURI'] ); |
|
14 | + $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/demo/', $this->args['HTTPURI']); |
|
15 | 15 | |
16 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] ); |
|
16 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function testAgeSort() |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | use PhpXmlRpc\Response; |
20 | 20 | use PhpXmlRpc\Encoder; |
21 | 21 | |
22 | -include_once __DIR__ . '/../vendor/autoload.php'; |
|
22 | +include_once __DIR__.'/../vendor/autoload.php'; |
|
23 | 23 | |
24 | -include __DIR__ . '/parse_args.php'; |
|
24 | +include __DIR__.'/parse_args.php'; |
|
25 | 25 | $args = argParser::getArgs(); |
26 | 26 | |
27 | 27 | function begin_test($test_name, $test_case) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (!isset($test_results[$test_name][$test_case])) { |
42 | 42 | trigger_error('ending test that was not started'); |
43 | 43 | } |
44 | - $test_results[$test_name][$test_case]['time'] = $end - $test_results[$test_name][$test_case]['time']; |
|
44 | + $test_results[$test_name][$test_case]['time'] = $end-$test_results[$test_name][$test_case]['time']; |
|
45 | 45 | $test_results[$test_name][$test_case]['result'] = $test_result; |
46 | 46 | echo '.'; |
47 | 47 | flush(); |
@@ -75,24 +75,24 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | if ($is_web) { |
78 | - echo "<h3>Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "</h3>\n"; |
|
78 | + echo "<h3>Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."</h3>\n"; |
|
79 | 79 | if ($xd) { |
80 | - echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: " . htmlspecialchars(xdebug_get_profiler_filename()) . "</h4>\n"; |
|
80 | + echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: ".htmlspecialchars(xdebug_get_profiler_filename())."</h4>\n"; |
|
81 | 81 | } |
82 | 82 | flush(); |
83 | 83 | ob_flush(); |
84 | 84 | } else { |
85 | - echo "Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "\n"; |
|
85 | + echo "Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."\n"; |
|
86 | 86 | if ($xd) { |
87 | - echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: " . xdebug_get_profiler_filename() . "\n"; |
|
87 | + echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: ".xdebug_get_profiler_filename()."\n"; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | 91 | // test 'manual style' data encoding vs. 'automatic style' encoding |
92 | 92 | begin_test('Data encoding (large array)', 'manual encoding'); |
93 | -for ($i = 0; $i < $num_tests; $i++) { |
|
93 | +for ($i = 0; $i<$num_tests; $i++) { |
|
94 | 94 | $vals = array(); |
95 | - for ($j = 0; $j < 10; $j++) { |
|
95 | + for ($j = 0; $j<10; $j++) { |
|
96 | 96 | $valarray = array(); |
97 | 97 | foreach ($data[$j] as $key => $val) { |
98 | 98 | $values = array(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | begin_test('Data encoding (large array)', 'automatic encoding'); |
119 | 119 | $encoder = new Encoder(); |
120 | -for ($i = 0; $i < $num_tests; $i++) { |
|
120 | +for ($i = 0; $i<$num_tests; $i++) { |
|
121 | 121 | $value = $encoder->encode($data, array('auto_dates')); |
122 | 122 | $out = $value->serialize(); |
123 | 123 | } |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | |
126 | 126 | if (function_exists('xmlrpc_set_type')) { |
127 | 127 | begin_test('Data encoding (large array)', 'xmlrpc-epi encoding'); |
128 | - for ($i = 0; $i < $num_tests; $i++) { |
|
129 | - for ($j = 0; $j < 10; $j++) { |
|
128 | + for ($i = 0; $i<$num_tests; $i++) { |
|
129 | + for ($j = 0; $j<10; $j++) { |
|
130 | 130 | foreach ($keys as $k) { |
131 | 131 | xmlrpc_set_type($data[$j][$k][4], 'datetime'); |
132 | 132 | xmlrpc_set_type($data[$j][$k][8], 'datetime'); |
@@ -140,18 +140,18 @@ discard block |
||
140 | 140 | // test 'old style' data decoding vs. 'automatic style' decoding |
141 | 141 | $dummy = new Request(''); |
142 | 142 | $out = new Response($value); |
143 | -$in = '<?xml version="1.0" ?>' . "\n" . $out->serialize(); |
|
143 | +$in = '<?xml version="1.0" ?>'."\n".$out->serialize(); |
|
144 | 144 | |
145 | 145 | begin_test('Data decoding (large array)', 'manual decoding'); |
146 | -for ($i = 0; $i < $num_tests; $i++) { |
|
146 | +for ($i = 0; $i<$num_tests; $i++) { |
|
147 | 147 | $response = $dummy->ParseResponse($in, true); |
148 | 148 | $value = $response->value(); |
149 | 149 | $result = array(); |
150 | - foreach($value as $val1) { |
|
150 | + foreach ($value as $val1) { |
|
151 | 151 | $out = array(); |
152 | - foreach($val1 as $name => $val) { |
|
152 | + foreach ($val1 as $name => $val) { |
|
153 | 153 | $out[$name] = array(); |
154 | - foreach($val as $data) { |
|
154 | + foreach ($val as $data) { |
|
155 | 155 | $out[$name][] = $data->scalarval(); |
156 | 156 | } |
157 | 157 | } |
@@ -161,18 +161,18 @@ discard block |
||
161 | 161 | end_test('Data decoding (large array)', 'manual decoding', $result); |
162 | 162 | |
163 | 163 | begin_test('Data decoding (large array)', 'manual decoding deprecated'); |
164 | -for ($i = 0; $i < $num_tests; $i++) { |
|
164 | +for ($i = 0; $i<$num_tests; $i++) { |
|
165 | 165 | $response = $dummy->ParseResponse($in, true); |
166 | 166 | $value = $response->value(); |
167 | 167 | $result = array(); |
168 | 168 | $l = $value->arraysize(); |
169 | - for ($k = 0; $k < $l; $k++) { |
|
169 | + for ($k = 0; $k<$l; $k++) { |
|
170 | 170 | $val1 = $value->arraymem($k); |
171 | 171 | $out = array(); |
172 | - foreach($val1 as $name => $val) { |
|
172 | + foreach ($val1 as $name => $val) { |
|
173 | 173 | $out[$name] = array(); |
174 | 174 | $m = $val->arraysize(); |
175 | - for ($j = 0; $j < $m; $j++) { |
|
175 | + for ($j = 0; $j<$m; $j++) { |
|
176 | 176 | $data = $val->arraymem($j); |
177 | 177 | $out[$name][] = $data->scalarval(); |
178 | 178 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | end_test('Data decoding (large array)', 'manual decoding deprecated', $result); |
184 | 184 | |
185 | 185 | begin_test('Data decoding (large array)', 'automatic decoding'); |
186 | -for ($i = 0; $i < $num_tests; $i++) { |
|
186 | +for ($i = 0; $i<$num_tests; $i++) { |
|
187 | 187 | $response = $dummy->ParseResponse($in, true, 'phpvals'); |
188 | 188 | $value = $response->value(); |
189 | 189 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | if (function_exists('xmlrpc_decode')) { |
193 | 193 | begin_test('Data decoding (large array)', 'xmlrpc-epi decoding'); |
194 | - for ($i = 0; $i < $num_tests; $i++) { |
|
194 | + for ($i = 0; $i<$num_tests; $i++) { |
|
195 | 195 | $response = $dummy->ParseResponse($in, true, 'xml'); |
196 | 196 | $value = xmlrpc_decode($response->value()); |
197 | 197 | } |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | $value = $encoder->encode($data1, array('auto_dates')); |
208 | 208 | $req = new Request('interopEchoTests.echoValue', array($value)); |
209 | 209 | $reqs = array(); |
210 | - for ($i = 0; $i < $num_tests; $i++) { |
|
210 | + for ($i = 0; $i<$num_tests; $i++) { |
|
211 | 211 | $reqs[] = $req; |
212 | 212 | } |
213 | 213 | $server = explode(':', $args['HTTPSERVER']); |
214 | - if (count($server) > 1) { |
|
215 | - $srv = $server[1] . '://' . $server[0] . $args['HTTPURI']; |
|
214 | + if (count($server)>1) { |
|
215 | + $srv = $server[1].'://'.$server[0].$args['HTTPURI']; |
|
216 | 216 | $c = new Client($args['HTTPURI'], $server[0], $server[1]); |
217 | 217 | } else { |
218 | - $srv = $args['HTTPSERVER'] . $args['HTTPURI']; |
|
218 | + $srv = $args['HTTPSERVER'].$args['HTTPURI']; |
|
219 | 219 | $c = new Client($args['HTTPURI'], $args['HTTPSERVER']); |
220 | 220 | } |
221 | 221 | // do not interfere with http compression |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | begin_test($testName, 'http 10'); |
231 | 231 | $response = array(); |
232 | - for ($i = 0; $i < $num_tests; $i++) { |
|
232 | + for ($i = 0; $i<$num_tests; $i++) { |
|
233 | 233 | $resp = $c->send($req); |
234 | 234 | $response[] = $resp->value(); |
235 | 235 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | if (function_exists('curl_init')) { |
239 | 239 | begin_test($testName, 'http 11 w. keep-alive'); |
240 | 240 | $response = array(); |
241 | - for ($i = 0; $i < $num_tests; $i++) { |
|
241 | + for ($i = 0; $i<$num_tests; $i++) { |
|
242 | 242 | $resp = $c->send($req, 10, 'http11'); |
243 | 243 | $response[] = $resp->value(); |
244 | 244 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $c->keepalive = false; |
248 | 248 | begin_test($testName, 'http 11'); |
249 | 249 | $response = array(); |
250 | - for ($i = 0; $i < $num_tests; $i++) { |
|
250 | + for ($i = 0; $i<$num_tests; $i++) { |
|
251 | 251 | $resp = $c->send($req, 10, 'http11'); |
252 | 252 | $response[] = $resp->value(); |
253 | 253 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | begin_test($testName, 'http 10 w. compression'); |
269 | 269 | $response = array(); |
270 | - for ($i = 0; $i < $num_tests; $i++) { |
|
270 | + for ($i = 0; $i<$num_tests; $i++) { |
|
271 | 271 | $resp = $c->send($req); |
272 | 272 | $response[] = $resp->value(); |
273 | 273 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | if (function_exists('curl_init')) { |
277 | 277 | begin_test($testName, 'http 11 w. keep-alive and compression'); |
278 | 278 | $response = array(); |
279 | - for ($i = 0; $i < $num_tests; $i++) { |
|
279 | + for ($i = 0; $i<$num_tests; $i++) { |
|
280 | 280 | $resp = $c->send($req, 10, 'http11'); |
281 | 281 | $response[] = $resp->value(); |
282 | 282 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $c->keepalive = false; |
286 | 286 | begin_test($testName, 'http 11 w. compression'); |
287 | 287 | $response = array(); |
288 | - for ($i = 0; $i < $num_tests; $i++) { |
|
288 | + for ($i = 0; $i<$num_tests; $i++) { |
|
289 | 289 | $resp = $c->send($req, 10, 'http11'); |
290 | 290 | $response[] = $resp->value(); |
291 | 291 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | foreach ($test_results as $test => $results) { |
307 | 307 | echo "\nTEST: $test\n"; |
308 | 308 | foreach ($results as $case => $data) { |
309 | - echo " $case: {$data['time']} secs - Output data CRC: " . crc32(serialize($data['result'])) . "\n"; |
|
309 | + echo " $case: {$data['time']} secs - Output data CRC: ".crc32(serialize($data['result']))."\n"; |
|
310 | 310 | } |
311 | 311 | } |
312 | 312 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . "/_prepend.php"; |
|
3 | +require_once __DIR__."/_prepend.php"; |
|
4 | 4 | |
5 | 5 | use PhpXmlRpc\Value; |
6 | 6 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | $count = 0; |
32 | 32 | } |
33 | 33 | // add the new comment in |
34 | - dba_insert($msgID . "_comment_${count}", $comment, $dbh); |
|
35 | - dba_insert($msgID . "_name_${count}", $name, $dbh); |
|
34 | + dba_insert($msgID."_comment_${count}", $comment, $dbh); |
|
35 | + dba_insert($msgID."_name_${count}", $name, $dbh); |
|
36 | 36 | $count++; |
37 | 37 | dba_replace($countID, $count, $dbh); |
38 | 38 | dba_close($dbh); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $countID = "${msgID}_count"; |
66 | 66 | if (dba_exists($countID, $dbh)) { |
67 | 67 | $count = dba_fetch($countID, $dbh); |
68 | - for ($i = 0; $i < $count; $i++) { |
|
68 | + for ($i = 0; $i<$count; $i++) { |
|
69 | 69 | $name = dba_fetch("${msgID}_name_${i}", $dbh); |
70 | 70 | $comment = dba_fetch("${msgID}_comment_${i}", $dbh); |
71 | 71 | // push a new struct onto the return array |
@@ -101,4 +101,4 @@ discard block |
||
101 | 101 | ), |
102 | 102 | )); |
103 | 103 | |
104 | -require_once __DIR__ . "/_append.php"; |
|
104 | +require_once __DIR__."/_append.php"; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * Please do not copy this file verbatim into your production server. |
10 | 10 | **/ |
11 | 11 | |
12 | -require_once __DIR__ . "/_prepend.php"; |
|
12 | +require_once __DIR__."/_prepend.php"; |
|
13 | 13 | |
14 | 14 | use PhpXmlRpc\Value; |
15 | 15 | |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | // extract the value of the state number |
106 | 106 | $snv = $sno->scalarval(); |
107 | 107 | // look it up in our array (zero-based) |
108 | - if (isset($stateNames[$snv - 1])) { |
|
109 | - $stateName = $stateNames[$snv - 1]; |
|
108 | + if (isset($stateNames[$snv-1])) { |
|
109 | + $stateName = $stateNames[$snv-1]; |
|
110 | 110 | } else { |
111 | 111 | // not there, so complain |
112 | - $err = "I don't have a state for the index '" . $snv . "'"; |
|
112 | + $err = "I don't have a state for the index '".$snv."'"; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // if we generated an error, create an error return response |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | { |
136 | 136 | global $stateNames; |
137 | 137 | |
138 | - if (isset($stateNames[$stateNo - 1])) { |
|
139 | - return $stateNames[$stateNo - 1]; |
|
138 | + if (isset($stateNames[$stateNo-1])) { |
|
139 | + return $stateNames[$stateNo-1]; |
|
140 | 140 | } else { |
141 | 141 | // not, there so complain |
142 | - throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
142 | + throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
@@ -169,17 +169,17 @@ discard block |
||
169 | 169 | eval($findstate9_sig['source']); |
170 | 170 | |
171 | 171 | $findstate10_sig = array( |
172 | - "function" => function ($req) { return findState($req); }, |
|
172 | + "function" => function($req) { return findState($req); }, |
|
173 | 173 | "signature" => $findstate_sig, |
174 | 174 | "docstring" => $findstate_doc, |
175 | 175 | ); |
176 | 176 | |
177 | -$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return inner_findstate($stateNo); }); |
|
177 | +$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return inner_findstate($stateNo); }); |
|
178 | 178 | |
179 | 179 | $c = new xmlrpcServerMethodsContainer; |
180 | 180 | $moreSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'tests.', 'method_type' => 'all')); |
181 | 181 | |
182 | -$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
182 | +$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
183 | 183 | |
184 | 184 | // used to test signatures with NULL params |
185 | 185 | $findstate12_sig = array( |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $s = $req->getParam(0); |
206 | 206 | $t = $req->getParam(1); |
207 | 207 | |
208 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcInt)); |
|
208 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcInt)); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | $addtwodouble_sig = array(array(Value::$xmlrpcDouble, Value::$xmlrpcDouble, Value::$xmlrpcDouble)); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $s = $req->getParam(0); |
216 | 216 | $t = $req->getParam(1); |
217 | 217 | |
218 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcDouble)); |
|
218 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcDouble)); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | $stringecho_sig = array(array(Value::$xmlrpcString, Value::$xmlrpcString)); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | function echoBack($req) |
232 | 232 | { |
233 | 233 | // just sends back a string with what i got sent to me, just escaped, that's all |
234 | - $s = "I got the following message:\n" . $req->serialize(); |
|
234 | + $s = "I got the following message:\n".$req->serialize(); |
|
235 | 235 | |
236 | 236 | return new PhpXmlRpc\Response(new Value($s)); |
237 | 237 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | return 0; |
289 | 289 | } |
290 | 290 | |
291 | - return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1; |
|
291 | + return ($agesorter_arr[$a]>$agesorter_arr[$b]) ? -1 : 1; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $agesorter_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray)); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | // hack, must make global as uksort() won't |
335 | 335 | // allow us to pass any other auxiliary information |
336 | 336 | uksort($agesorter_arr, 'agesorter_compare'); |
337 | - foreach($agesorter_arr as $key => $val) { |
|
337 | + foreach ($agesorter_arr as $key => $val) { |
|
338 | 338 | // recreate each struct element |
339 | 339 | $v[] = new Value( |
340 | 340 | array( |
@@ -389,17 +389,17 @@ discard block |
||
389 | 389 | $err = "Error, no 'From' field specified"; |
390 | 390 | } |
391 | 391 | |
392 | - $msgHdr = "From: " . $mFrom->scalarval() . "\n"; |
|
393 | - $msgHdr .= "To: " . $mTo->scalarval() . "\n"; |
|
392 | + $msgHdr = "From: ".$mFrom->scalarval()."\n"; |
|
393 | + $msgHdr .= "To: ".$mTo->scalarval()."\n"; |
|
394 | 394 | |
395 | 395 | if ($mCc->scalarval() != "") { |
396 | - $msgHdr .= "Cc: " . $mCc->scalarval() . "\n"; |
|
396 | + $msgHdr .= "Cc: ".$mCc->scalarval()."\n"; |
|
397 | 397 | } |
398 | 398 | if ($mBcc->scalarval() != "") { |
399 | - $msgHdr .= "Bcc: " . $mBcc->scalarval() . "\n"; |
|
399 | + $msgHdr .= "Bcc: ".$mBcc->scalarval()."\n"; |
|
400 | 400 | } |
401 | 401 | if ($mMime->scalarval() != "") { |
402 | - $msgHdr .= "Content-type: " . $mMime->scalarval() . "\n"; |
|
402 | + $msgHdr .= "Content-type: ".$mMime->scalarval()."\n"; |
|
403 | 403 | } |
404 | 404 | $msgHdr .= "X-Mailer: XML-RPC for PHP mailer 1.0"; |
405 | 405 | |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $moe = $sno["moe"]; |
490 | 490 | $larry = $sno["larry"]; |
491 | 491 | $curly = $sno["curly"]; |
492 | - $num = $moe->scalarval() + $larry->scalarval() + $curly->scalarval(); |
|
492 | + $num = $moe->scalarval()+$larry->scalarval()+$curly->scalarval(); |
|
493 | 493 | |
494 | 494 | return new PhpXmlRpc\Response(new Value($num, Value::$xmlrpcInt)); |
495 | 495 | } |
@@ -531,9 +531,9 @@ discard block |
||
531 | 531 | $ar = $req->getParam(0); |
532 | 532 | $sz = $ar->count(); |
533 | 533 | $first = $ar[0]; |
534 | - $last = $ar[$sz - 1]; |
|
534 | + $last = $ar[$sz-1]; |
|
535 | 535 | |
536 | - return new PhpXmlRpc\Response(new Value($first->scalarval() . |
|
536 | + return new PhpXmlRpc\Response(new Value($first->scalarval(). |
|
537 | 537 | $last->scalarval(), Value::$xmlrpcString)); |
538 | 538 | } |
539 | 539 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | $larry = $fools["larry"]; |
568 | 568 | $moe = $fools["moe"]; |
569 | 569 | |
570 | - return new PhpXmlRpc\Response(new Value($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), Value::$xmlrpcInt)); |
|
570 | + return new PhpXmlRpc\Response(new Value($curly->scalarval()+$larry->scalarval()+$moe->scalarval(), Value::$xmlrpcInt)); |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | $v1_countTheEntities_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcString)); |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | $ap = 0; |
582 | 582 | $qu = 0; |
583 | 583 | $amp = 0; |
584 | - for ($i = 0; $i < strlen($str); $i++) { |
|
584 | + for ($i = 0; $i<strlen($str); $i++) { |
|
585 | 585 | $c = substr($str, $i, 1); |
586 | 586 | switch ($c) { |
587 | 587 | case ">": |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | ), |
784 | 784 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
785 | 785 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
786 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
786 | + "tests.utf8methodname.".'κόσμε' => array( |
|
787 | 787 | "function" => "stringEcho", |
788 | 788 | "signature" => $stringecho_sig, |
789 | 789 | "docstring" => $stringecho_doc, |
@@ -976,4 +976,4 @@ discard block |
||
976 | 976 | $s->service(); |
977 | 977 | // That should do all we need! |
978 | 978 | |
979 | -require_once __DIR__ . "/_append.php"; |
|
979 | +require_once __DIR__."/_append.php"; |
@@ -3,5 +3,5 @@ |
||
3 | 3 | // Out-of-band information: let the client manipulate the server operations. |
4 | 4 | // We do this to help the testsuite script: do not reproduce in production! |
5 | 5 | if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) { |
6 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
6 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
7 | 7 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @license code licensed under the BSD License: see file license.txt |
10 | 10 | */ |
11 | 11 | |
12 | -require_once __DIR__ . "/_prepend.php"; |
|
12 | +require_once __DIR__."/_prepend.php"; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Forward an xmlrpc request to another server, and return to client the response received. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $url = $encoder->decode($req->getParam(0)); |
30 | 30 | $client = new PhpXmlRpc\Client($url); |
31 | 31 | |
32 | - if ($req->getNumParams() > 3) { |
|
32 | + if ($req->getNumParams()>3) { |
|
33 | 33 | // we have to set some options onto the client. |
34 | 34 | // Note that if we do not untaint the received values, warnings might be generated... |
35 | 35 | $options = $encoder->decode($req->getParam(3)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $client->setSSLVerifyPeer($val); |
50 | 50 | break; |
51 | 51 | case 'Timeout': |
52 | - $timeout = (integer)$val; |
|
52 | + $timeout = (integer) $val; |
|
53 | 53 | break; |
54 | 54 | } // switch |
55 | 55 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // add debug info into response we give back to caller |
70 | - PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: " . $req->serialize()); |
|
70 | + PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: ".$req->serialize()); |
|
71 | 71 | |
72 | 72 | return $client->send($req, $timeout); |
73 | 73 | } |
@@ -88,4 +88,4 @@ discard block |
||
88 | 88 | ) |
89 | 89 | ); |
90 | 90 | |
91 | -require_once __DIR__ . "/_append.php"; |
|
91 | +require_once __DIR__."/_append.php"; |