| @@ -3,7 +3,7 @@ | ||
| 3 | 3 |  if (isset($_GET['run'])) { | 
| 4 | 4 | $path = parse_url($_GET['run']); | 
| 5 | 5 |      if (isset($path['query'])) { | 
| 6 | - $query = '?' . $path['query']; | |
| 6 | + $query = '?'.$path['query']; | |
| 7 | 7 | } | 
| 8 | 8 | } | 
| 9 | 9 | ?> | 
| @@ -12,7 +12,12 @@ | ||
| 12 | 12 | <html lang="en"> | 
| 13 | 13 | <head> | 
| 14 | 14 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> | 
| 15 | -    <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSONRPC'; else echo 'XMLRPC'; ?> Debugger</title> | |
| 15 | +    <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { | |
| 16 | + echo 'JSONRPC'; | |
| 17 | +} else { | |
| 18 | + echo 'XMLRPC'; | |
| 19 | +} | |
| 20 | +?> Debugger</title> | |
| 16 | 21 | </head> | 
| 17 | 22 | <frameset rows="360,*"> | 
| 18 | 23 | <frame name="frmcontroller" src="controller.php<?php echo htmlspecialchars($query); ?>" marginwidth="0" | 
| @@ -17,15 +17,15 @@ discard block | ||
| 17 | 17 | // Make sure we set the correct charset type for output, so that we can display all characters | 
| 18 | 18 |  header('Content-Type: text/html; charset=utf-8'); | 
| 19 | 19 | |
| 20 | -include __DIR__ . '/common.php'; | |
| 20 | +include __DIR__.'/common.php'; | |
| 21 | 21 |  if ($action == '') { | 
| 22 | 22 | $action = 'list'; | 
| 23 | 23 | } | 
| 24 | 24 | |
| 25 | 25 | // Relative path to the visual xmlrpc editing dialog | 
| 26 | 26 | // We allow to easily configure this path via defines | 
| 27 | -$editorpath = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..') . '/jsxmlrpc/debugger/'; | |
| 28 | -$editorlibs = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..') . '/jsxmlrpc/lib/'; | |
| 27 | +$editorpath = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..').'/jsxmlrpc/debugger/'; | |
| 28 | +$editorlibs = (defined('JSXMLRPC_PATH') ? JSXMLRPC_PATH : '../..').'/jsxmlrpc/lib/'; | |
| 29 | 29 | ?> | 
| 30 | 30 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 
| 31 | 31 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 
| @@ -230,9 +230,9 @@ discard block | ||
| 230 | 230 | echo ' document.forms[2].submit();'; | 
| 231 | 231 | } ?>"> | 
| 232 | 232 | <h1>XMLRPC | 
| 233 | -    <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> | |
| 233 | +    <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> | |
| 234 | 234 | / | 
| 235 | -    <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> | |
| 235 | +    <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> | |
| 236 | 236 | JSONRPC Debugger (based on the <a href="http://gggeek.github.io/phpxmlrpc/">PHP-XMLRPC</a> library) | 
| 237 | 237 | </h1> | 
| 238 | 238 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> | 
| @@ -287,7 +287,7 @@ discard block | ||
| 287 | 287 | </select> | 
| 288 | 288 | </td> | 
| 289 | 289 | <td class="labelcell">Timeout:</td> | 
| 290 | -            <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> | |
| 290 | +            <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> | |
| 291 | 291 | <td class="labelcell">Protocol:</td> | 
| 292 | 292 | <td><select name="protocol" onchange="switchssl(); switchauth(); swicthcainfo();"> | 
| 293 | 293 |                      <option value="0"<?php if ($protocol == 0) { echo ' selected="selected"'; } ?>>HTTP 1.0</option> | 
| @@ -32,7 +32,12 @@ | ||
| 32 | 32 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | 
| 33 | 33 | <head> | 
| 34 | 34 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> | 
| 35 | -    <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSONRPC'; else echo 'XMLRPC'; ?> Debugger</title> | |
| 35 | +    <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { | |
| 36 | + echo 'JSONRPC'; | |
| 37 | +} else { | |
| 38 | + echo 'XMLRPC'; | |
| 39 | +} | |
| 40 | +?> Debugger</title> | |
| 36 | 41 | <meta name="robots" content="index,nofollow"/> | 
| 37 | 42 | <script type="text/javascript" language="Javascript"> | 
| 38 | 43 | if (window.name != 'frmcontroller') | 
| @@ -17,7 +17,12 @@ discard block | ||
| 17 | 17 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | 
| 18 | 18 | <head> | 
| 19 | 19 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> | 
| 20 | -    <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> | |
| 21 | 26 | <meta name="robots" content="index,nofollow"/> | 
| 22 | 27 | <style type="text/css"> | 
| 23 | 28 | <!-- | 
| @@ -366,7 +371,9 @@ discard block | ||
| 366 | 371 |                                  echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; | 
| 367 | 372 |                                  if ($x->count() > 1) { | 
| 368 | 373 |                                      foreach($x as $k => $y) { | 
| 369 | - if ($k == 0) continue; | |
| 374 | +                                        if ($k == 0) { | |
| 375 | + continue; | |
| 376 | + } | |
| 370 | 377 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); | 
| 371 | 378 |                                          if ($wstype != 1) { | 
| 372 | 379 | $type = $y->scalarval(); | 
| @@ -92,13 +92,13 @@ discard block | ||
| 92 | 92 | <body> | 
| 93 | 93 | <?php | 
| 94 | 94 | |
| 95 | -include __DIR__ . '/common.php'; | |
| 95 | +include __DIR__.'/common.php'; | |
| 96 | 96 | |
| 97 | 97 |  if ($action) { | 
| 98 | 98 | |
| 99 | 99 | // make sure the script waits long enough for the call to complete... | 
| 100 | 100 |      if ($timeout) { | 
| 101 | - set_time_limit($timeout + 10); | |
| 101 | + set_time_limit($timeout+10); | |
| 102 | 102 | } | 
| 103 | 103 | |
| 104 | 104 |      if ($wstype == 1) { | 
| @@ -123,13 +123,13 @@ discard block | ||
| 123 | 123 | $server = "$host$path"; | 
| 124 | 124 | } | 
| 125 | 125 |      if ($protocol == 2) { | 
| 126 | - $server = 'https://' . $server; | |
| 126 | + $server = 'https://'.$server; | |
| 127 | 127 |      } else { | 
| 128 | - $server = 'http://' . $server; | |
| 128 | + $server = 'http://'.$server; | |
| 129 | 129 | } | 
| 130 | 130 |      if ($proxy != '') { | 
| 131 | 131 |          $pproxy = explode(':', $proxy); | 
| 132 | -        if (count($pproxy) > 1) { | |
| 132 | +        if (count($pproxy)>1) { | |
| 133 | 133 | $pport = $pproxy[1]; | 
| 134 | 134 |          } else { | 
| 135 | 135 | $pport = 8080; | 
| @@ -198,9 +198,9 @@ discard block | ||
| 198 | 198 | case 'wrap': | 
| 199 | 199 |              $msg[0] = new $requestClass('system.methodHelp', array(), $id); | 
| 200 | 200 | $msg[0]->addparam(new PhpXmlRpc\Value($method)); | 
| 201 | -            $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1); | |
| 201 | +            $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1); | |
| 202 | 202 | $msg[1]->addparam(new PhpXmlRpc\Value($method)); | 
| 203 | - $actionname = 'Description of method "' . $method . '"'; | |
| 203 | + $actionname = 'Description of method "'.$method.'"'; | |
| 204 | 204 | break; | 
| 205 | 205 | case 'list': | 
| 206 | 206 |              $msg[0] = new $requestClass('system.listMethods', array(), $id); | 
| @@ -213,9 +213,9 @@ discard block | ||
| 213 | 213 | $msg[0] = new $requestClass($method, array(), $id); | 
| 214 | 214 | // hack! build xml payload by hand | 
| 215 | 215 |              if ($wstype == 1) { | 
| 216 | -                $msg[0]->payload = "{\n" . | |
| 217 | - '"method": "' . $method . "\",\n\"params\": [" . | |
| 218 | - $payload . | |
| 216 | +                $msg[0]->payload = "{\n". | |
| 217 | + '"method": "'.$method."\",\n\"params\": [". | |
| 218 | + $payload. | |
| 219 | 219 | "\n],\n\"id\": "; | 
| 220 | 220 | // fix: if user gave an empty string, use NULL, or we'll break json syntax | 
| 221 | 221 |                  if ($id == "") { | 
| @@ -228,20 +228,20 @@ discard block | ||
| 228 | 228 | } | 
| 229 | 229 | } | 
| 230 | 230 |              } else { | 
| 231 | - $msg[0]->payload = $msg[0]->xml_header($inputcharset) . | |
| 232 | - '<methodName>' . $method . "</methodName>\n<params>" . | |
| 233 | - $payload . | |
| 234 | - "</params>\n" . $msg[0]->xml_footer(); | |
| 231 | + $msg[0]->payload = $msg[0]->xml_header($inputcharset). | |
| 232 | + '<methodName>'.$method."</methodName>\n<params>". | |
| 233 | + $payload. | |
| 234 | + "</params>\n".$msg[0]->xml_footer(); | |
| 235 | 235 | } | 
| 236 | - $actionname = 'Execution of method ' . $method; | |
| 236 | + $actionname = 'Execution of method '.$method; | |
| 237 | 237 | break; | 
| 238 | 238 | default: // give a warning | 
| 239 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; | |
| 239 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; | |
| 240 | 240 | } | 
| 241 | 241 | |
| 242 | 242 | // Before calling execute, echo out brief description of action taken + date and time ??? | 
| 243 | 243 | // this gives good user feedback for long-running methods... | 
| 244 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; | |
| 244 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; | |
| 245 | 245 | flush(); | 
| 246 | 246 | |
| 247 | 247 | $response = null; | 
| @@ -259,7 +259,7 @@ discard block | ||
| 259 | 259 | break; | 
| 260 | 260 | } | 
| 261 | 261 | } | 
| 262 | - $time = microtime(true) - $time; | |
| 262 | + $time = microtime(true)-$time; | |
| 263 | 263 |      if ($debug) { | 
| 264 | 264 | echo "</div>\n"; | 
| 265 | 265 | } | 
| @@ -269,8 +269,8 @@ discard block | ||
| 269 | 269 | // call failed! echo out error msg! | 
| 270 | 270 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; | 
| 271 | 271 | echo "<h3>$protoName call FAILED!</h3>\n"; | 
| 272 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . | |
| 273 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; | |
| 272 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). | |
| 273 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; | |
| 274 | 274 |              echo(date("d/M/Y:H:i:s\n")); | 
| 275 | 275 |          } else { | 
| 276 | 276 | // call succeeded: parse results | 
| @@ -286,36 +286,36 @@ discard block | ||
| 286 | 286 | $max = $v->count(); | 
| 287 | 287 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; | 
| 288 | 288 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; | 
| 289 | -                        foreach($v as $i => $rec) { | |
| 289 | +                        foreach ($v as $i => $rec) { | |
| 290 | 290 |                              if ($i % 2) { | 
| 291 | 291 | $class = ' class="oddrow"'; | 
| 292 | 292 |                              } else { | 
| 293 | 293 | $class = ' class="evenrow"'; | 
| 294 | 294 | } | 
| 295 | -                            echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . | |
| 296 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 297 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 298 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 299 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 300 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . | |
| 301 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 302 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 303 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . | |
| 304 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . | |
| 305 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . | |
| 306 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 307 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 308 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 309 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 310 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . | |
| 311 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . | |
| 312 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 313 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . | |
| 314 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 315 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . | |
| 316 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . | |
| 317 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . | |
| 318 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . | |
| 295 | +                            echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". | |
| 296 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". | |
| 297 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". | |
| 298 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". | |
| 299 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". | |
| 300 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". | |
| 301 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". | |
| 302 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". | |
| 303 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". | |
| 304 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". | |
| 305 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". | |
| 306 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". | |
| 307 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". | |
| 308 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". | |
| 309 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". | |
| 310 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". | |
| 311 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". | |
| 312 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". | |
| 313 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". | |
| 314 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". | |
| 315 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". | |
| 316 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". | |
| 317 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". | |
| 318 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". | |
| 319 | 319 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); | 
| 320 | 320 |                              //echo("</tr>\n"); | 
| 321 | 321 | |
| @@ -342,7 +342,7 @@ discard block | ||
| 342 | 342 | $r2 = $resp[1]->value(); | 
| 343 | 343 | |
| 344 | 344 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; | 
| 345 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; | |
| 345 | + 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 | 346 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); | 
| 347 | 347 |                      if ($desc == "") { | 
| 348 | 348 | $desc = "-"; | 
| @@ -352,41 +352,41 @@ discard block | ||
| 352 | 352 |                      if ($r2->kindOf() != "array") { | 
| 353 | 353 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; | 
| 354 | 354 |                      } else { | 
| 355 | -                        foreach($r2 as $i => $x) { | |
| 355 | +                        foreach ($r2 as $i => $x) { | |
| 356 | 356 | $payload = ""; | 
| 357 | 357 | $alt_payload = ""; | 
| 358 | -                            if ($i + 1 % 2) { | |
| 358 | +                            if ($i+1 % 2) { | |
| 359 | 359 | $class = ' class="oddrow"'; | 
| 360 | 360 |                              } else { | 
| 361 | 361 | $class = ' class="evenrow"'; | 
| 362 | 362 | } | 
| 363 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; | |
| 363 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; | |
| 364 | 364 |                              if ($x->kindOf() == "array") { | 
| 365 | 365 | $ret = $x[0]; | 
| 366 | -                                echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; | |
| 367 | -                                if ($x->count() > 1) { | |
| 368 | -                                    foreach($x as $k => $y) { | |
| 366 | +                                echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; | |
| 367 | +                                if ($x->count()>1) { | |
| 368 | +                                    foreach ($x as $k => $y) { | |
| 369 | 369 | if ($k == 0) continue; | 
| 370 | 370 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); | 
| 371 | 371 |                                          if ($wstype != 1) { | 
| 372 | 372 | $type = $y->scalarval(); | 
| 373 | 373 | $payload .= '<param><value>'; | 
| 374 | -                                            switch($type) { | |
| 374 | +                                            switch ($type) { | |
| 375 | 375 | case 'undefined': | 
| 376 | 376 | break; | 
| 377 | 377 | case 'null'; | 
| 378 | 378 | $type = 'nil'; | 
| 379 | 379 | // fall thru intentionally | 
| 380 | 380 | default: | 
| 381 | - $payload .= '<' . | |
| 382 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . | |
| 383 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . | |
| 381 | + $payload .= '<'. | |
| 382 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). | |
| 383 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). | |
| 384 | 384 | '>'; | 
| 385 | 385 | } | 
| 386 | 386 | $payload .= "</value></param>\n"; | 
| 387 | 387 | } | 
| 388 | 388 | $alt_payload .= $y->scalarval(); | 
| 389 | -                                        if ($k < $x->count() - 1) { | |
| 389 | +                                        if ($k<$x->count()-1) { | |
| 390 | 390 | $alt_payload .= ';'; | 
| 391 | 391 | echo ", "; | 
| 392 | 392 | } | 
| @@ -399,63 +399,63 @@ discard block | ||
| 399 | 399 | echo '</td>'; | 
| 400 | 400 | // button to test this method | 
| 401 | 401 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; | 
| 402 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . | |
| 403 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 404 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 405 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 406 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 407 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . | |
| 408 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 409 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 410 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . | |
| 411 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . | |
| 412 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . | |
| 413 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 414 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 415 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 416 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 417 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . | |
| 418 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . | |
| 419 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 420 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . | |
| 421 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 422 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 423 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 424 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 425 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . | |
| 402 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". | |
| 403 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". | |
| 404 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". | |
| 405 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". | |
| 406 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". | |
| 407 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". | |
| 408 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". | |
| 409 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". | |
| 410 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". | |
| 411 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". | |
| 412 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". | |
| 413 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". | |
| 414 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". | |
| 415 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". | |
| 416 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". | |
| 417 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". | |
| 418 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". | |
| 419 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". | |
| 420 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". | |
| 421 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". | |
| 422 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". | |
| 423 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". | |
| 424 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". | |
| 425 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". | |
| 426 | 426 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; | 
| 427 | 427 |                              if ($wstype != 1) { | 
| 428 | 428 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; | 
| 429 | 429 | } | 
| 430 | 430 | echo "</form></td>\n"; | 
| 431 | 431 | |
| 432 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . | |
| 433 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 434 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 435 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 436 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 437 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . | |
| 438 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 439 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 440 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . | |
| 441 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . | |
| 442 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . | |
| 443 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 444 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 445 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 446 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 447 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . | |
| 448 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . | |
| 449 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 450 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . | |
| 451 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 452 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 453 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . | |
| 454 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 455 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . | |
| 456 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . | |
| 457 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . | |
| 458 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . | |
| 432 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". | |
| 433 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". | |
| 434 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". | |
| 435 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". | |
| 436 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". | |
| 437 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". | |
| 438 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". | |
| 439 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". | |
| 440 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". | |
| 441 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". | |
| 442 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". | |
| 443 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". | |
| 444 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". | |
| 445 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". | |
| 446 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". | |
| 447 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". | |
| 448 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". | |
| 449 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". | |
| 450 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". | |
| 451 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". | |
| 452 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". | |
| 453 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". | |
| 454 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". | |
| 455 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". | |
| 456 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". | |
| 457 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". | |
| 458 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". | |
| 459 | 459 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; | 
| 460 | 460 | echo "</form></td></tr>\n"; | 
| 461 | 461 | } | 
| @@ -467,14 +467,14 @@ discard block | ||
| 467 | 467 | case 'wrap': | 
| 468 | 468 | $r1 = $resp[0]->value(); | 
| 469 | 469 | $r2 = $resp[1]->value(); | 
| 470 | -                    if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { | |
| 470 | +                    if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { | |
| 471 | 471 | echo "Error: signature unknown\n"; | 
| 472 | 472 |                      } else { | 
| 473 | 473 | $mdesc = $r1->scalarval(); | 
| 474 | 474 | $encoder = new PhpXmlRpc\Encoder(); | 
| 475 | 475 | $msig = $encoder->decode($r2); | 
| 476 | 476 | $msig = $msig[$methodsig]; | 
| 477 | - $proto = $protocol == 2 ? 'https' : ( $protocol == 1 ? 'http11' : '' ); | |
| 477 | + $proto = $protocol == 2 ? 'https' : ($protocol == 1 ? 'http11' : ''); | |
| 478 | 478 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && | 
| 479 | 479 | $clientcookies == '' | 
| 480 | 480 |                          ) { | 
| @@ -488,11 +488,11 @@ discard block | ||
| 488 | 488 | $prefix = 'xmlrpc'; | 
| 489 | 489 | } | 
| 490 | 490 | $wrapper = new PhpXmlRpc\Wrapper(); | 
| 491 | -                        $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc); | |
| 491 | +                        $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc); | |
| 492 | 492 | //if ($code) | 
| 493 | 493 |                          //{ | 
| 494 | 494 | echo "<div id=\"phpcode\">\n"; | 
| 495 | -                        highlight_string("<?php\n" . $code['docstring'] . $code['source'] . '?>'); | |
| 495 | +                        highlight_string("<?php\n".$code['docstring'].$code['source'].'?>'); | |
| 496 | 496 | echo "\n</div>"; | 
| 497 | 497 | //} | 
| 498 | 498 | //else | 
| @@ -503,7 +503,7 @@ discard block | ||
| 503 | 503 | break; | 
| 504 | 504 | |
| 505 | 505 | case 'execute': | 
| 506 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; | |
| 506 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; | |
| 507 | 507 | break; | 
| 508 | 508 | |
| 509 | 509 | default: // give a warning | 
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/WebTestCase.php'; | |
| 3 | +include_once __DIR__.'/WebTestCase.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', '/tests/index.php', $this->args['HTTPURI'] ); | |
| 14 | +        $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/tests/index.php', $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() | 
| @@ -1,11 +1,11 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; | |
| 4 | -include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc'; | |
| 3 | +include_once __DIR__.'/../lib/xmlrpc.inc'; | |
| 4 | +include_once __DIR__.'/../lib/xmlrpc_wrappers.inc'; | |
| 5 | 5 | |
| 6 | -include_once __DIR__ . '/parse_args.php'; | |
| 6 | +include_once __DIR__.'/parse_args.php'; | |
| 7 | 7 | |
| 8 | -include_once __DIR__ . '/PolyfillTestCase.php'; | |
| 8 | +include_once __DIR__.'/PolyfillTestCase.php'; | |
| 9 | 9 | |
| 10 | 10 | use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage; | 
| 11 | 11 | use PHPUnit\Framework\TestResult; | 
| @@ -42,7 +42,7 @@ discard block | ||
| 42 | 42 | // (but only if not called from subclass objects / multitests) | 
| 43 | 43 |          if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') { | 
| 44 | 44 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); | 
| 45 | -            for ($i = 0; $i < count($trace); $i++) { | |
| 45 | +            for ($i = 0; $i<count($trace); $i++) { | |
| 46 | 46 |                  if (strpos($trace[$i]['function'], 'test') === 0) { | 
| 47 | 47 | self::$failed_tests[$trace[$i]['function']] = true; | 
| 48 | 48 | break; | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | */ | 
| 66 | 66 | public function _run($result = NULL) | 
| 67 | 67 |      { | 
| 68 | - $this->testId = get_class($this) . '__' . $this->getName(); | |
| 68 | + $this->testId = get_class($this).'__'.$this->getName(); | |
| 69 | 69 | |
| 70 | 70 |          if ($result === NULL) { | 
| 71 | 71 | $result = $this->createResult(); | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 | |
| 98 | 98 |          $uri = str_replace('/demo/server/server.php', '/tests/index.php?demo=server/server.php', $this->args['HTTPURI']); | 
| 99 | 99 |          $server = explode(':', $this->args['HTTPSERVER']); | 
| 100 | -        if (count($server) > 1) { | |
| 100 | +        if (count($server)>1) { | |
| 101 | 101 | $this->client = new xmlrpc_client($uri, $server[0], $server[1]); | 
| 102 | 102 |          } else { | 
| 103 | 103 | $this->client = new xmlrpc_client($uri, $this->args['HTTPSERVER']); | 
| @@ -107,7 +107,7 @@ discard block | ||
| 107 | 107 | $this->client->request_compression = $this->request_compression; | 
| 108 | 108 | $this->client->accepted_compression = $this->accepted_compression; | 
| 109 | 109 | |
| 110 | -        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); | |
| 110 | +        $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); | |
| 111 | 111 | |
| 112 | 112 | if ($this->args['DEBUG'] == 1) | 
| 113 | 113 | ob_start(); | 
| @@ -144,9 +144,9 @@ discard block | ||
| 144 | 144 | } | 
| 145 | 145 | $this->validateResponse($r); | 
| 146 | 146 |          if (is_array($errorCode)) { | 
| 147 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); | |
| 147 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); | |
| 148 | 148 |          } else { | 
| 149 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); | |
| 149 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); | |
| 150 | 150 | } | 
| 151 | 151 |          if (!$r->faultCode()) { | 
| 152 | 152 |              if ($returnResponse) { | 
| @@ -173,20 +173,20 @@ discard block | ||
| 173 | 173 | $query = parse_url($this->client->path, PHP_URL_QUERY); | 
| 174 | 174 | parse_str($query, $vars); | 
| 175 | 175 | $query = http_build_query(array_merge($vars, $data)); | 
| 176 | - $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query; | |
| 176 | + $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query; | |
| 177 | 177 | } | 
| 178 | 178 | |
| 179 | 179 | public function testString() | 
| 180 | 180 |      { | 
| 181 | - $sendString = "here are 3 \"entities\": < > & " . | |
| 182 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . | |
| 183 | - " - isn't that great? \\\"hackery\\\" at it's best " . | |
| 184 | - " also don't want to miss out on \$item[0]. " . | |
| 185 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . | |
| 186 | - "a simple CR here" . chr(13) . | |
| 187 | - "a simple LF here" . chr(10) . | |
| 188 | - "and then LFCR" . chr(10) . chr(13) . | |
| 189 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; | |
| 181 | + $sendString = "here are 3 \"entities\": < > & ". | |
| 182 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). | |
| 183 | + " - isn't that great? \\\"hackery\\\" at it's best ". | |
| 184 | + " also don't want to miss out on \$item[0]. ". | |
| 185 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). | |
| 186 | + "a simple CR here".chr(13). | |
| 187 | + "a simple LF here".chr(10). | |
| 188 | + "and then LFCR".chr(10).chr(13). | |
| 189 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; | |
| 190 | 190 |          $m = new xmlrpcmsg('examples.stringecho', array( | 
| 191 | 191 | new xmlrpcval($sendString, 'string'), | 
| 192 | 192 | )); | 
| @@ -207,7 +207,7 @@ discard block | ||
| 207 | 207 | public function testLatin1String() | 
| 208 | 208 |      { | 
| 209 | 209 | $sendString = | 
| 210 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; | |
| 210 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; | |
| 211 | 211 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. | 
| 212 | 212 | $sendString. | 
| 213 | 213 | '</value></param></params></methodCall>'; | 
| @@ -315,7 +315,7 @@ discard block | ||
| 315 | 315 | public function testUtf8Method() | 
| 316 | 316 |      { | 
| 317 | 317 | PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8'; | 
| 318 | -        $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array( | |
| 318 | +        $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array( | |
| 319 | 319 |              new xmlrpcval('hello') | 
| 320 | 320 | )); | 
| 321 | 321 | $v = $this->send($m); | 
| @@ -337,7 +337,7 @@ discard block | ||
| 337 | 337 | )); | 
| 338 | 338 | $v = $this->send($m); | 
| 339 | 339 |          if ($v) { | 
| 340 | - $this->assertEquals($a + $b, $v->scalarval()); | |
| 340 | + $this->assertEquals($a+$b, $v->scalarval()); | |
| 341 | 341 | } | 
| 342 | 342 | } | 
| 343 | 343 | |
| @@ -349,7 +349,7 @@ discard block | ||
| 349 | 349 | )); | 
| 350 | 350 | $v = $this->send($m); | 
| 351 | 351 |          if ($v) { | 
| 352 | - $this->assertEquals(12 - 23, $v->scalarval()); | |
| 352 | + $this->assertEquals(12-23, $v->scalarval()); | |
| 353 | 353 | } | 
| 354 | 354 | } | 
| 355 | 355 | |
| @@ -383,7 +383,7 @@ discard block | ||
| 383 | 383 |          if ($v) { | 
| 384 | 384 | $sz = $v->arraysize(); | 
| 385 | 385 | $got = ''; | 
| 386 | -            for ($i = 0; $i < $sz; $i++) { | |
| 386 | +            for ($i = 0; $i<$sz; $i++) { | |
| 387 | 387 | $b = $v->arraymem($i); | 
| 388 | 388 |                  if ($b->scalarval()) { | 
| 389 | 389 | $got .= '1'; | 
| @@ -446,7 +446,7 @@ discard block | ||
| 446 | 446 | $got = ''; | 
| 447 | 447 | $expected = '37210'; | 
| 448 | 448 |              $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); | 
| 449 | -            foreach($expect_array as $val) { | |
| 449 | +            foreach ($expect_array as $val) { | |
| 450 | 450 | $b = $v->structmem($val); | 
| 451 | 451 | $got .= $b->me['int']; | 
| 452 | 452 | } | 
| @@ -899,7 +899,7 @@ discard block | ||
| 899 | 899 |      { | 
| 900 | 900 | // make a 'deep client copy' as the original one might have many properties set | 
| 901 | 901 | // also for speed only wrap one method of the whole server | 
| 902 | -        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' )); | |
| 902 | +        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/')); | |
| 903 | 903 |          if ($class == '') { | 
| 904 | 904 |              $this->fail('Registration of remote server failed'); | 
| 905 | 905 |          } else { | 
| @@ -938,9 +938,9 @@ discard block | ||
| 938 | 938 | $cookies = array( | 
| 939 | 939 | //'c1' => array(), | 
| 940 | 940 |              'c2' => array('value' => 'c2'), | 
| 941 | -            'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), | |
| 942 | -            'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), | |
| 943 | -            'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), | |
| 941 | +            'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30), | |
| 942 | +            'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'), | |
| 943 | +            'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), | |
| 944 | 944 | ); | 
| 945 | 945 | $cookiesval = php_xmlrpc_encode($cookies); | 
| 946 | 946 |          $m = new xmlrpcmsg('examples.setcookies', array($cookiesval)); | 
| @@ -988,10 +988,10 @@ discard block | ||
| 988 | 988 |          $m = new xmlrpcmsg('examples.getcookies', array()); | 
| 989 | 989 |          foreach ($cookies as $cookie => $val) { | 
| 990 | 990 | $this->client->setCookie($cookie, $val); | 
| 991 | - $cookies[$cookie] = (string)$cookies[$cookie]; | |
| 991 | + $cookies[$cookie] = (string) $cookies[$cookie]; | |
| 992 | 992 | } | 
| 993 | 993 | $r = $this->client->send($m, $this->timeout, $this->method); | 
| 994 | - $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); | |
| 994 | + $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); | |
| 995 | 995 |          if (!$r->faultCode()) { | 
| 996 | 996 | $v = $r->value(); | 
| 997 | 997 | $v = php_xmlrpc_decode($v); | 
| @@ -109,14 +109,16 @@ | ||
| 109 | 109 | |
| 110 | 110 |          $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI']); | 
| 111 | 111 | |
| 112 | - if ($this->args['DEBUG'] == 1) | |
| 113 | - ob_start(); | |
| 112 | +        if ($this->args['DEBUG'] == 1) { | |
| 113 | + ob_start(); | |
| 114 | + } | |
| 114 | 115 | } | 
| 115 | 116 | |
| 116 | 117 | protected function tear_down() | 
| 117 | 118 |      { | 
| 118 | - if ($this->args['DEBUG'] != 1) | |
| 119 | - return; | |
| 119 | +        if ($this->args['DEBUG'] != 1) { | |
| 120 | + return; | |
| 121 | + } | |
| 120 | 122 | $out = ob_get_clean(); | 
| 121 | 123 | $status = $this->getStatus(); | 
| 122 | 124 | if ($status == BaseTestRunner::STATUS_ERROR | 
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/WebTestCase.php'; | |
| 3 | +include_once __DIR__.'/WebTestCase.php'; | |
| 4 | 4 | |
| 5 | 5 | /** | 
| 6 | 6 | * Tests for php files in the 'extras' directory | 
| @@ -12,9 +12,9 @@ discard block | ||
| 12 | 12 |      { | 
| 13 | 13 | $this->args = argParser::getArgs(); | 
| 14 | 14 | |
| 15 | - $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/index.php', $this->args['HTTPURI'] ); | |
| 15 | +        $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/tests/index.php', $this->args['HTTPURI']); | |
| 16 | 16 | |
| 17 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/phpunit_coverage.php', $this->args['HTTPURI'] ); | |
| 17 | +        $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); | |
| 18 | 18 | } | 
| 19 | 19 | |
| 20 | 20 | public function testBenchmark() | 
| @@ -15,7 +15,7 @@ discard block | ||
| 15 | 15 | chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777); | 
| 16 | 16 | } | 
| 17 | 17 | |
| 18 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; | |
| 18 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; | |
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 | $targetFile = null; | 
| @@ -38,5 +38,5 @@ discard block | ||
| 38 | 38 | } | 
| 39 | 39 | |
| 40 | 40 |  if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) { | 
| 41 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; | |
| 41 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; | |
| 42 | 42 | } | 
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/WebTestCase.php'; | |
| 3 | +include_once __DIR__.'/WebTestCase.php'; | |
| 4 | 4 | |
| 5 | 5 | class DebuggerTest extends PhpXmlRpc_WebTestCase | 
| 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', '/tests/index.php', $this->args['HTTPURI'] ); | |
| 11 | +        $this->baseUrl = $this->args['HTTPSERVER'].str_replace('/demo/server/server.php', '/tests/index.php', $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() | 
| @@ -24,12 +24,12 @@ discard block | ||
| 24 | 24 | |
| 25 | 25 | // read chunk-size, chunk-extension (if any) and crlf | 
| 26 | 26 | // get the position of the linebreak | 
| 27 | - $chunkEnd = strpos($buffer, "\r\n") + 2; | |
| 27 | + $chunkEnd = strpos($buffer, "\r\n")+2; | |
| 28 | 28 | $temp = substr($buffer, 0, $chunkEnd); | 
| 29 | 29 | $chunkSize = hexdec(trim($temp)); | 
| 30 | 30 | $chunkStart = $chunkEnd; | 
| 31 | -        while ($chunkSize > 0) { | |
| 32 | - $chunkEnd = strpos($buffer, "\r\n", $chunkStart + $chunkSize); | |
| 31 | +        while ($chunkSize>0) { | |
| 32 | + $chunkEnd = strpos($buffer, "\r\n", $chunkStart+$chunkSize); | |
| 33 | 33 | |
| 34 | 34 | // just in case we got a broken connection | 
| 35 | 35 |              if ($chunkEnd == false) { | 
| @@ -41,19 +41,19 @@ discard block | ||
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | 43 | // read chunk-data and crlf | 
| 44 | - $chunk = substr($buffer, $chunkStart, $chunkEnd - $chunkStart); | |
| 44 | + $chunk = substr($buffer, $chunkStart, $chunkEnd-$chunkStart); | |
| 45 | 45 | // append chunk-data to entity-body | 
| 46 | 46 | $new .= $chunk; | 
| 47 | 47 | // length := length + chunk-size | 
| 48 | 48 | $length += strlen($chunk); | 
| 49 | 49 | // read chunk-size and crlf | 
| 50 | - $chunkStart = $chunkEnd + 2; | |
| 50 | + $chunkStart = $chunkEnd+2; | |
| 51 | 51 | |
| 52 | - $chunkEnd = strpos($buffer, "\r\n", $chunkStart) + 2; | |
| 52 | + $chunkEnd = strpos($buffer, "\r\n", $chunkStart)+2; | |
| 53 | 53 |              if ($chunkEnd == false) { | 
| 54 | 54 | break; //just in case we got a broken connection | 
| 55 | 55 | } | 
| 56 | - $temp = substr($buffer, $chunkStart, $chunkEnd - $chunkStart); | |
| 56 | + $temp = substr($buffer, $chunkStart, $chunkEnd-$chunkStart); | |
| 57 | 57 | $chunkSize = hexdec(trim($temp)); | 
| 58 | 58 | $chunkStart = $chunkEnd; | 
| 59 | 59 | } | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | * @todo if $debug is 0, we could avoid populating 'raw_data' and 'headers' in the returned value - even better, have | 
| 75 | 75 | * 2 debug levels | 
| 76 | 76 | */ | 
| 77 | - public function parseResponseHeaders(&$data, $headersProcessed = false, $debug=0) | |
| 77 | + public function parseResponseHeaders(&$data, $headersProcessed = false, $debug = 0) | |
| 78 | 78 |      { | 
| 79 | 79 |          $httpResponse = array('raw_data' => $data, 'headers'=> array(), 'cookies' => array(), 'status_code' => null); | 
| 80 | 80 | |
| @@ -84,11 +84,11 @@ discard block | ||
| 84 | 84 | // (even though it is not valid http) | 
| 85 | 85 | $pos = strpos($data, "\r\n\r\n"); | 
| 86 | 86 |              if ($pos || is_int($pos)) { | 
| 87 | - $bd = $pos + 4; | |
| 87 | + $bd = $pos+4; | |
| 88 | 88 |              } else { | 
| 89 | 89 | $pos = strpos($data, "\n\n"); | 
| 90 | 90 |                  if ($pos || is_int($pos)) { | 
| 91 | - $bd = $pos + 2; | |
| 91 | + $bd = $pos+2; | |
| 92 | 92 |                  } else { | 
| 93 | 93 | // No separation between response headers and body: fault? | 
| 94 | 94 | $bd = 0; | 
| @@ -99,8 +99,8 @@ discard block | ||
| 99 | 99 | // maybe we could take them into account, too? | 
| 100 | 100 | $data = substr($data, $bd); | 
| 101 | 101 |              } else { | 
| 102 | -                Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': HTTPS via proxy error, tunnel connection possibly failed'); | |
| 103 | - throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (HTTPS via proxy error, tunnel connection possibly failed)', PhpXmlRpc::$xmlrpcerr['http_error']); | |
| 102 | +                Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': HTTPS via proxy error, tunnel connection possibly failed'); | |
| 103 | + throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'].' (HTTPS via proxy error, tunnel connection possibly failed)', PhpXmlRpc::$xmlrpcerr['http_error']); | |
| 104 | 104 | } | 
| 105 | 105 | } | 
| 106 | 106 | |
| @@ -131,20 +131,20 @@ discard block | ||
| 131 | 131 | } | 
| 132 | 132 | |
| 133 | 133 |          if ($httpResponse['status_code'] !== '200') { | 
| 134 | - $errstr = substr($data, 0, strpos($data, "\n") - 1); | |
| 135 | -            Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': HTTP error, got response: ' . $errstr); | |
| 136 | -            throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code'] ); | |
| 134 | + $errstr = substr($data, 0, strpos($data, "\n")-1); | |
| 135 | +            Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': HTTP error, got response: '.$errstr); | |
| 136 | +            throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'].' ('.$errstr.')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']); | |
| 137 | 137 | } | 
| 138 | 138 | |
| 139 | 139 | // be tolerant to usage of \n instead of \r\n to separate headers and data | 
| 140 | 140 | // (even though it is not valid http) | 
| 141 | 141 | $pos = strpos($data, "\r\n\r\n"); | 
| 142 | 142 |          if ($pos || is_int($pos)) { | 
| 143 | - $bd = $pos + 4; | |
| 143 | + $bd = $pos+4; | |
| 144 | 144 |          } else { | 
| 145 | 145 | $pos = strpos($data, "\n\n"); | 
| 146 | 146 |              if ($pos || is_int($pos)) { | 
| 147 | - $bd = $pos + 2; | |
| 147 | + $bd = $pos+2; | |
| 148 | 148 |              } else { | 
| 149 | 149 | // No separation between response headers and body: fault? | 
| 150 | 150 | // we could take some action here instead of going on... | 
| @@ -155,10 +155,10 @@ discard block | ||
| 155 | 155 | // be tolerant to line endings, and extra empty lines | 
| 156 | 156 |          $ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos))); | 
| 157 | 157 | |
| 158 | -        foreach($ar as $line) { | |
| 158 | +        foreach ($ar as $line) { | |
| 159 | 159 | // take care of multi-line headers and cookies | 
| 160 | 160 |              $arr = explode(':', $line, 2); | 
| 161 | -            if (count($arr) > 1) { | |
| 161 | +            if (count($arr)>1) { | |
| 162 | 162 | $headerName = strtolower(trim($arr[0])); | 
| 163 | 163 | /// @todo some other headers (the ones that allow a CSV list of values) | 
| 164 | 164 | /// do allow many values to be passed using multiple header lines. | 
| @@ -177,7 +177,7 @@ discard block | ||
| 177 | 177 | // glue together all received cookies, using a comma to separate them | 
| 178 | 178 | // (same as php does with getallheaders()) | 
| 179 | 179 |                          if (isset($httpResponse['headers'][$headerName])) { | 
| 180 | - $httpResponse['headers'][$headerName] .= ', ' . trim($cookie); | |
| 180 | + $httpResponse['headers'][$headerName] .= ', '.trim($cookie); | |
| 181 | 181 |                          } else { | 
| 182 | 182 | $httpResponse['headers'][$headerName] = trim($cookie); | 
| 183 | 183 | } | 
| @@ -206,7 +206,7 @@ discard block | ||
| 206 | 206 | } | 
| 207 | 207 |              } elseif (isset($headerName)) { | 
| 208 | 208 | /// @todo version1 cookies might span multiple lines, thus breaking the parsing above | 
| 209 | - $httpResponse['headers'][$headerName] .= ' ' . trim($line); | |
| 209 | + $httpResponse['headers'][$headerName] .= ' '.trim($line); | |
| 210 | 210 | } | 
| 211 | 211 | } | 
| 212 | 212 | |
| @@ -230,7 +230,7 @@ discard block | ||
| 230 | 230 | // Decode chunked encoding sent by http 1.1 servers | 
| 231 | 231 |              if (isset($httpResponse['headers']['transfer-encoding']) && $httpResponse['headers']['transfer-encoding'] == 'chunked') { | 
| 232 | 232 |                  if (!$data = static::decodeChunked($data)) { | 
| 233 | -                    Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to rebuild the chunked data received from server'); | |
| 233 | +                    Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': errors occurred when trying to rebuild the chunked data received from server'); | |
| 234 | 234 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['dechunk_fail'], PhpXmlRpc::$xmlrpcerr['dechunk_fail'], null, $httpResponse['status_code']); | 
| 235 | 235 | } | 
| 236 | 236 | } | 
| @@ -245,19 +245,19 @@ discard block | ||
| 245 | 245 |                          if ($httpResponse['headers']['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) { | 
| 246 | 246 | $data = $degzdata; | 
| 247 | 247 |                              if ($debug) { | 
| 248 | -                                Logger::instance()->debugMessage("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---"); | |
| 248 | +                                Logger::instance()->debugMessage("---INFLATED RESPONSE---[".strlen($data)." chars]---\n$data\n---END---"); | |
| 249 | 249 | } | 
| 250 | 250 |                          } elseif ($httpResponse['headers']['content-encoding'] == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) { | 
| 251 | 251 | $data = $degzdata; | 
| 252 | 252 |                              if ($debug) { | 
| 253 | -                                Logger::instance()->debugMessage("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---"); | |
| 253 | +                                Logger::instance()->debugMessage("---INFLATED RESPONSE---[".strlen($data)." chars]---\n$data\n---END---"); | |
| 254 | 254 | } | 
| 255 | 255 |                          } else { | 
| 256 | -                            Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to decode the deflated data received from server'); | |
| 256 | +                            Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': errors occurred when trying to decode the deflated data received from server'); | |
| 257 | 257 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['decompress_fail'], PhpXmlRpc::$xmlrpcerr['decompress_fail'], null, $httpResponse['status_code']); | 
| 258 | 258 | } | 
| 259 | 259 |                      } else { | 
| 260 | -                        Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); | |
| 260 | +                        Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); | |
| 261 | 261 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['cannot_decompress'], PhpXmlRpc::$xmlrpcerr['cannot_decompress'], null, $httpResponse['status_code']); | 
| 262 | 262 | } | 
| 263 | 263 | } |