@@ -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\Encoder; |
6 | 6 | use PhpXmlRpc\Client; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $handles = array(); |
26 | 26 | $curl = curl_multi_init(); |
27 | 27 | |
28 | - foreach($requests as $k => $req) { |
|
28 | + foreach ($requests as $k => $req) { |
|
29 | 29 | $req->setDebug($this->debug); |
30 | 30 | |
31 | 31 | $handle = $this->prepareCurlHandle( |
@@ -58,19 +58,19 @@ discard block |
||
58 | 58 | $running = 0; |
59 | 59 | do { |
60 | 60 | curl_multi_exec($curl, $running); |
61 | - } while($running > 0); |
|
61 | + } while ($running>0); |
|
62 | 62 | |
63 | 63 | $responses = array(); |
64 | - foreach($handles as $k => $h) { |
|
64 | + foreach ($handles as $k => $h) { |
|
65 | 65 | $responses[$k] = curl_multi_getcontent($handles[$k]); |
66 | 66 | |
67 | - if ($this->debug > 1) { |
|
67 | + if ($this->debug>1) { |
|
68 | 68 | $message = "---CURL INFO---\n"; |
69 | 69 | foreach (curl_getinfo($h) as $name => $val) { |
70 | 70 | if (is_array($val)) { |
71 | 71 | $val = implode("\n", $val); |
72 | 72 | } |
73 | - $message .= $name . ': ' . $val . "\n"; |
|
73 | + $message .= $name.': '.$val."\n"; |
|
74 | 74 | } |
75 | 75 | $message .= '---END---'; |
76 | 76 | $this->getLogger()->debugMessage($message); |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | } |
82 | 82 | curl_multi_close($curl); |
83 | 83 | |
84 | - foreach($responses as $k => $resp) { |
|
84 | + foreach ($responses as $k => $resp) { |
|
85 | 85 | if (!$resp) { |
86 | - $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl)); |
|
86 | + $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': '.curl_error($curl)); |
|
87 | 87 | } else { |
88 | 88 | $responses[$k] = $requests[$k]->parseResponse($resp, true, $this->return_type); |
89 | 89 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $value = $encoder->encode($data, array('auto_dates')); |
101 | 101 | $req = new Request('interopEchoTests.echoValue', array($value)); |
102 | 102 | $reqs = array(); |
103 | -for ($i = 0; $i < $num_tests; $i++) { |
|
103 | +for ($i = 0; $i<$num_tests; $i++) { |
|
104 | 104 | $reqs[] = $req; |
105 | 105 | } |
106 | 106 | |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | |
110 | 110 | $t = microtime(true); |
111 | 111 | $resp = $client->send($reqs); |
112 | -$t = microtime(true) - $t; |
|
112 | +$t = microtime(true)-$t; |
|
113 | 113 | echo "Sequential send: $t secs\n"; |
114 | 114 | |
115 | 115 | $t = microtime(true); |
116 | 116 | $resp = $client->sendParallel($reqs); |
117 | -$t = microtime(true) - $t; |
|
117 | +$t = microtime(true)-$t; |
|
118 | 118 | echo "Parallel send: $t secs\n"; |
119 | 119 | |
120 | 120 | $client->no_multicall = false; |
121 | 121 | $t = microtime(true); |
122 | 122 | $resp = $client->send($reqs); |
123 | -$t = microtime(true) - $t; |
|
123 | +$t = microtime(true)-$t; |
|
124 | 124 | echo "Multicall send: $t secs\n"; |
125 | 125 | |
126 | -require_once __DIR__ . "/_append.php"; |
|
126 | +require_once __DIR__."/_append.php"; |
@@ -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>xmlrpc - Agesort demo</title></head> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $inAr = array("Dave" => 24, "Edd" => 45, "Joe" => 37, "Fred" => 27); |
14 | 14 | output("This is the input data:<br/><pre>"); |
15 | 15 | foreach ($inAr as $key => $val) { |
16 | - output($key . ", " . $val . "\n"); |
|
16 | + output($key.", ".$val."\n"); |
|
17 | 17 | } |
18 | 18 | output("</pre>"); |
19 | 19 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | ); |
30 | 30 | } |
31 | 31 | $v = new PhpXmlRpc\Value($p, "array"); |
32 | -output("Encoded into xmlrpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n"); |
|
32 | +output("Encoded into xmlrpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n"); |
|
33 | 33 | |
34 | 34 | // create client and message objects |
35 | 35 | $req = new PhpXmlRpc\Request('examples.sortByAge', array($v)); |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | foreach ($value as $struct) { |
50 | 50 | $name = $struct["name"]; |
51 | 51 | $age = $struct["age"]; |
52 | - output(htmlspecialchars($name->scalarval()) . ", " . htmlspecialchars($age->scalarval()) . "\n"); |
|
52 | + output(htmlspecialchars($name->scalarval()).", ".htmlspecialchars($age->scalarval())."\n"); |
|
53 | 53 | } |
54 | 54 | |
55 | - output("<hr/>For nerds: I got this value back<br/><pre>" . |
|
56 | - htmlentities($resp->serialize()) . "</pre><hr/>\n"); |
|
55 | + output("<hr/>For nerds: I got this value back<br/><pre>". |
|
56 | + htmlentities($resp->serialize())."</pre><hr/>\n"); |
|
57 | 57 | } else { |
58 | 58 | output("An error occurred:<pre>"); |
59 | - output("Code: " . htmlspecialchars($resp->faultCode()) . |
|
60 | - "\nReason: '" . htmlspecialchars($resp->faultString()) . '\'</pre><hr/>'); |
|
59 | + output("Code: ".htmlspecialchars($resp->faultCode()). |
|
60 | + "\nReason: '".htmlspecialchars($resp->faultString()).'\'</pre><hr/>'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | output("</body></html>\n"); |
64 | 64 | |
65 | -require_once __DIR__ . "/_append.php"; |
|
65 | +require_once __DIR__."/_append.php"; |
@@ -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>xmlrpc - Webservice wrappper 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 | } |
@@ -53,4 +53,4 @@ discard block |
||
53 | 53 | |
54 | 54 | output("</body></html>\n"); |
55 | 55 | |
56 | -require_once __DIR__ . "/_append.php"; |
|
56 | +require_once __DIR__."/_append.php"; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | error_reporting(E_ALL); |
15 | 15 | |
16 | 16 | // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer |
17 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
17 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
18 | 18 | PhpXmlRpc\Autoloader::register(); |
19 | 19 | |
20 | 20 | // Let unit tests run against localhost, 'plain' demos against a known public server |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777); |
34 | 34 | } |
35 | 35 | |
36 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
36 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // A helper for cli vs we output: |
@@ -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>xmlrpc - Which toolkit demo</title></head> |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | $value = $encoder->decode($resp->value()); |
19 | 19 | output("Toolkit info:<br/>\n"); |
20 | 20 | output("<pre>"); |
21 | - output("name: " . htmlspecialchars($value["toolkitName"]) . "\n"); |
|
22 | - output("version: " . htmlspecialchars($value["toolkitVersion"]) . "\n"); |
|
23 | - output("docs: " . htmlspecialchars($value["toolkitDocsUrl"]) . "\n"); |
|
24 | - output("os: " . htmlspecialchars($value["toolkitOperatingSystem"]) . "\n"); |
|
21 | + output("name: ".htmlspecialchars($value["toolkitName"])."\n"); |
|
22 | + output("version: ".htmlspecialchars($value["toolkitVersion"])."\n"); |
|
23 | + output("docs: ".htmlspecialchars($value["toolkitDocsUrl"])."\n"); |
|
24 | + output("os: ".htmlspecialchars($value["toolkitOperatingSystem"])."\n"); |
|
25 | 25 | output("</pre>"); |
26 | 26 | } else { |
27 | 27 | output("An error occurred: "); |
28 | - output("Code: " . htmlspecialchars($resp->faultCode()) . " Reason: '" . htmlspecialchars($resp->faultString()) . "'\n"); |
|
28 | + output("Code: ".htmlspecialchars($resp->faultCode())." Reason: '".htmlspecialchars($resp->faultString())."'\n"); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | output("</body></html>\n"); |
32 | 32 | |
33 | -require_once __DIR__ . "/_append.php"; |
|
33 | +require_once __DIR__."/_append.php"; |
@@ -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 | output('<html lang="en"> |
6 | 6 | <head><title>xmlrpc - Introspect demo</title></head> |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | function display_error($r) |
15 | 15 | { |
16 | 16 | output("An error occurred: "); |
17 | - output("Code: " . $r->faultCode() . " Reason: '" . $r->faultString() . "'<br/>"); |
|
17 | + output("Code: ".$r->faultCode()." Reason: '".$r->faultString()."'<br/>"); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | $client = new PhpXmlRpc\Client(XMLRPCSERVER); |
21 | 21 | |
22 | 22 | // First off, let's retrieve the list of methods available on the remote server |
23 | -output("<h3>methods available at http://" . $client->server . $client->path . "</h3>\n"); |
|
23 | +output("<h3>methods available at http://".$client->server.$client->path."</h3>\n"); |
|
24 | 24 | $req = new PhpXmlRpc\Request('system.listMethods'); |
25 | 25 | $resp = $client->send($req); |
26 | 26 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | // Then, retrieve the signature and help text of each available method |
33 | 33 | foreach ($v as $methodName) { |
34 | - output("<h4>" . $methodName->scalarval() . "</h4>\n"); |
|
34 | + output("<h4>".$methodName->scalarval()."</h4>\n"); |
|
35 | 35 | // build messages first, add params later |
36 | 36 | $m1 = new PhpXmlRpc\Request('system.methodHelp'); |
37 | 37 | $m2 = new PhpXmlRpc\Request('system.methodSignature'); |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | if ($val->kindOf() == "array") { |
63 | 63 | foreach ($val as $x) { |
64 | 64 | $ret = $x[0]; |
65 | - output("<code>" . htmlspecialchars($ret->scalarval()) . " " |
|
66 | - . htmlspecialchars($methodName->scalarval()) . "("); |
|
67 | - if ($x->count() > 1) { |
|
68 | - for ($k = 1; $k < $x->count(); $k++) { |
|
65 | + output("<code>".htmlspecialchars($ret->scalarval())." " |
|
66 | + . htmlspecialchars($methodName->scalarval())."("); |
|
67 | + if ($x->count()>1) { |
|
68 | + for ($k = 1; $k<$x->count(); $k++) { |
|
69 | 69 | $y = $x[$k]; |
70 | 70 | output(htmlspecialchars($y->scalarval())); |
71 | - if ($k < $x->count() - 1) { |
|
71 | + if ($k<$x->count()-1) { |
|
72 | 72 | output(", "); |
73 | 73 | } |
74 | 74 | } |
@@ -85,4 +85,4 @@ discard block |
||
85 | 85 | |
86 | 86 | output("</body></html>\n"); |
87 | 87 | |
88 | -require_once __DIR__ . "/_append.php"; |
|
88 | +require_once __DIR__."/_append.php"; |
@@ -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>xmlrpc - Proxy demo</title></head> |
@@ -77,4 +77,4 @@ discard block |
||
77 | 77 | |
78 | 78 | output("</body></html>\n"); |
79 | 79 | |
80 | -require_once __DIR__ . "/_append.php"; |
|
80 | +require_once __DIR__."/_append.php"; |
@@ -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>xmlrpc - Mail demo</title></head> |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | output("<font color=\"red\">"); |
36 | 36 | output("Mail send failed<br/>\n"); |
37 | 37 | output("Fault: "); |
38 | - output("Code: " . htmlspecialchars($resp->faultCode()) . |
|
39 | - " Reason: '" . htmlspecialchars($resp->faultString()) . "'<br/>"); |
|
38 | + output("Code: ".htmlspecialchars($resp->faultCode()). |
|
39 | + " Reason: '".htmlspecialchars($resp->faultString())."'<br/>"); |
|
40 | 40 | output("</font><br/>"); |
41 | 41 | } |
42 | 42 | } |
@@ -57,4 +57,4 @@ discard block |
||
57 | 57 | </html> |
58 | 58 | '); |
59 | 59 | |
60 | -require_once __DIR__ . "/_append.php"; |
|
60 | +require_once __DIR__."/_append.php"; |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | use PhpXmlRpc\Encoder; |
20 | 20 | |
21 | 21 | /// @todo allow autoloading when the library is installed as dependency |
22 | -include_once __DIR__ . '/../vendor/autoload.php'; |
|
22 | +include_once __DIR__.'/../vendor/autoload.php'; |
|
23 | 23 | |
24 | -include __DIR__ . '/../tests/parse_args.php'; |
|
24 | +include __DIR__.'/../tests/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 | } |
@@ -208,16 +208,16 @@ discard block |
||
208 | 208 | $value = $encoder->encode($data1, array('auto_dates')); |
209 | 209 | $req = new Request('interopEchoTests.echoValue', array($value)); |
210 | 210 | $reqs = array(); |
211 | - for ($i = 0; $i < $num_tests; $i++) { |
|
211 | + for ($i = 0; $i<$num_tests; $i++) { |
|
212 | 212 | $reqs[] = $req; |
213 | 213 | } |
214 | 214 | |
215 | 215 | $server = explode(':', $args['HTTPSERVER']); |
216 | - if (count($server) > 1) { |
|
217 | - $srv = 'http://' . $server[0] . '://' . $server[1] . $args['HTTPURI']; |
|
216 | + if (count($server)>1) { |
|
217 | + $srv = 'http://'.$server[0].'://'.$server[1].$args['HTTPURI']; |
|
218 | 218 | $c = new Client($args['HTTPURI'], $server[0], $server[1]); |
219 | 219 | } else { |
220 | - $srv = 'http://' . $args['HTTPSERVER'] . $args['HTTPURI']; |
|
220 | + $srv = 'http://'.$args['HTTPSERVER'].$args['HTTPURI']; |
|
221 | 221 | $c = new Client($args['HTTPURI'], $args['HTTPSERVER']); |
222 | 222 | } |
223 | 223 | |
@@ -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 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $c->keepalive = false; |
240 | 240 | begin_test($testName, 'http 11 no keepalive'); |
241 | 241 | $response = array(); |
242 | - for ($i = 0; $i < $num_tests; $i++) { |
|
242 | + for ($i = 0; $i<$num_tests; $i++) { |
|
243 | 243 | $resp = $c->send($req, 10, 'http11'); |
244 | 244 | $response[] = $resp->value(); |
245 | 245 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | begin_test($testName, 'http 11 w. keep-alive'); |
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 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | |
270 | 270 | begin_test($testName, 'http 10 w. compression'); |
271 | 271 | $response = array(); |
272 | - for ($i = 0; $i < $num_tests; $i++) { |
|
272 | + for ($i = 0; $i<$num_tests; $i++) { |
|
273 | 273 | $resp = $c->send($req); |
274 | 274 | $response[] = $resp->value(); |
275 | 275 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $c->keepalive = false; |
280 | 280 | begin_test($testName, 'http 11 w. compression and no keepalive'); |
281 | 281 | $response = array(); |
282 | - for ($i = 0; $i < $num_tests; $i++) { |
|
282 | + for ($i = 0; $i<$num_tests; $i++) { |
|
283 | 283 | $resp = $c->send($req, 10, 'http11'); |
284 | 284 | $response[] = $resp->value(); |
285 | 285 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $c->keepalive = true; |
289 | 289 | begin_test($testName, 'http 11 w. keep-alive and compression'); |
290 | 290 | $response = array(); |
291 | - for ($i = 0; $i < $num_tests; $i++) { |
|
291 | + for ($i = 0; $i<$num_tests; $i++) { |
|
292 | 292 | $resp = $c->send($req, 10, 'http11'); |
293 | 293 | $response[] = $resp->value(); |
294 | 294 | } |
@@ -309,11 +309,11 @@ discard block |
||
309 | 309 | /// test multicall vs. many calls vs. keep-alives - HTTPS |
310 | 310 | |
311 | 311 | $server = explode(':', $args['HTTPSSERVER']); |
312 | - if (count($server) > 1) { |
|
313 | - $srv = 'https://' . $server[0] . ':' . $server[1] . $args['HTTPSURI']; |
|
312 | + if (count($server)>1) { |
|
313 | + $srv = 'https://'.$server[0].':'.$server[1].$args['HTTPSURI']; |
|
314 | 314 | $c = new Client($args['HTTPSURI'], $server[0], $server[1], 'https'); |
315 | 315 | } else { |
316 | - $srv = 'https://' . $args['HTTPSSERVER'] . $args['HTTPSURI']; |
|
316 | + $srv = 'https://'.$args['HTTPSSERVER'].$args['HTTPSURI']; |
|
317 | 317 | $c = new Client($args['HTTPSURI'], $args['HTTPSSERVER'], 443, 'https'); |
318 | 318 | } |
319 | 319 | $c->setSSLVerifyPeer(!$args['HTTPSIGNOREPEER']); |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | begin_test($testName, 'https no keep-alive'); |
328 | 328 | $c->keepalive = false; |
329 | 329 | $response = array(); |
330 | - for ($i = 0; $i < $num_tests; $i++) { |
|
330 | + for ($i = 0; $i<$num_tests; $i++) { |
|
331 | 331 | $resp = $c->send($req); |
332 | 332 | $response[] = $resp->value(); |
333 | 333 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | begin_test($testName, 'https w. keep-alive'); |
337 | 337 | $c->keepalive = true; |
338 | 338 | $response = array(); |
339 | - for ($i = 0; $i < $num_tests; $i++) { |
|
339 | + for ($i = 0; $i<$num_tests; $i++) { |
|
340 | 340 | $resp = $c->send($req, 10); |
341 | 341 | $response[] = $resp->value(); |
342 | 342 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $c->keepalive = false; |
358 | 358 | begin_test($testName, 'https w. compression and no keepalive'); |
359 | 359 | $response = array(); |
360 | - for ($i = 0; $i < $num_tests; $i++) { |
|
360 | + for ($i = 0; $i<$num_tests; $i++) { |
|
361 | 361 | $resp = $c->send($req); |
362 | 362 | $response[] = $resp->value(); |
363 | 363 | } |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $c->keepalive = true; |
367 | 367 | begin_test($testName, 'https w. keep-alive and compression'); |
368 | 368 | $response = array(); |
369 | - for ($i = 0; $i < $num_tests; $i++) { |
|
369 | + for ($i = 0; $i<$num_tests; $i++) { |
|
370 | 370 | $resp = $c->send($req, 10); |
371 | 371 | $response[] = $resp->value(); |
372 | 372 | } |
@@ -387,11 +387,11 @@ discard block |
||
387 | 387 | /// test multicall vs. many calls vs. keep-alives - HTTP/2 |
388 | 388 | |
389 | 389 | $server = explode(':', $args['HTTPSSERVER']); |
390 | - if (count($server) > 1) { |
|
391 | - $srv = 'https://' . $server[0] . ':' . $server[1] . $args['HTTPSURI']; |
|
390 | + if (count($server)>1) { |
|
391 | + $srv = 'https://'.$server[0].':'.$server[1].$args['HTTPSURI']; |
|
392 | 392 | $c = new Client($args['HTTPSURI'], $server[0], $server[1], 'https'); |
393 | 393 | } else { |
394 | - $srv = 'https://' . $args['HTTPSSERVER'] . $args['HTTPSURI']; |
|
394 | + $srv = 'https://'.$args['HTTPSSERVER'].$args['HTTPSURI']; |
|
395 | 395 | $c = new Client($args['HTTPSURI'], $args['HTTPSSERVER'], 443, 'h2'); |
396 | 396 | } |
397 | 397 | $c->setSSLVerifyPeer(!$args['HTTPSIGNOREPEER']); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | begin_test($testName, 'http2 no keep-alive'); |
406 | 406 | $c->keepalive = false; |
407 | 407 | $response = array(); |
408 | - for ($i = 0; $i < $num_tests; $i++) { |
|
408 | + for ($i = 0; $i<$num_tests; $i++) { |
|
409 | 409 | $resp = $c->send($req); |
410 | 410 | $response[] = $resp->value(); |
411 | 411 | } |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | begin_test($testName, 'http2 w. keep-alive'); |
415 | 415 | $c->keepalive = true; |
416 | 416 | $response = array(); |
417 | - for ($i = 0; $i < $num_tests; $i++) { |
|
417 | + for ($i = 0; $i<$num_tests; $i++) { |
|
418 | 418 | $resp = $c->send($req, 10); |
419 | 419 | $response[] = $resp->value(); |
420 | 420 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $c->keepalive = false; |
436 | 436 | begin_test($testName, 'http2 w. compression and no keepalive'); |
437 | 437 | $response = array(); |
438 | - for ($i = 0; $i < $num_tests; $i++) { |
|
438 | + for ($i = 0; $i<$num_tests; $i++) { |
|
439 | 439 | $resp = $c->send($req); |
440 | 440 | $response[] = $resp->value(); |
441 | 441 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $c->keepalive = true; |
445 | 445 | begin_test($testName, 'http2 w. keep-alive and compression'); |
446 | 446 | $response = array(); |
447 | - for ($i = 0; $i < $num_tests; $i++) { |
|
447 | + for ($i = 0; $i<$num_tests; $i++) { |
|
448 | 448 | $resp = $c->send($req, 10); |
449 | 449 | $response[] = $resp->value(); |
450 | 450 | } |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | foreach ($test_results as $test => $results) { |
467 | 467 | echo "\nTEST: $test\n"; |
468 | 468 | foreach ($results as $case => $data) { |
469 | - echo " $case: {$data['time']} secs - Output data CRC: " . crc32(serialize($data['result'])) . "\n"; |
|
469 | + echo " $case: {$data['time']} secs - Output data CRC: ".crc32(serialize($data['result']))."\n"; |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 |