@@ -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 |
@@ -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 |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $this->me['struct'] = $val; |
120 | 120 | break; |
121 | 121 | default: |
122 | - $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a known type ($type)"); |
|
122 | + $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a known type ($type)"); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | if ($typeOf !== 1) { |
147 | - $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)"); |
|
147 | + $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); |
|
148 | 148 | return 0; |
149 | 149 | } |
150 | 150 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | |
162 | 162 | switch ($this->mytype) { |
163 | 163 | case 1: |
164 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value'); |
|
164 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value'); |
|
165 | 165 | return 0; |
166 | 166 | case 3: |
167 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value'); |
|
167 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value'); |
|
168 | 168 | return 0; |
169 | 169 | case 2: |
170 | 170 | // we're adding a scalar value to an array here |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | return 1; |
208 | 208 | } else { |
209 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
209 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
210 | 210 | return 0; |
211 | 211 | } |
212 | 212 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | return 1; |
239 | 239 | } else { |
240 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
240 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
241 | 241 | return 0; |
242 | 242 | } |
243 | 243 | } |
@@ -279,19 +279,19 @@ discard block |
||
279 | 279 | case 1: |
280 | 280 | switch ($typ) { |
281 | 281 | case static::$xmlrpcBase64: |
282 | - $rs .= "<${typ}>" . base64_encode($val) . "</${typ}>"; |
|
282 | + $rs .= "<${typ}>".base64_encode($val)."</${typ}>"; |
|
283 | 283 | break; |
284 | 284 | case static::$xmlrpcBoolean: |
285 | - $rs .= "<${typ}>" . ($val ? '1' : '0') . "</${typ}>"; |
|
285 | + $rs .= "<${typ}>".($val ? '1' : '0')."</${typ}>"; |
|
286 | 286 | break; |
287 | 287 | case static::$xmlrpcString: |
288 | 288 | // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml |
289 | - $rs .= "<${typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</${typ}>"; |
|
289 | + $rs .= "<${typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</${typ}>"; |
|
290 | 290 | break; |
291 | 291 | case static::$xmlrpcInt: |
292 | 292 | case static::$xmlrpcI4: |
293 | 293 | case static::$xmlrpcI8: |
294 | - $rs .= "<${typ}>" . (int)$val . "</${typ}>"; |
|
294 | + $rs .= "<${typ}>".(int) $val."</${typ}>"; |
|
295 | 295 | break; |
296 | 296 | case static::$xmlrpcDouble: |
297 | 297 | // avoid using standard conversion of float to string because it is locale-dependent, |
@@ -299,16 +299,16 @@ discard block |
||
299 | 299 | // sprintf('%F') could be most likely ok but it fails eg. on 2e-14. |
300 | 300 | // The code below tries its best at keeping max precision while avoiding exp notation, |
301 | 301 | // but there is of course no limit in the number of decimal places to be used... |
302 | - $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</${typ}>"; |
|
302 | + $rs .= "<${typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</${typ}>"; |
|
303 | 303 | break; |
304 | 304 | case static::$xmlrpcDateTime: |
305 | 305 | if (is_string($val)) { |
306 | 306 | $rs .= "<${typ}>${val}</${typ}>"; |
307 | 307 | // DateTimeInterface is not present in php 5.4... |
308 | 308 | } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) { |
309 | - $rs .= "<${typ}>" . $val->format('Ymd\TH:i:s') . "</${typ}>"; |
|
309 | + $rs .= "<${typ}>".$val->format('Ymd\TH:i:s')."</${typ}>"; |
|
310 | 310 | } elseif (is_int($val)) { |
311 | - $rs .= "<${typ}>" . date('Ymd\TH:i:s', $val) . "</${typ}>"; |
|
311 | + $rs .= "<${typ}>".date('Ymd\TH:i:s', $val)."</${typ}>"; |
|
312 | 312 | } else { |
313 | 313 | // not really a good idea here: but what should we output anyway? left for backward compat... |
314 | 314 | $rs .= "<${typ}>${val}</${typ}>"; |
@@ -330,14 +330,14 @@ discard block |
||
330 | 330 | case 3: |
331 | 331 | // struct |
332 | 332 | if ($this->_php_class) { |
333 | - $rs .= '<struct php_class="' . $this->_php_class . "\">\n"; |
|
333 | + $rs .= '<struct php_class="'.$this->_php_class."\">\n"; |
|
334 | 334 | } else { |
335 | 335 | $rs .= "<struct>\n"; |
336 | 336 | } |
337 | 337 | $charsetEncoder = $this->getCharsetEncoder(); |
338 | 338 | /** @var Value $val2 */ |
339 | 339 | foreach ($val as $key2 => $val2) { |
340 | - $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n"; |
|
340 | + $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n"; |
|
341 | 341 | //$rs.=$this->serializeval($val2); |
342 | 342 | $rs .= $val2->serialize($charsetEncoding); |
343 | 343 | $rs .= "</member>\n"; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $val = reset($this->me); |
374 | 374 | $typ = key($this->me); |
375 | 375 | |
376 | - return '<value>' . $this->serializedata($typ, $val, $charsetEncoding) . "</value>\n"; |
|
376 | + return '<value>'.$this->serializedata($typ, $val, $charsetEncoding)."</value>\n"; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
@@ -2,20 +2,20 @@ |
||
2 | 2 | |
3 | 3 | use PHPUnit\Runner\Version as PHPUnit_Version; |
4 | 4 | |
5 | -if ( class_exists( 'PHPUnit_Extensions_SeleniumCommon_RemoteCoverage' ) === true |
|
6 | - && class_exists( 'PHPUnit\Extensions\SeleniumCommon\RemoteCoverage' ) === false |
|
5 | +if (class_exists('PHPUnit_Extensions_SeleniumCommon_RemoteCoverage') === true |
|
6 | + && class_exists('PHPUnit\Extensions\SeleniumCommon\RemoteCoverage') === false |
|
7 | 7 | ) { |
8 | - class_alias( 'PHPUnit_Extensions_SeleniumCommon_RemoteCoverage', 'PHPUnit\Extensions\SeleniumCommon\RemoteCoverage' ); |
|
8 | + class_alias('PHPUnit_Extensions_SeleniumCommon_RemoteCoverage', 'PHPUnit\Extensions\SeleniumCommon\RemoteCoverage'); |
|
9 | 9 | } |
10 | 10 | |
11 | -if ( class_exists( 'PHPUnit_Runner_BaseTestRunner' ) === true |
|
12 | - && class_exists( 'PHPUnit\Runner\BaseTestRunner' ) === false |
|
11 | +if (class_exists('PHPUnit_Runner_BaseTestRunner') === true |
|
12 | + && class_exists('PHPUnit\Runner\BaseTestRunner') === false |
|
13 | 13 | ) { |
14 | - class_alias( 'PHPUnit_Runner_BaseTestRunner', 'PHPUnit\Runner\BaseTestRunner' ); |
|
14 | + class_alias('PHPUnit_Runner_BaseTestRunner', 'PHPUnit\Runner\BaseTestRunner'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if (class_exists('PHPUnit\Runner\Version') === false || version_compare(PHPUnit_Version::id(), '8.0.0', '<')) { |
18 | - include_once __DIR__ . '/PolyfillTestCase7.php'; |
|
18 | + include_once __DIR__.'/PolyfillTestCase7.php'; |
|
19 | 19 | } else { |
20 | - include_once __DIR__ . '/PolyfillTestCase8.php'; |
|
20 | + include_once __DIR__.'/PolyfillTestCase8.php'; |
|
21 | 21 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | public function xml_header($charsetEncoding = '') |
91 | 91 | { |
92 | 92 | if ($charsetEncoding != '') { |
93 | - return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?" . ">\n<methodCall>\n"; |
|
93 | + return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?".">\n<methodCall>\n"; |
|
94 | 94 | } else { |
95 | - return "<?xml version=\"1.0\"?" . ">\n<methodCall>\n"; |
|
95 | + return "<?xml version=\"1.0\"?".">\n<methodCall>\n"; |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | public function createPayload($charsetEncoding = '') |
113 | 113 | { |
114 | 114 | if ($charsetEncoding != '') { |
115 | - $this->content_type = 'text/xml; charset=' . $charsetEncoding; |
|
115 | + $this->content_type = 'text/xml; charset='.$charsetEncoding; |
|
116 | 116 | } else { |
117 | 117 | $this->content_type = 'text/xml'; |
118 | 118 | } |
119 | 119 | $this->payload = $this->xml_header($charsetEncoding); |
120 | - $this->payload .= '<methodName>' . $this->getCharsetEncoder()->encodeEntities( |
|
121 | - $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n"; |
|
120 | + $this->payload .= '<methodName>'.$this->getCharsetEncoder()->encodeEntities( |
|
121 | + $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</methodName>\n"; |
|
122 | 122 | $this->payload .= "<params>\n"; |
123 | 123 | foreach ($this->params as $p) { |
124 | - $this->payload .= "<param>\n" . $p->serialize($charsetEncoding) . |
|
124 | + $this->payload .= "<param>\n".$p->serialize($charsetEncoding). |
|
125 | 125 | "</param>\n"; |
126 | 126 | } |
127 | 127 | $this->payload .= "</params>\n"; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array()); |
249 | 249 | |
250 | 250 | if ($data == '') { |
251 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': no response received from server.'); |
|
251 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': no response received from server.'); |
|
252 | 252 | return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']); |
253 | 253 | } |
254 | 254 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | // failed processing of HTTP response headers |
262 | 262 | // save into response obj the full payload received, for debugging |
263 | 263 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data, 'status_code', $e->statusCode())); |
264 | - } catch(\Exception $e) { |
|
264 | + } catch (\Exception $e) { |
|
265 | 265 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data)); |
266 | 266 | } |
267 | 267 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // idea from Luca Mariano <[email protected]> originally in PEARified version of the lib |
276 | 276 | $pos = strrpos($data, '</methodResponse>'); |
277 | 277 | if ($pos !== false) { |
278 | - $data = substr($data, 0, $pos + 17); |
|
278 | + $data = substr($data, 0, $pos+17); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | // try to 'guestimate' the character encoding of the received response |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | if ($start) { |
287 | 287 | $start += strlen('<!-- SERVER DEBUG INFO (BASE64 ENCODED):'); |
288 | 288 | $end = strpos($data, '-->', $start); |
289 | - $comments = substr($data, $start, $end - $start); |
|
290 | - $this->getLogger()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t" . |
|
291 | - str_replace("\n", "\n\t", base64_decode($comments)) . "\n---END---", $respEncoding); |
|
289 | + $comments = substr($data, $start, $end-$start); |
|
290 | + $this->getLogger()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t". |
|
291 | + str_replace("\n", "\n\t", base64_decode($comments))."\n---END---", $respEncoding); |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if (extension_loaded('mbstring')) { |
312 | 312 | $data = mb_convert_encoding($data, 'UTF-8', $respEncoding); |
313 | 313 | } else { |
314 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received response: ' . $respEncoding); |
|
314 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': invalid charset encoding of received response: '.$respEncoding); |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | } |
@@ -332,12 +332,12 @@ discard block |
||
332 | 332 | $xmlRpcParser->parse($data, $returnType, XMLParser::ACCEPT_RESPONSE, $options); |
333 | 333 | |
334 | 334 | // first error check: xml not well formed |
335 | - if ($xmlRpcParser->_xh['isf'] > 2) { |
|
335 | + if ($xmlRpcParser->_xh['isf']>2) { |
|
336 | 336 | |
337 | 337 | // BC break: in the past for some cases we used the error message: 'XML error at line 1, check URL' |
338 | 338 | |
339 | 339 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_xml'], |
340 | - PhpXmlRpc::$xmlrpcstr['invalid_xml'] . ' ' . $xmlRpcParser->_xh['isf_reason'], '', |
|
340 | + PhpXmlRpc::$xmlrpcstr['invalid_xml'].' '.$xmlRpcParser->_xh['isf_reason'], '', |
|
341 | 341 | $this->httpResponse |
342 | 342 | ); |
343 | 343 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | // second error check: xml well formed but not xml-rpc compliant |
349 | 349 | elseif ($xmlRpcParser->_xh['isf'] == 2) { |
350 | 350 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_not_compliant'], |
351 | - PhpXmlRpc::$xmlrpcstr['xml_not_compliant'] . ' ' . $xmlRpcParser->_xh['isf_reason'], '', |
|
351 | + PhpXmlRpc::$xmlrpcstr['xml_not_compliant'].' '.$xmlRpcParser->_xh['isf_reason'], '', |
|
352 | 352 | $this->httpResponse |
353 | 353 | ); |
354 | 354 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | '', $this->httpResponse |
365 | 365 | ); |
366 | 366 | } else { |
367 | - if ($this->debug > 1) { |
|
367 | + if ($this->debug>1) { |
|
368 | 368 | $this->getLogger()->debugMessage( |
369 | 369 | "---PARSED---\n".var_export($xmlRpcParser->_xh['value'], true)."\n---END---" |
370 | 370 | ); |
@@ -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__ . '/5ServerTest.php'; |
|
8 | +include_once __DIR__.'/5ServerTest.php'; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Tests which stress http features of the library. |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ); |
31 | 31 | |
32 | 32 | $methods = array(); |
33 | - foreach(get_class_methods('ServerTest') as $method) |
|
33 | + foreach (get_class_methods('ServerTest') as $method) |
|
34 | 34 | { |
35 | 35 | if (strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods)) |
36 | 36 | { |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | preg_match('/ubunutu([0-9]+)/', $output[0], $matches); |
272 | 272 | $ubuntuVersion = @$matches[1]; |
273 | 273 | } |
274 | - if ($ubuntuVersion >= 20) { |
|
274 | + if ($ubuntuVersion>=20) { |
|
275 | 275 | $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher'); |
276 | 276 | return; |
277 | 277 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function echoInput() |
56 | 56 | { |
57 | - $r = new PhpXmlRpc\Response(new PhpXmlRpc\Value("'Aha said I: '" . file_get_contents('php://input'), 'string')); |
|
57 | + $r = new PhpXmlRpc\Response(new PhpXmlRpc\Value("'Aha said I: '".file_get_contents('php://input'), 'string')); |
|
58 | 58 | print $r->serialize(); |
59 | 59 | } |
60 | 60 | |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function __get($name) |
67 | 67 | { |
68 | - switch($name) { |
|
68 | + switch ($name) { |
|
69 | 69 | case 'dmap': |
70 | 70 | return $this->dmap; |
71 | 71 | default: |
72 | 72 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
73 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . |
|
73 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '. |
|
74 | 74 | $trace[0]['line'], E_USER_NOTICE); |
75 | 75 | return null; |
76 | 76 | } |
@@ -97,30 +97,30 @@ discard block |
||
97 | 97 | Server::xmlrpc_debugmsg($m); |
98 | 98 | } |
99 | 99 | |
100 | -function _xmlrpcs_getCapabilities($server, $m=null) |
|
100 | +function _xmlrpcs_getCapabilities($server, $m = null) |
|
101 | 101 | { |
102 | 102 | return Server::_xmlrpcs_getCapabilities($server, $m); |
103 | 103 | } |
104 | 104 | |
105 | -$_xmlrpcs_listMethods_sig=array(array(\PhpXmlRpc\Value::$xmlrpcArray)); |
|
106 | -$_xmlrpcs_listMethods_doc='This method lists all the methods that the XML-RPC server knows how to dispatch'; |
|
107 | -$_xmlrpcs_listMethods_sdoc=array(array('list of method names')); |
|
108 | -function _xmlrpcs_listMethods($server, $m=null) // if called in plain php values mode, second param is missing |
|
105 | +$_xmlrpcs_listMethods_sig = array(array(\PhpXmlRpc\Value::$xmlrpcArray)); |
|
106 | +$_xmlrpcs_listMethods_doc = 'This method lists all the methods that the XML-RPC server knows how to dispatch'; |
|
107 | +$_xmlrpcs_listMethods_sdoc = array(array('list of method names')); |
|
108 | +function _xmlrpcs_listMethods($server, $m = null) // if called in plain php values mode, second param is missing |
|
109 | 109 | { |
110 | 110 | return Server::_xmlrpcs_listMethods($server, $m); |
111 | 111 | } |
112 | 112 | |
113 | -$_xmlrpcs_methodSignature_sig=array(array(\PhpXmlRpc\Value::$xmlrpcArray, $GLOBALS['xmlrpcString'])); |
|
114 | -$_xmlrpcs_methodSignature_doc='Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)'; |
|
115 | -$_xmlrpcs_methodSignature_sdoc=array(array('list of known signatures, each sig being an array of xmlrpc type names', 'name of method to be described')); |
|
113 | +$_xmlrpcs_methodSignature_sig = array(array(\PhpXmlRpc\Value::$xmlrpcArray, $GLOBALS['xmlrpcString'])); |
|
114 | +$_xmlrpcs_methodSignature_doc = 'Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)'; |
|
115 | +$_xmlrpcs_methodSignature_sdoc = array(array('list of known signatures, each sig being an array of xmlrpc type names', 'name of method to be described')); |
|
116 | 116 | function _xmlrpcs_methodSignature($server, $m) |
117 | 117 | { |
118 | 118 | return Server::_xmlrpcs_methodSignature($server, $m); |
119 | 119 | } |
120 | 120 | |
121 | -$_xmlrpcs_methodHelp_sig=array(array($GLOBALS['xmlrpcString'], $GLOBALS['xmlrpcString'])); |
|
122 | -$_xmlrpcs_methodHelp_doc='Returns help text if defined for the method passed, otherwise returns an empty string'; |
|
123 | -$_xmlrpcs_methodHelp_sdoc=array(array('method description', 'name of the method to be described')); |
|
121 | +$_xmlrpcs_methodHelp_sig = array(array($GLOBALS['xmlrpcString'], $GLOBALS['xmlrpcString'])); |
|
122 | +$_xmlrpcs_methodHelp_doc = 'Returns help text if defined for the method passed, otherwise returns an empty string'; |
|
123 | +$_xmlrpcs_methodHelp_sdoc = array(array('method description', 'name of the method to be described')); |
|
124 | 124 | function _xmlrpcs_methodHelp($server, $m) |
125 | 125 | { |
126 | 126 | return Server::_xmlrpcs_methodHelp($server, $m); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | * @param array $extraOptions |
42 | 42 | * @return array|false |
43 | 43 | */ |
44 | -function wrap_php_function($funcName, $newFuncName='', $extraOptions=array()) |
|
44 | +function wrap_php_function($funcName, $newFuncName = '', $extraOptions = array()) |
|
45 | 45 | { |
46 | 46 | $wrapper = new PhpXmlRpc\Wrapper(); |
47 | - if (!isset($extraOptions['return_source']) || $extraOptions['return_source'] == false) { |
|
47 | + if (!isset($extraOptions['return_source']) || $extraOptions['return_source'] == false) { |
|
48 | 48 | // backwards compat: return string instead of callable |
49 | 49 | $extraOptions['return_source'] = true; |
50 | 50 | $wrapped = $wrapper->wrapPhpFunction($funcName, $newFuncName, $extraOptions); |
@@ -64,17 +64,17 @@ discard block |
||
64 | 64 | * @param array $extraOptions |
65 | 65 | * @return array|false |
66 | 66 | */ |
67 | -function wrap_php_class($className, $extraOptions=array()) |
|
67 | +function wrap_php_class($className, $extraOptions = array()) |
|
68 | 68 | { |
69 | 69 | $wrapper = new PhpXmlRpc\Wrapper(); |
70 | 70 | $fix = false; |
71 | - if (!isset($extraOptions['return_source']) || $extraOptions['return_source'] == false) { |
|
71 | + if (!isset($extraOptions['return_source']) || $extraOptions['return_source'] == false) { |
|
72 | 72 | // backwards compat: return string instead of callable |
73 | 73 | $extraOptions['return_source'] = true; |
74 | 74 | $fix = true; |
75 | 75 | } |
76 | 76 | $wrapped = $wrapper->wrapPhpClass($className, $extraOptions); |
77 | - foreach($wrapped as $name => $value) { |
|
77 | + foreach ($wrapped as $name => $value) { |
|
78 | 78 | if ($fix) { |
79 | 79 | eval($value['source']); |
80 | 80 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param string $newFuncName deprecated, use an option in $extraOptions |
94 | 94 | * @return array|callable|false |
95 | 95 | */ |
96 | -function wrap_xmlrpc_method($client, $methodName, $extraOptions=0, $timeout=0, $protocol='', $newFuncName='') |
|
96 | +function wrap_xmlrpc_method($client, $methodName, $extraOptions = 0, $timeout = 0, $protocol = '', $newFuncName = '') |
|
97 | 97 | { |
98 | 98 | if (!is_array($extraOptions)) |
99 | 99 | { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $wrapper = new PhpXmlRpc\Wrapper(); |
110 | 110 | |
111 | - if (!isset($extraOptions['return_source']) || $extraOptions['return_source'] == false) { |
|
111 | + if (!isset($extraOptions['return_source']) || $extraOptions['return_source'] == false) { |
|
112 | 112 | // backwards compat: return string instead of callable |
113 | 113 | $extraOptions['return_source'] = true; |
114 | 114 | $wrapped = $wrapper->wrapXmlrpcMethod($client, $methodName, $extraOptions); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param array $extraOptions |
129 | 129 | * @return mixed |
130 | 130 | */ |
131 | -function wrap_xmlrpc_server($client, $extraOptions=array()) |
|
131 | +function wrap_xmlrpc_server($client, $extraOptions = array()) |
|
132 | 132 | { |
133 | 133 | $wrapper = new PhpXmlRpc\Wrapper(); |
134 | 134 | return $wrapper->wrapXmlrpcServer($client, $extraOptions); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $faultResponse = '', $namespace = '\\PhpXmlRpc\\') |
149 | 149 | { |
150 | 150 | $code = "function $xmlrpcFuncName ("; |
151 | - if ($clientCopyMode < 2) { |
|
151 | + if ($clientCopyMode<2) { |
|
152 | 152 | // client copy mode 0 or 1 == partial / full client copy in emitted code |
153 | 153 | $innerCode = build_client_wrapper_code($client, $clientCopyMode, $prefix); |
154 | 154 | $innerCode .= "\$client->setDebug(\$debug);\n"; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | if ($mDesc != '') { |
164 | 164 | // take care that PHP comment is not terminated unwillingly by method description |
165 | - $mDesc = "/**\n* " . str_replace('*/', '* /', $mDesc) . "\n"; |
|
165 | + $mDesc = "/**\n* ".str_replace('*/', '* /', $mDesc)."\n"; |
|
166 | 166 | } else { |
167 | 167 | $mDesc = "/**\nFunction $xmlrpcFuncName\n"; |
168 | 168 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $innerCode .= "\$encoder = new {$namespace}Encoder();\n"; |
172 | 172 | $plist = array(); |
173 | 173 | $pCount = count($mSig); |
174 | - for ($i = 1; $i < $pCount; $i++) { |
|
174 | + for ($i = 1; $i<$pCount; $i++) { |
|
175 | 175 | $plist[] = "\$p$i"; |
176 | 176 | $pType = $mSig[$i]; |
177 | 177 | if ($pType == 'i4' || $pType == 'i8' || $pType == 'int' || $pType == 'boolean' || $pType == 'double' || |
@@ -187,19 +187,19 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | $innerCode .= "\$req->addparam(\$p$i);\n"; |
190 | - $mDesc .= '* @param ' . xmlrpc_2_php_type($pType) . " \$p$i\n"; |
|
190 | + $mDesc .= '* @param '.xmlrpc_2_php_type($pType)." \$p$i\n"; |
|
191 | 191 | } |
192 | - if ($clientCopyMode < 2) { |
|
192 | + if ($clientCopyMode<2) { |
|
193 | 193 | $plist[] = '$debug=0'; |
194 | 194 | $mDesc .= "* @param int \$debug when 1 (or 2) will enable debugging of the underlying {$prefix} call (defaults to 0)\n"; |
195 | 195 | } |
196 | 196 | $plist = implode(', ', $plist); |
197 | - $mDesc .= '* @return ' . xmlrpc_2_php_type($mSig[0]) . " (or an {$namespace}Response obj instance if call fails)\n*/\n"; |
|
197 | + $mDesc .= '* @return '.xmlrpc_2_php_type($mSig[0])." (or an {$namespace}Response obj instance if call fails)\n*/\n"; |
|
198 | 198 | |
199 | 199 | $innerCode .= "\$res = \${$this_}client->send(\$req, $timeout, '$protocol');\n"; |
200 | 200 | if ($decodeFault) { |
201 | 201 | if (is_string($faultResponse) && ((strpos($faultResponse, '%faultCode%') !== false) || (strpos($faultResponse, '%faultString%') !== false))) { |
202 | - $respCode = "str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '" . str_replace("'", "''", $faultResponse) . "')"; |
|
202 | + $respCode = "str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '".str_replace("'", "''", $faultResponse)."')"; |
|
203 | 203 | } else { |
204 | 204 | $respCode = var_export($faultResponse, true); |
205 | 205 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $innerCode .= "if (\$res->faultcode()) return $respCode; else return \$encoder->decode(\$res->value());"; |
213 | 213 | } |
214 | 214 | |
215 | - $code = $code . $plist . ") {\n" . $innerCode . "\n}\n"; |
|
215 | + $code = $code.$plist.") {\n".$innerCode."\n}\n"; |
|
216 | 216 | |
217 | 217 | return array('source' => $code, 'docstring' => $mDesc); |
218 | 218 | } |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | /** |
221 | 221 | * @deprecated |
222 | 222 | */ |
223 | -function build_client_wrapper_code($client, $verbatim_client_copy, $prefix='xmlrpc') |
|
223 | +function build_client_wrapper_code($client, $verbatim_client_copy, $prefix = 'xmlrpc') |
|
224 | 224 | { |
225 | 225 | $code = "\$client = new {$prefix}_client('".str_replace("'", "\'", $client->path). |
226 | - "', '" . str_replace("'", "\'", $client->server) . "', $client->port);\n"; |
|
226 | + "', '".str_replace("'", "\'", $client->server)."', $client->port);\n"; |
|
227 | 227 | |
228 | 228 | // copy all client fields to the client that will be generated runtime |
229 | 229 | // (this provides for future expansion or subclassing of client obj) |
@@ -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() |