@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * @license code licensed under the BSD License: see file license.txt |
| 7 | 7 | **/ |
| 8 | 8 | |
| 9 | -$coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
| 9 | +$coverageFile = realpath(__DIR__."/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
| 10 | 10 | |
| 11 | 11 | // has to be the same value as used in index.php |
| 12 | 12 | $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage'; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // check for command line params (passed as env vars) vs. web page input params (passed as GET/POST) |
| 47 | 47 | // Note that the only usecase for web-page mode is when this is used by benchmark.php |
| 48 | 48 | if (!isset($_SERVER['REQUEST_METHOD'])) { |
| 49 | - foreach($_SERVER as $key => $val) { |
|
| 49 | + foreach ($_SERVER as $key => $val) { |
|
| 50 | 50 | if (array_key_exists($key, $args)) { |
| 51 | 51 | $$key = $val; |
| 52 | 52 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | //} |
| 92 | 92 | } |
| 93 | 93 | if ($HTTPURI[0] != '/') { |
| 94 | - $HTTPURI = '/' . $HTTPURI; |
|
| 94 | + $HTTPURI = '/'.$HTTPURI; |
|
| 95 | 95 | } |
| 96 | 96 | $args['HTTPURI'] = $HTTPURI; |
| 97 | 97 | |
@@ -105,21 +105,21 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if (isset($HTTPSIGNOREPEER)) { |
| 108 | - $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER; |
|
| 108 | + $args['HTTPSIGNOREPEER'] = (bool) $HTTPSIGNOREPEER; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | if (isset($HTTPSVERIFYHOST)) { |
| 112 | - $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST; |
|
| 112 | + $args['HTTPSVERIFYHOST'] = (int) $HTTPSVERIFYHOST; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if (isset($SSLVERSION)) { |
| 116 | - $args['SSLVERSION'] = (int)$SSLVERSION; |
|
| 116 | + $args['SSLVERSION'] = (int) $SSLVERSION; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if (isset($PROXYSERVER)) { |
| 120 | 120 | $arr = explode(':', $PROXYSERVER); |
| 121 | 121 | $args['PROXYSERVER'] = $arr[0]; |
| 122 | - if (count($arr) > 1) { |
|
| 122 | + if (count($arr)>1) { |
|
| 123 | 123 | $args['PROXYPORT'] = $arr[1]; |
| 124 | 124 | } else { |
| 125 | 125 | $args['PROXYPORT'] = 8080; |
@@ -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(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->args = argParser::getArgs(); |
| 97 | 97 | |
| 98 | 98 | $server = explode(':', $this->args['HTTPSERVER']); |
| 99 | - if (count($server) > 1) { |
|
| 99 | + if (count($server)>1) { |
|
| 100 | 100 | $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]); |
| 101 | 101 | } else { |
| 102 | 102 | $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->client->request_compression = $this->request_compression; |
| 107 | 107 | $this->client->accepted_compression = $this->accepted_compression; |
| 108 | 108 | |
| 109 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
| 109 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
| 110 | 110 | |
| 111 | 111 | if ($this->args['DEBUG'] == 1) |
| 112 | 112 | ob_start(); |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | $this->validateResponse($r); |
| 145 | 145 | if (is_array($errorCode)) { |
| 146 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 146 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 147 | 147 | } else { |
| 148 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
| 148 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
| 149 | 149 | } |
| 150 | 150 | if (!$r->faultCode()) { |
| 151 | 151 | if ($returnResponse) { |
@@ -172,20 +172,20 @@ discard block |
||
| 172 | 172 | $query = parse_url($this->client->path, PHP_URL_QUERY); |
| 173 | 173 | parse_str($query, $vars); |
| 174 | 174 | $query = http_build_query(array_merge($vars, $data)); |
| 175 | - $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query; |
|
| 175 | + $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query; |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | public function testString() |
| 179 | 179 | { |
| 180 | - $sendString = "here are 3 \"entities\": < > & " . |
|
| 181 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . |
|
| 182 | - " - isn't that great? \\\"hackery\\\" at it's best " . |
|
| 183 | - " also don't want to miss out on \$item[0]. " . |
|
| 184 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . |
|
| 185 | - "a simple CR here" . chr(13) . |
|
| 186 | - "a simple LF here" . chr(10) . |
|
| 187 | - "and then LFCR" . chr(10) . chr(13) . |
|
| 188 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; |
|
| 180 | + $sendString = "here are 3 \"entities\": < > & ". |
|
| 181 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). |
|
| 182 | + " - isn't that great? \\\"hackery\\\" at it's best ". |
|
| 183 | + " also don't want to miss out on \$item[0]. ". |
|
| 184 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). |
|
| 185 | + "a simple CR here".chr(13). |
|
| 186 | + "a simple LF here".chr(10). |
|
| 187 | + "and then LFCR".chr(10).chr(13). |
|
| 188 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; |
|
| 189 | 189 | $m = new xmlrpcmsg('examples.stringecho', array( |
| 190 | 190 | new xmlrpcval($sendString, 'string'), |
| 191 | 191 | )); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | public function testLatin1String() |
| 207 | 207 | { |
| 208 | 208 | $sendString = |
| 209 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 209 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; |
|
| 210 | 210 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. |
| 211 | 211 | $sendString. |
| 212 | 212 | '</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('tests.setcookies', array($cookiesval)); |
@@ -988,10 +988,10 @@ discard block |
||
| 988 | 988 | $m = new xmlrpcmsg('tests.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); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__ . "/_prepend.php"; |
|
| 2 | +require_once __DIR__."/_prepend.php"; |
|
| 3 | 3 | |
| 4 | 4 | output('<html lang="en"> |
| 5 | 5 | <head><title>phpxmlrpc - Which toolkit demo</title></head> |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | <methodName>interopEchoTests.whichToolkit</methodName> |
| 20 | 20 | <params/> |
| 21 | 21 | </methodCall>'; |
| 22 | -output("XML custom request:<br/><pre>" . htmlspecialchars($payload) . "</pre>\n"); |
|
| 22 | +output("XML custom request:<br/><pre>".htmlspecialchars($payload)."</pre>\n"); |
|
| 23 | 23 | |
| 24 | 24 | $client = new Client(XMLRPCSERVER); |
| 25 | 25 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | if (!$resp->faultCode()) { |
| 41 | 41 | |
| 42 | 42 | $xml = $resp->value(); |
| 43 | - output("XML response:<br/><pre>" . htmlspecialchars($xml) . "</pre>\n"); |
|
| 43 | + output("XML response:<br/><pre>".htmlspecialchars($xml)."</pre>\n"); |
|
| 44 | 44 | |
| 45 | 45 | $encoder = new Encoder(); |
| 46 | 46 | // from xml to xml-rpc Response |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | output("Toolkit info:<br/>\n"); |
| 54 | 54 | output("<pre>"); |
| 55 | - output("name: " . htmlspecialchars($value["toolkitName"]) . "\n"); |
|
| 56 | - output("version: " . htmlspecialchars($value["toolkitVersion"]) . "\n"); |
|
| 57 | - output("docs: " . htmlspecialchars($value["toolkitDocsUrl"]) . "\n"); |
|
| 58 | - output("os: " . htmlspecialchars($value["toolkitOperatingSystem"]) . "\n"); |
|
| 55 | + output("name: ".htmlspecialchars($value["toolkitName"])."\n"); |
|
| 56 | + output("version: ".htmlspecialchars($value["toolkitVersion"])."\n"); |
|
| 57 | + output("docs: ".htmlspecialchars($value["toolkitDocsUrl"])."\n"); |
|
| 58 | + output("os: ".htmlspecialchars($value["toolkitOperatingSystem"])."\n"); |
|
| 59 | 59 | output("</pre>"); |
| 60 | 60 | } else { |
| 61 | 61 | output("An error occurred: "); |
| 62 | - output("Code: " . htmlspecialchars($resp->faultCode()) . " Reason: '" . htmlspecialchars($resp->faultString()) . "'\n"); |
|
| 62 | + output("Code: ".htmlspecialchars($resp->faultCode())." Reason: '".htmlspecialchars($resp->faultString())."'\n"); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | output("</body></html>\n"); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__ . "/_prepend.php"; |
|
| 2 | +require_once __DIR__."/_prepend.php"; |
|
| 3 | 3 | |
| 4 | 4 | output('<html lang="en"> |
| 5 | 5 | <head><title>phpxmlrpc - Getstatename demo</title></head> |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | $stateNo = ""; |
| 18 | 18 | |
| 19 | 19 | if (isset($_POST['stateno']) && $_POST['stateno'] != "") { |
| 20 | - $stateNo = (integer)$_POST['stateno']; |
|
| 20 | + $stateNo = (integer) $_POST['stateno']; |
|
| 21 | 21 | $method = 'examples.getStateName'; |
| 22 | 22 | $arguments = array( |
| 23 | 23 | new Value($stateNo, Value::$xmlrpcInt), |
| 24 | 24 | ); |
| 25 | 25 | $req = new Request($method, $arguments); |
| 26 | - output("Sending the following request:<pre>\n\n" . htmlentities($req->serialize()) . |
|
| 26 | + output("Sending the following request:<pre>\n\n".htmlentities($req->serialize()). |
|
| 27 | 27 | "\n\n</pre>Debug info of server data follows...\n\n"); |
| 28 | 28 | $client = new Client(XMLRPCSERVER); |
| 29 | 29 | $client->setDebug(1); |
@@ -32,12 +32,12 @@ discard block |
||
| 32 | 32 | $val = $resp->value(); |
| 33 | 33 | // NB: we are _assuming_ that the server did return a scalar xml-rpc value here. |
| 34 | 34 | // If the server is not trusted, we might check that via `$val->kindOf() == 'scalar'` |
| 35 | - output('<br/>State number <b>' . $stateNo . '</b> is <b>' |
|
| 36 | - . htmlspecialchars($val->scalarval()) . '</b><br/><br/>'); |
|
| 35 | + output('<br/>State number <b>'.$stateNo.'</b> is <b>' |
|
| 36 | + . htmlspecialchars($val->scalarval()).'</b><br/><br/>'); |
|
| 37 | 37 | } else { |
| 38 | 38 | output('An error occurred: '); |
| 39 | - output('<pre>Code: ' . htmlspecialchars($resp->faultCode()) |
|
| 40 | - . " Reason: '" . htmlspecialchars($resp->faultString()) . "'</pre>"); |
|
| 39 | + output('<pre>Code: '.htmlspecialchars($resp->faultCode()) |
|
| 40 | + . " Reason: '".htmlspecialchars($resp->faultString())."'</pre>"); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__ . "/_prepend.php"; |
|
| 2 | +require_once __DIR__."/_prepend.php"; |
|
| 3 | 3 | |
| 4 | 4 | output('<html lang="en"> |
| 5 | 5 | <head><title>phpxmlrpc - Proxy demo</title></head> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__ . "/_prepend.php"; |
|
| 2 | +require_once __DIR__."/_prepend.php"; |
|
| 3 | 3 | |
| 4 | 4 | output('<html lang="en"> |
| 5 | 5 | <head><title>phpxmlrpc - Webservice wrapper demo</title></head> |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $client->return_type = 'phpvals'; // let client give us back php values instead of xmlrpcvals |
| 21 | 21 | $resp = $client->send(new PhpXmlRpc\Request('system.listMethods')); |
| 22 | 22 | if ($resp->faultCode()) { |
| 23 | - output("<p>Server methods list could not be retrieved: error {$resp->faultCode()} '" . htmlspecialchars($resp->faultString()) . "'</p>\n"); |
|
| 23 | + output("<p>Server methods list could not be retrieved: error {$resp->faultCode()} '".htmlspecialchars($resp->faultString())."'</p>\n"); |
|
| 24 | 24 | } else { |
| 25 | 25 | output("<p>Server methods list retrieved, now wrapping it up...</p>\n<ul>\n"); |
| 26 | 26 | flush(); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | if ($methodName == 'examples.getStateName') { |
| 33 | 33 | $callable = $wrapper->wrapXmlrpcMethod($client, $methodName); |
| 34 | 34 | if ($callable) { |
| 35 | - output("<li>Remote server method " . htmlspecialchars($methodName) . " wrapped into php function</li>\n"); |
|
| 35 | + output("<li>Remote server method ".htmlspecialchars($methodName)." wrapped into php function</li>\n"); |
|
| 36 | 36 | } else { |
| 37 | - output("<li>Remote server method " . htmlspecialchars($methodName) . " could not be wrapped!</li>\n"); |
|
| 37 | + output("<li>Remote server method ".htmlspecialchars($methodName)." could not be wrapped!</li>\n"); |
|
| 38 | 38 | } |
| 39 | 39 | break; |
| 40 | 40 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__ . "/_prepend.php"; |
|
| 2 | +require_once __DIR__."/_prepend.php"; |
|
| 3 | 3 | |
| 4 | 4 | output('<html lang="en"> |
| 5 | 5 | <head><title>phpxmlrpc - Agesort demo</title></head> |
@@ -17,21 +17,21 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $inAr = array( |
| 19 | 19 | array('name' => 'Dave', 'age' => 24), |
| 20 | - array('name' => 'Edd', 'age' => 45), |
|
| 21 | - array('name' => 'Joe', 'age' => 37), |
|
| 20 | + array('name' => 'Edd', 'age' => 45), |
|
| 21 | + array('name' => 'Joe', 'age' => 37), |
|
| 22 | 22 | array('name' => 'Fred', 'age' => 27), |
| 23 | 23 | ); |
| 24 | 24 | |
| 25 | 25 | output('This is the input data:<br/><pre>'); |
| 26 | 26 | foreach ($inAr as $val) { |
| 27 | - output($val['name'] . ", " . $val['age'] . "\n"); |
|
| 27 | + output($val['name'].", ".$val['age']."\n"); |
|
| 28 | 28 | } |
| 29 | 29 | output('</pre>'); |
| 30 | 30 | |
| 31 | 31 | // Create xml-rpc parameters from the input array: an array of structs |
| 32 | 32 | $encoder = new Encoder(); |
| 33 | 33 | $v = $encoder->encode($inAr); |
| 34 | -output("Encoded into xml-rpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n"); |
|
| 34 | +output("Encoded into xml-rpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n"); |
|
| 35 | 35 | |
| 36 | 36 | // create client and request objects |
| 37 | 37 | $req = new Request('examples.sortByAge', array($v)); |
@@ -51,15 +51,15 @@ discard block |
||
| 51 | 51 | $value = $resp->value(); |
| 52 | 52 | foreach ($encoder->decode($value) as $struct) { |
| 53 | 53 | // note: here we are trusting the server's response to have the expected format |
| 54 | - output(htmlspecialchars($struct['name']) . ", " . htmlspecialchars($struct['age']) . "\n"); |
|
| 54 | + output(htmlspecialchars($struct['name']).", ".htmlspecialchars($struct['age'])."\n"); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - output('</pre><hr/>For nerds: I got this value back<br/><pre>' . |
|
| 58 | - htmlentities($resp->serialize()) . "</pre><hr/>\n"); |
|
| 57 | + output('</pre><hr/>For nerds: I got this value back<br/><pre>'. |
|
| 58 | + htmlentities($resp->serialize())."</pre><hr/>\n"); |
|
| 59 | 59 | } else { |
| 60 | 60 | output('An error occurred:<pre>'); |
| 61 | - output('Code: ' . htmlspecialchars($resp->faultCode()) . |
|
| 62 | - "\nReason: '" . htmlspecialchars($resp->faultString()) . "'</pre><hr/>"); |
|
| 61 | + output('Code: '.htmlspecialchars($resp->faultCode()). |
|
| 62 | + "\nReason: '".htmlspecialchars($resp->faultString())."'</pre><hr/>"); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | output("</body></html>\n"); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__ . "/_prepend.php"; |
|
| 2 | +require_once __DIR__."/_prepend.php"; |
|
| 3 | 3 | |
| 4 | 4 | output('<html lang="en"> |
| 5 | 5 | <head><title>phpxmlrpc - Introspect demo</title></head> |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | function display_error($r) |
| 18 | 18 | { |
| 19 | 19 | output("An error occurred: "); |
| 20 | - output("Code: " . $r->faultCode() . " Reason: '" . $r->faultString() . "'<br/>"); |
|
| 20 | + output("Code: ".$r->faultCode()." Reason: '".$r->faultString()."'<br/>"); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $client = new Client(XMLRPCSERVER); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $client->return_type = XMLRPCParser::RETURN_PHP; |
| 26 | 26 | |
| 27 | 27 | // First off, let's retrieve the list of methods available on the remote server |
| 28 | -output("<h3>methods available at http://" . $client->server . $client->path . "</h3>\n"); |
|
| 28 | +output("<h3>methods available at http://".$client->server.$client->path."</h3>\n"); |
|
| 29 | 29 | $req = new Request('system.listMethods'); |
| 30 | 30 | $resp = $client->send($req); |
| 31 | 31 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | // Then, retrieve the signature and help text of each available method |
| 49 | 49 | foreach ($v as $methodName) { |
| 50 | - output("<h4>" . htmlspecialchars($methodName) . "</h4>\n"); |
|
| 50 | + output("<h4>".htmlspecialchars($methodName)."</h4>\n"); |
|
| 51 | 51 | // build requests first, add params later |
| 52 | 52 | $r1 = new PhpXmlRpc\Request('system.methodHelp'); |
| 53 | 53 | $r2 = new PhpXmlRpc\Request('system.methodSignature'); |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | $ret = $sig[0]; |
| 86 | - output("<code>" . htmlspecialchars($ret) . " " |
|
| 87 | - . htmlspecialchars($methodName) . "("); |
|
| 88 | - if (count($sig) > 1) { |
|
| 89 | - for ($k = 1; $k < count($sig); $k++) { |
|
| 86 | + output("<code>".htmlspecialchars($ret)." " |
|
| 87 | + . htmlspecialchars($methodName)."("); |
|
| 88 | + if (count($sig)>1) { |
|
| 89 | + for ($k = 1; $k<count($sig); $k++) { |
|
| 90 | 90 | output(htmlspecialchars($sig[$k])); |
| 91 | - if ($k < count($sig) - 1) { |
|
| 91 | + if ($k<count($sig)-1) { |
|
| 92 | 92 | output(", "); |
| 93 | 93 | } |
| 94 | 94 | } |