@@ -29,7 +29,7 @@ |
||
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
32 | - if (is_file($file = __DIR__ . str_replace(array('PhpXmlRpc\\', '\\'), '/', $class).'.php')) { |
|
32 | + if (is_file($file = __DIR__.str_replace(array('PhpXmlRpc\\', '\\'), '/', $class).'.php')) { |
|
33 | 33 | require $file; |
34 | 34 | } |
35 | 35 | } |
@@ -39,10 +39,10 @@ |
||
39 | 39 | $flags = ENT_COMPAT; |
40 | 40 | // avoid warnings on php < 5.4... |
41 | 41 | if (defined('ENT_HTML401')) { |
42 | - $flags = $flags | ENT_HTML401; |
|
42 | + $flags = $flags | ENT_HTML401; |
|
43 | 43 | } |
44 | 44 | if (defined('ENT_SUBSTITUTE')) { |
45 | - $flags = $flags | ENT_SUBSTITUTE; |
|
45 | + $flags = $flags | ENT_SUBSTITUTE; |
|
46 | 46 | } |
47 | 47 | if ($encoding != null) { |
48 | 48 | print "<PRE>\n".htmlentities($message, $flags, $encoding)."\n</PRE>"; |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
3 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
4 | 4 | |
5 | -include_once __DIR__ . '/parse_args.php'; |
|
5 | +include_once __DIR__.'/parse_args.php'; |
|
6 | 6 | |
7 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
7 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
8 | 8 | |
9 | 9 | use PHPUnit\Runner\BaseTestRunner; |
10 | 10 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->client->server .= 'XXX'; |
59 | 59 | $dnsinfo = @dns_get_record($this->client->server); |
60 | 60 | if ($dnsinfo) { |
61 | - $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found'); |
|
61 | + $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found'); |
|
62 | 62 | } else { |
63 | 63 | $r = $this->client->send($m, 5); |
64 | 64 | // make sure there's no freaking catchall DNS in effect |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | // now test a successful connection |
87 | 87 | $server = explode(':', $this->args['HTTPSERVER']); |
88 | - if (count($server) > 1) { |
|
88 | + if (count($server)>1) { |
|
89 | 89 | $this->client->port = $server[1]; |
90 | 90 | } |
91 | 91 | $this->client->server = $server[0]; |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * @author JoakimLofgren |
4 | 4 | */ |
5 | 5 | |
6 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
6 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
7 | 7 | |
8 | 8 | use PhpXmlRpc\Helper\Charset; |
9 | 9 | |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | { |
33 | 33 | // construct a latin string with all chars (except control ones) |
34 | 34 | $this->latinString = "\n\r\t"; |
35 | - for($i = 32; $i < 127; $i++) { |
|
35 | + for ($i = 32; $i<127; $i++) { |
|
36 | 36 | $this->latinString .= chr($i); |
37 | 37 | } |
38 | - for($i = 160; $i < 256; $i++) { |
|
38 | + for ($i = 160; $i<256; $i++) { |
|
39 | 39 | $this->latinString .= chr($i); |
40 | 40 | } |
41 | 41 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
4 | -include_once __DIR__ . '/../lib/xmlrpcs.inc'; |
|
3 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
4 | +include_once __DIR__.'/../lib/xmlrpcs.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\Runner\BaseTestRunner; |
11 | 11 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $this->assertequals(1, count($v1)); |
129 | 129 | $out = array('me' => array(), 'mytype' => 2, '_php_class' => null); |
130 | 130 | |
131 | - foreach($v1 as $key => $val) |
|
131 | + foreach ($v1 as $key => $val) |
|
132 | 132 | { |
133 | 133 | $this->assertArrayHasKey($key, $out); |
134 | 134 | $expected = $out[$key]; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $this->assertequals(2, count($v2)); |
144 | 144 | $out = array(array('key' => 0, 'value' => 'object'), array('key' => 1, 'value' => 'object')); |
145 | 145 | $i = 0; |
146 | - foreach($v2 as $key => $val) |
|
146 | + foreach ($v2 as $key => $val) |
|
147 | 147 | { |
148 | 148 | $expected = $out[$i]; |
149 | 149 | $this->assertequals($expected['key'], $key); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | // nb: make sure that the serialized xml corresponding to this is > 10MB in size |
159 | 159 | $data = array(); |
160 | - for ($i = 0; $i < 500000; $i++ ) { |
|
160 | + for ($i = 0; $i<500000; $i++) { |
|
161 | 161 | $data[] = 'hello world'; |
162 | 162 | } |
163 | 163 |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | // test for php version |
18 | 18 | $ver = phpversion(); |
19 | 19 | $tests['php_version'] = array(); |
20 | - $tests['php_version']['description'] = 'PHP version found: ' . $ver . ".\n\n"; |
|
21 | - if (version_compare($ver, '5.3.0') < 0) { |
|
20 | + $tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n"; |
|
21 | + if (version_compare($ver, '5.3.0')<0) { |
|
22 | 22 | $tests['php_version']['status'] = 0; |
23 | 23 | $tests['php_version']['description'] .= 'This version of PHP is not compatible with this release of the PHP XMLRPC library. Please upgrade to php 5.1.0 or later'; |
24 | 24 | } else { |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | // test for php version |
52 | 52 | $ver = phpversion(); |
53 | 53 | $tests['php_version'] = array(); |
54 | - $tests['php_version']['description'] = 'PHP version found: ' . $ver . ".\n\n"; |
|
55 | - if (version_compare($ver, '5.3.0') < 0) { |
|
54 | + $tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n"; |
|
55 | + if (version_compare($ver, '5.3.0')<0) { |
|
56 | 56 | $tests['php_version']['status'] = 0; |
57 | 57 | $tests['php_version']['description'] .= 'This version of PHP is not compatible with the PHP XMLRPC library. Please upgrade to 5.1.0 or later'; |
58 | 58 | } else { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $info = curl_version(); |
80 | 80 | $tests['curl']['status'] = 2; |
81 | 81 | $tests['curl']['description'] = "The cURL extension is enabled.\n\nYou will be able to send and receive messages using 'HTTPS' and 'HTTP 1.1' protocols"; |
82 | - if (version_compare($ver, '4.3.8') < 0) { |
|
82 | + if (version_compare($ver, '4.3.8')<0) { |
|
83 | 83 | $tests['curl']['status'] = 1; |
84 | 84 | $tests['curl']['description'] .= ".\nPlease note that the current cURL install does not support keep-alives"; |
85 | 85 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | <?php |
168 | 168 | $res = phpxmlrpc_verify_compat('server'); |
169 | 169 | foreach ($res as $test => $result) { |
170 | - echo '<tr><td class="res' . $result['status'] . '">' . htmlspecialchars($test) . '</td><td class="result">' . htmlspecialchars($result['description']) . "</td></tr>\n"; |
|
170 | + echo '<tr><td class="res'.$result['status'].'">'.htmlspecialchars($test).'</td><td class="result">'.htmlspecialchars($result['description'])."</td></tr>\n"; |
|
171 | 171 | } |
172 | 172 | ?> |
173 | 173 | </tbody> |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | <?php |
185 | 185 | $res = phpxmlrpc_verify_compat('client'); |
186 | 186 | foreach ($res as $test => $result) { |
187 | - echo '<tr><td class="res' . $result['status'] . '">' . htmlspecialchars($test) . '</td><td class="result">' . htmlspecialchars($result['description']) . "</td></tr>\n"; |
|
187 | + echo '<tr><td class="res'.$result['status'].'">'.htmlspecialchars($test).'</td><td class="result">'.htmlspecialchars($result['description'])."</td></tr>\n"; |
|
188 | 188 | } |
189 | 189 | ?> |
190 | 190 | </tbody> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/parse_args.php'; |
|
3 | +include_once __DIR__.'/parse_args.php'; |
|
4 | 4 | |
5 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
5 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
6 | 6 | |
7 | 7 | use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage; |
8 | 8 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function _run($result = NULL) |
27 | 27 | { |
28 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
28 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
29 | 29 | |
30 | 30 | if ($result === NULL) { |
31 | 31 | $result = $this->createResult(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | protected function request($path, $method = 'GET', $payload = '', $emptyPageOk = false) |
62 | 62 | { |
63 | - $url = $this->baseUrl . $path; |
|
63 | + $url = $this->baseUrl.$path; |
|
64 | 64 | |
65 | 65 | $ch = curl_init($url); |
66 | 66 | curl_setopt_array($ch, array( |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | curl_setopt($ch, CURLOPT_COOKIE, 'PHPUNIT_SELENIUM_TEST_ID='.$this->testId); |
80 | 80 | } |
81 | - if ($this->args['DEBUG'] > 0) { |
|
81 | + if ($this->args['DEBUG']>0) { |
|
82 | 82 | curl_setopt($ch, CURLOPT_VERBOSE, 1); |
83 | 83 | } |
84 | 84 | $page = curl_exec($ch); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $val = reset($ar); |
108 | 108 | $typ = key($ar); |
109 | 109 | |
110 | - return '<value>' . $this->serializedata($typ, $val) . "</value>\n"; |
|
110 | + return '<value>'.$this->serializedata($typ, $val)."</value>\n"; |
|
111 | 111 | //} |
112 | 112 | } |
113 | 113 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // preserve back compatibility |
127 | 127 | |
128 | 128 | if (is_array($b)) { |
129 | - foreach($b as $id => $cont) { |
|
129 | + foreach ($b as $id => $cont) { |
|
130 | 130 | $b[$id] = $cont->scalarval(); |
131 | 131 | } |
132 | 132 | } |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | // add support for structures directly encoding php objects |
135 | 135 | if (is_object($b)) { |
136 | 136 | $t = get_object_vars($b); |
137 | - foreach($t as $id => $cont) { |
|
137 | + foreach ($t as $id => $cont) { |
|
138 | 138 | $t[$id] = $cont->scalarval(); |
139 | 139 | } |
140 | - foreach($t as $id => $cont) { |
|
140 | + foreach ($t as $id => $cont) { |
|
141 | 141 | @$b->$id = $cont; |
142 | 142 | } |
143 | 143 | } |
@@ -179,17 +179,17 @@ discard block |
||
179 | 179 | /* Expose as global functions the ones which are now class methods */ |
180 | 180 | |
181 | 181 | /// Wrong speling, but we are adamant on backwards compatibility! |
182 | -function xmlrpc_encode_entitites($data, $srcEncoding='', $destEncoding='') |
|
182 | +function xmlrpc_encode_entitites($data, $srcEncoding = '', $destEncoding = '') |
|
183 | 183 | { |
184 | 184 | return Charset::instance()->encodeEntities($data, $srcEncoding, $destEncoding); |
185 | 185 | } |
186 | 186 | |
187 | -function iso8601_encode($timeT, $utc=0) |
|
187 | +function iso8601_encode($timeT, $utc = 0) |
|
188 | 188 | { |
189 | 189 | return Date::iso8601Encode($timeT, $utc); |
190 | 190 | } |
191 | 191 | |
192 | -function iso8601_decode($iDate, $utc=0) |
|
192 | +function iso8601_decode($iDate, $utc = 0) |
|
193 | 193 | { |
194 | 194 | return Date::iso8601Decode($iDate, $utc); |
195 | 195 | } |
@@ -199,25 +199,25 @@ discard block |
||
199 | 199 | return Http::decodeChunked($buffer); |
200 | 200 | } |
201 | 201 | |
202 | -function php_xmlrpc_decode($xmlrpcVal, $options=array()) |
|
202 | +function php_xmlrpc_decode($xmlrpcVal, $options = array()) |
|
203 | 203 | { |
204 | 204 | $encoder = new Encoder(); |
205 | 205 | return $encoder->decode($xmlrpcVal, $options); |
206 | 206 | } |
207 | 207 | |
208 | -function php_xmlrpc_encode($phpVal, $options=array()) |
|
208 | +function php_xmlrpc_encode($phpVal, $options = array()) |
|
209 | 209 | { |
210 | 210 | $encoder = new Encoder(); |
211 | 211 | return $encoder->encode($phpVal, $options); |
212 | 212 | } |
213 | 213 | |
214 | -function php_xmlrpc_decode_xml($xmlVal, $options=array()) |
|
214 | +function php_xmlrpc_decode_xml($xmlVal, $options = array()) |
|
215 | 215 | { |
216 | 216 | $encoder = new Encoder(); |
217 | 217 | return $encoder->decodeXml($xmlVal, $options); |
218 | 218 | } |
219 | 219 | |
220 | -function guess_encoding($httpHeader='', $xmlChunk='', $encodingPrefs=null) |
|
220 | +function guess_encoding($httpHeader = '', $xmlChunk = '', $encodingPrefs = null) |
|
221 | 221 | { |
222 | 222 | return XMLParser::guessEncoding($httpHeader, $xmlChunk, $encodingPrefs); |
223 | 223 | } |
@@ -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 |