@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
4 | -include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc'; |
|
3 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
4 | +include_once __DIR__.'/../lib/xmlrpc_wrappers.inc'; |
|
5 | 5 | |
6 | -include_once __DIR__ . '/parse_args.php'; |
|
6 | +include_once __DIR__.'/parse_args.php'; |
|
7 | 7 | |
8 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
8 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
9 | 9 | |
10 | 10 | use PHPUnit\Framework\TestResult; |
11 | 11 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // (but only if not called from subclass objects / multitests) |
37 | 37 | if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') { |
38 | 38 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
39 | - for ($i = 0; $i < count($trace); $i++) { |
|
39 | + for ($i = 0; $i<count($trace); $i++) { |
|
40 | 40 | if (strpos($trace[$i]['function'], 'test') === 0) { |
41 | 41 | self::$failed_tests[$trace[$i]['function']] = true; |
42 | 42 | break; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function _run($result = NULL) |
59 | 59 | { |
60 | - $this->testId = get_class($this) . '__' . $this->getName(); |
|
60 | + $this->testId = get_class($this).'__'.$this->getName(); |
|
61 | 61 | |
62 | 62 | if ($result === NULL) { |
63 | 63 | $result = $this->createResult(); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->args = argParser::getArgs(); |
89 | 89 | |
90 | 90 | $server = explode(':', $this->args['LOCALSERVER']); |
91 | - if (count($server) > 1) { |
|
91 | + if (count($server)>1) { |
|
92 | 92 | $this->client = new xmlrpc_client($this->args['URI'], $server[0], $server[1]); |
93 | 93 | } else { |
94 | 94 | $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->client->request_compression = $this->request_compression; |
99 | 99 | $this->client->accepted_compression = $this->accepted_compression; |
100 | 100 | |
101 | - $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); |
|
101 | + $this->coverageScriptUrl = 'http://'.$this->args['LOCALSERVER'].'/'.str_replace('/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI']); |
|
102 | 102 | |
103 | 103 | if ($this->args['DEBUG'] == 1) |
104 | 104 | ob_start(); |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | return $r; |
135 | 135 | } |
136 | 136 | if (is_array($errorCode)) { |
137 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
137 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
138 | 138 | } else { |
139 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
139 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
140 | 140 | } |
141 | 141 | if (!$r->faultCode()) { |
142 | 142 | if ($returnResponse) { |
@@ -158,20 +158,20 @@ discard block |
||
158 | 158 | $query = parse_url($this->client->path, PHP_URL_QUERY); |
159 | 159 | parse_str($query, $vars); |
160 | 160 | $query = http_build_query(array_merge($vars, $data)); |
161 | - $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query; |
|
161 | + $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | public function testString() |
165 | 165 | { |
166 | - $sendString = "here are 3 \"entities\": < > & " . |
|
167 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . |
|
168 | - " - isn't that great? \\\"hackery\\\" at it's best " . |
|
169 | - " also don't want to miss out on \$item[0]. " . |
|
170 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . |
|
171 | - "a simple CR here" . chr(13) . |
|
172 | - "a simple LF here" . chr(10) . |
|
173 | - "and then LFCR" . chr(10) . chr(13) . |
|
174 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; |
|
166 | + $sendString = "here are 3 \"entities\": < > & ". |
|
167 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). |
|
168 | + " - isn't that great? \\\"hackery\\\" at it's best ". |
|
169 | + " also don't want to miss out on \$item[0]. ". |
|
170 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). |
|
171 | + "a simple CR here".chr(13). |
|
172 | + "a simple LF here".chr(10). |
|
173 | + "and then LFCR".chr(10).chr(13). |
|
174 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; |
|
175 | 175 | $m = new xmlrpcmsg('examples.stringecho', array( |
176 | 176 | new xmlrpcval($sendString, 'string'), |
177 | 177 | )); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | public function testLatin1String() |
193 | 193 | { |
194 | 194 | $sendString = |
195 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
195 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; |
|
196 | 196 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. |
197 | 197 | $sendString. |
198 | 198 | '</value></param></params></methodCall>'; |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | public function testUtf8Method() |
297 | 297 | { |
298 | 298 | PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8'; |
299 | - $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array( |
|
299 | + $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array( |
|
300 | 300 | new xmlrpcval('hello') |
301 | 301 | )); |
302 | 302 | $v = $this->send($m); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | )); |
319 | 319 | $v = $this->send($m); |
320 | 320 | if ($v) { |
321 | - $this->assertEquals($a + $b, $v->scalarval()); |
|
321 | + $this->assertEquals($a+$b, $v->scalarval()); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | )); |
331 | 331 | $v = $this->send($m); |
332 | 332 | if ($v) { |
333 | - $this->assertEquals(12 - 23, $v->scalarval()); |
|
333 | + $this->assertEquals(12-23, $v->scalarval()); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | if ($v) { |
365 | 365 | $sz = $v->arraysize(); |
366 | 366 | $got = ''; |
367 | - for ($i = 0; $i < $sz; $i++) { |
|
367 | + for ($i = 0; $i<$sz; $i++) { |
|
368 | 368 | $b = $v->arraymem($i); |
369 | 369 | if ($b->scalarval()) { |
370 | 370 | $got .= '1'; |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $got = ''; |
428 | 428 | $expected = '37210'; |
429 | 429 | $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); |
430 | - foreach($expect_array as $val) { |
|
430 | + foreach ($expect_array as $val) { |
|
431 | 431 | $b = $v->structmem($val); |
432 | 432 | $got .= $b->me['int']; |
433 | 433 | } |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | { |
857 | 857 | // make a 'deep client copy' as the original one might have many properties set |
858 | 858 | // also for speed only wrap one method of the whole server |
859 | - $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' )); |
|
859 | + $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/')); |
|
860 | 860 | if ($class == '') { |
861 | 861 | $this->fail('Registration of remote server failed'); |
862 | 862 | } else { |
@@ -895,9 +895,9 @@ discard block |
||
895 | 895 | $cookies = array( |
896 | 896 | //'c1' => array(), |
897 | 897 | 'c2' => array('value' => 'c2'), |
898 | - 'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), |
|
899 | - 'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), |
|
900 | - 'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
898 | + 'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30), |
|
899 | + 'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'), |
|
900 | + 'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
901 | 901 | ); |
902 | 902 | $cookiesval = php_xmlrpc_encode($cookies); |
903 | 903 | $m = new xmlrpcmsg('examples.setcookies', array($cookiesval)); |
@@ -945,10 +945,10 @@ discard block |
||
945 | 945 | $m = new xmlrpcmsg('examples.getcookies', array()); |
946 | 946 | foreach ($cookies as $cookie => $val) { |
947 | 947 | $this->client->setCookie($cookie, $val); |
948 | - $cookies[$cookie] = (string)$cookies[$cookie]; |
|
948 | + $cookies[$cookie] = (string) $cookies[$cookie]; |
|
949 | 949 | } |
950 | 950 | $r = $this->client->send($m, $this->timeout, $this->method); |
951 | - $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
951 | + $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
952 | 952 | if (!$r->faultCode()) { |
953 | 953 | $v = $r->value(); |
954 | 954 | $v = php_xmlrpc_decode($v); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | // check for command line (env vars) vs. web page input params |
38 | 38 | if (!isset($_SERVER['REQUEST_METHOD'])) { |
39 | - foreach($_SERVER as $key => $val) { |
|
39 | + foreach ($_SERVER as $key => $val) { |
|
40 | 40 | if (array_key_exists($key, $args)) { |
41 | 41 | $$key = $val; |
42 | 42 | } |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | $args['HTTPSURI'] = $HTTPSURI; |
67 | 67 | } |
68 | 68 | if (isset($HTTPSIGNOREPEER)) { |
69 | - $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER; |
|
69 | + $args['HTTPSIGNOREPEER'] = (bool) $HTTPSIGNOREPEER; |
|
70 | 70 | } |
71 | 71 | if (isset($HTTPSVERIFYHOST)) { |
72 | - $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST; |
|
72 | + $args['HTTPSVERIFYHOST'] = (int) $HTTPSVERIFYHOST; |
|
73 | 73 | } |
74 | 74 | if (isset($SSLVERSION)) { |
75 | - $args['SSLVERSION'] = (int)$SSLVERSION; |
|
75 | + $args['SSLVERSION'] = (int) $SSLVERSION; |
|
76 | 76 | } |
77 | 77 | if (isset($PROXYSERVER)) { |
78 | 78 | $arr = explode(':', $PROXYSERVER); |
79 | 79 | $args['PROXYSERVER'] = $arr[0]; |
80 | - if (count($arr) > 1) { |
|
80 | + if (count($arr)>1) { |
|
81 | 81 | $args['PROXYPORT'] = $arr[1]; |
82 | 82 | } else { |
83 | 83 | $args['PROXYPORT'] = 8080; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | } |
108 | 108 | if ($URI[0] != '/') { |
109 | - $URI = '/' . $URI; |
|
109 | + $URI = '/'.$URI; |
|
110 | 110 | } |
111 | 111 | $args['URI'] = $URI; |
112 | 112 | if (isset($LOCALPATH)) { |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * NB: do not let your IDE fool you. The correct encoding for this file is NOT UTF8. |
4 | 4 | */ |
5 | -include_once __DIR__ . '/../lib/xmlrpc.inc'; |
|
6 | -include_once __DIR__ . '/../lib/xmlrpcs.inc'; |
|
5 | +include_once __DIR__.'/../lib/xmlrpc.inc'; |
|
6 | +include_once __DIR__.'/../lib/xmlrpcs.inc'; |
|
7 | 7 | |
8 | -include_once __DIR__ . '/parse_args.php'; |
|
8 | +include_once __DIR__.'/parse_args.php'; |
|
9 | 9 | |
10 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
10 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Tests involving parsing of xml and handling of xmlrpc values |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | public function testUnicodeInMemberName() |
65 | 65 | { |
66 | - $str = "G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
66 | + $str = "G".chr(252)."nter, El".chr(232)."ne"; |
|
67 | 67 | $v = array($str => new xmlrpcval(1)); |
68 | 68 | $r = new xmlrpcresp(new xmlrpcval($v, 'struct')); |
69 | 69 | $r = $r->serialize(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | '<?xml version="1.0"?> |
80 | 80 | <!-- $Id --> |
81 | 81 | <!-- found by G. Giunta, covers what happens when lib receives UTF8 chars in response text and comments --> |
82 | -<!-- ' . chr(224) . chr(252) . chr(232) . 'àüè --> |
|
82 | +<!-- ' . chr(224).chr(252).chr(232).'àüè --> |
|
83 | 83 | <methodResponse> |
84 | 84 | <fault> |
85 | 85 | <value> |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | </member> |
91 | 91 | <member> |
92 | 92 | <name>faultString</name> |
93 | -<value><string>' . chr(224) . chr(252) . chr(232) . 'àüè</string></value> |
|
93 | +<value><string>' . chr(224).chr(252).chr(232).'àüè</string></value> |
|
94 | 94 | </member> |
95 | 95 | </struct> |
96 | 96 | </value> |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $m = $this->newMsg('dummy'); |
100 | 100 | $r = $m->parseResponse($response); |
101 | 101 | $v = $r->faultString(); |
102 | - $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); |
|
102 | + $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | public function testValidNumbers() |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | public function testI8() |
162 | 162 | { |
163 | - if (PHP_INT_SIZE == 4 ) { |
|
163 | + if (PHP_INT_SIZE == 4) { |
|
164 | 164 | $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode'); |
165 | 165 | return; |
166 | 166 | } |
@@ -483,11 +483,11 @@ discard block |
||
483 | 483 | |
484 | 484 | public function testUTF8Response() |
485 | 485 | { |
486 | - $string = chr(224) . chr(252) . chr(232); |
|
486 | + $string = chr(224).chr(252).chr(232); |
|
487 | 487 | |
488 | 488 | $s = $this->newMsg('dummy'); |
489 | - $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
490 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
489 | + $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
490 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
491 | 491 | '; |
492 | 492 | $r = $s->parseResponse($f, false, 'phpvals'); |
493 | 493 | $v = $r->value(); |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | $this->assertEquals($string, $v); |
496 | 496 | |
497 | 497 | $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
498 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
498 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
499 | 499 | '; |
500 | 500 | $r = $s->parseResponse($f, false, 'phpvals'); |
501 | 501 | $v = $r->value(); |
@@ -510,11 +510,11 @@ discard block |
||
510 | 510 | |
511 | 511 | public function testLatin1Response() |
512 | 512 | { |
513 | - $string = chr(224) . chr(252) . chr(232); |
|
513 | + $string = chr(224).chr(252).chr(232); |
|
514 | 514 | |
515 | 515 | $s = $this->newMsg('dummy'); |
516 | - $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
517 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
516 | + $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
|
517 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
518 | 518 | '; |
519 | 519 | $r = $s->parseResponse($f, false, 'phpvals'); |
520 | 520 | $v = $r->value(); |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $this->assertEquals($string, $v); |
523 | 523 | |
524 | 524 | $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
525 | -<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
525 | +<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse> |
|
526 | 526 | '; |
527 | 527 | $r = $s->parseResponse($f, false, 'phpvals'); |
528 | 528 | $v = $r->value(); |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $this->assertequals(1, count($v1)); |
618 | 618 | $out = array('me' => array(), 'mytype' => 2, '_php_class' => null); |
619 | 619 | |
620 | - foreach($v1 as $key => $val) |
|
620 | + foreach ($v1 as $key => $val) |
|
621 | 621 | { |
622 | 622 | $this->assertArrayHasKey($key, $out); |
623 | 623 | $expected = $out[$key]; |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | $this->assertequals(2, count($v2)); |
633 | 633 | $out = array(array('key' => 0, 'value' => 'object'), array('key' => 1, 'value' => 'object')); |
634 | 634 | $i = 0; |
635 | - foreach($v2 as $key => $val) |
|
635 | + foreach ($v2 as $key => $val) |
|
636 | 636 | { |
637 | 637 | $expected = $out[$i]; |
638 | 638 | $this->assertequals($expected['key'], $key); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | { |
646 | 646 | // nb: make sure that the serialized xml corresponding to this is > 10MB in size |
647 | 647 | $data = array(); |
648 | - for ($i = 0; $i < 500000; $i++ ) { |
|
648 | + for ($i = 0; $i<500000; $i++) { |
|
649 | 649 | $data[] = 'hello world'; |
650 | 650 | } |
651 | 651 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * Please do not copy this file verbatim into your production server. |
10 | 10 | **/ |
11 | 11 | |
12 | -require_once __DIR__ . "/_bootstrap.php"; |
|
12 | +require_once __DIR__."/_bootstrap.php"; |
|
13 | 13 | |
14 | 14 | // out-of-band information: let the client manipulate the server operations. |
15 | 15 | // we do this to help the testsuite script: do not reproduce in production! |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']); |
20 | 20 | } |
21 | 21 | |
22 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
22 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php"; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | use PhpXmlRpc\Value; |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | // extract the value of the state number |
117 | 117 | $snv = $sno->scalarval(); |
118 | 118 | // look it up in our array (zero-based) |
119 | - if (isset($stateNames[$snv - 1])) { |
|
120 | - $stateName = $stateNames[$snv - 1]; |
|
119 | + if (isset($stateNames[$snv-1])) { |
|
120 | + $stateName = $stateNames[$snv-1]; |
|
121 | 121 | } else { |
122 | 122 | // not there, so complain |
123 | - $err = "I don't have a state for the index '" . $snv . "'"; |
|
123 | + $err = "I don't have a state for the index '".$snv."'"; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | // if we generated an error, create an error return response |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | { |
147 | 147 | global $stateNames; |
148 | 148 | |
149 | - if (isset($stateNames[$stateNo - 1])) { |
|
150 | - return $stateNames[$stateNo - 1]; |
|
149 | + if (isset($stateNames[$stateNo-1])) { |
|
150 | + return $stateNames[$stateNo-1]; |
|
151 | 151 | } else { |
152 | 152 | // not, there so complain |
153 | - throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
153 | + throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
@@ -180,17 +180,17 @@ discard block |
||
180 | 180 | eval($findstate9_sig['source']); |
181 | 181 | |
182 | 182 | $findstate10_sig = array( |
183 | - "function" => function ($req) { return findState($req); }, |
|
183 | + "function" => function($req) { return findState($req); }, |
|
184 | 184 | "signature" => $findstate_sig, |
185 | 185 | "docstring" => $findstate_doc, |
186 | 186 | ); |
187 | 187 | |
188 | -$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return inner_findstate($stateNo); }); |
|
188 | +$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return inner_findstate($stateNo); }); |
|
189 | 189 | |
190 | 190 | $c = new xmlrpcServerMethodsContainer; |
191 | 191 | $moreSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'tests.', 'method_type' => 'all')); |
192 | 192 | |
193 | -$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
193 | +$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
194 | 194 | |
195 | 195 | // used to test signatures with NULL params |
196 | 196 | $findstate12_sig = array( |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $s = $req->getParam(0); |
217 | 217 | $t = $req->getParam(1); |
218 | 218 | |
219 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcInt)); |
|
219 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcInt)); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | $addtwodouble_sig = array(array(Value::$xmlrpcDouble, Value::$xmlrpcDouble, Value::$xmlrpcDouble)); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $s = $req->getParam(0); |
227 | 227 | $t = $req->getParam(1); |
228 | 228 | |
229 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcDouble)); |
|
229 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcDouble)); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | $stringecho_sig = array(array(Value::$xmlrpcString, Value::$xmlrpcString)); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | function echoBack($req) |
243 | 243 | { |
244 | 244 | // just sends back a string with what i got sent to me, just escaped, that's all |
245 | - $s = "I got the following message:\n" . $req->serialize(); |
|
245 | + $s = "I got the following message:\n".$req->serialize(); |
|
246 | 246 | |
247 | 247 | return new PhpXmlRpc\Response(new Value($s)); |
248 | 248 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | return 0; |
300 | 300 | } |
301 | 301 | |
302 | - return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1; |
|
302 | + return ($agesorter_arr[$a]>$agesorter_arr[$b]) ? -1 : 1; |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | $agesorter_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray)); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | // hack, must make global as uksort() won't |
346 | 346 | // allow us to pass any other auxiliary information |
347 | 347 | uksort($agesorter_arr, 'agesorter_compare'); |
348 | - foreach($agesorter_arr as $key => $val) { |
|
348 | + foreach ($agesorter_arr as $key => $val) { |
|
349 | 349 | // recreate each struct element |
350 | 350 | $v[] = new Value( |
351 | 351 | array( |
@@ -400,17 +400,17 @@ discard block |
||
400 | 400 | $err = "Error, no 'From' field specified"; |
401 | 401 | } |
402 | 402 | |
403 | - $msgHdr = "From: " . $mFrom->scalarval() . "\n"; |
|
404 | - $msgHdr .= "To: " . $mTo->scalarval() . "\n"; |
|
403 | + $msgHdr = "From: ".$mFrom->scalarval()."\n"; |
|
404 | + $msgHdr .= "To: ".$mTo->scalarval()."\n"; |
|
405 | 405 | |
406 | 406 | if ($mCc->scalarval() != "") { |
407 | - $msgHdr .= "Cc: " . $mCc->scalarval() . "\n"; |
|
407 | + $msgHdr .= "Cc: ".$mCc->scalarval()."\n"; |
|
408 | 408 | } |
409 | 409 | if ($mBcc->scalarval() != "") { |
410 | - $msgHdr .= "Bcc: " . $mBcc->scalarval() . "\n"; |
|
410 | + $msgHdr .= "Bcc: ".$mBcc->scalarval()."\n"; |
|
411 | 411 | } |
412 | 412 | if ($mMime->scalarval() != "") { |
413 | - $msgHdr .= "Content-type: " . $mMime->scalarval() . "\n"; |
|
413 | + $msgHdr .= "Content-type: ".$mMime->scalarval()."\n"; |
|
414 | 414 | } |
415 | 415 | $msgHdr .= "X-Mailer: XML-RPC for PHP mailer 1.0"; |
416 | 416 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | $moe = $sno["moe"]; |
501 | 501 | $larry = $sno["larry"]; |
502 | 502 | $curly = $sno["curly"]; |
503 | - $num = $moe->scalarval() + $larry->scalarval() + $curly->scalarval(); |
|
503 | + $num = $moe->scalarval()+$larry->scalarval()+$curly->scalarval(); |
|
504 | 504 | |
505 | 505 | return new PhpXmlRpc\Response(new Value($num, Value::$xmlrpcInt)); |
506 | 506 | } |
@@ -542,9 +542,9 @@ discard block |
||
542 | 542 | $ar = $req->getParam(0); |
543 | 543 | $sz = $ar->count(); |
544 | 544 | $first = $ar[0]; |
545 | - $last = $ar[$sz - 1]; |
|
545 | + $last = $ar[$sz-1]; |
|
546 | 546 | |
547 | - return new PhpXmlRpc\Response(new Value($first->scalarval() . |
|
547 | + return new PhpXmlRpc\Response(new Value($first->scalarval(). |
|
548 | 548 | $last->scalarval(), Value::$xmlrpcString)); |
549 | 549 | } |
550 | 550 | |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | $larry = $fools["larry"]; |
579 | 579 | $moe = $fools["moe"]; |
580 | 580 | |
581 | - return new PhpXmlRpc\Response(new Value($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), Value::$xmlrpcInt)); |
|
581 | + return new PhpXmlRpc\Response(new Value($curly->scalarval()+$larry->scalarval()+$moe->scalarval(), Value::$xmlrpcInt)); |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | $v1_countTheEntities_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcString)); |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | $ap = 0; |
593 | 593 | $qu = 0; |
594 | 594 | $amp = 0; |
595 | - for ($i = 0; $i < strlen($str); $i++) { |
|
595 | + for ($i = 0; $i<strlen($str); $i++) { |
|
596 | 596 | $c = substr($str, $i, 1); |
597 | 597 | switch ($c) { |
598 | 598 | case ">": |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | ), |
795 | 795 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
796 | 796 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
797 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
797 | + "tests.utf8methodname.".'κόσμε' => array( |
|
798 | 798 | "function" => "stringEcho", |
799 | 799 | "signature" => $stringecho_sig, |
800 | 800 | "docstring" => $stringecho_doc, |
@@ -990,5 +990,5 @@ discard block |
||
990 | 990 | // Out-of-band information: let the client manipulate the server operations. |
991 | 991 | // We do this to help the testsuite script: do not reproduce in production! |
992 | 992 | if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) { |
993 | - include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
993 | + include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php"; |
|
994 | 994 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . "/_bootstrap.php"; |
|
3 | +require_once __DIR__."/_bootstrap.php"; |
|
4 | 4 | |
5 | 5 | use PhpXmlRpc\Value; |
6 | 6 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | $count = 0; |
32 | 32 | } |
33 | 33 | // add the new comment in |
34 | - dba_insert($msgID . "_comment_${count}", $comment, $dbh); |
|
35 | - dba_insert($msgID . "_name_${count}", $name, $dbh); |
|
34 | + dba_insert($msgID."_comment_${count}", $comment, $dbh); |
|
35 | + dba_insert($msgID."_name_${count}", $name, $dbh); |
|
36 | 36 | $count++; |
37 | 37 | dba_replace($countID, $count, $dbh); |
38 | 38 | dba_close($dbh); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $countID = "${msgID}_count"; |
66 | 66 | if (dba_exists($countID, $dbh)) { |
67 | 67 | $count = dba_fetch($countID, $dbh); |
68 | - for ($i = 0; $i < $count; $i++) { |
|
68 | + for ($i = 0; $i<$count; $i++) { |
|
69 | 69 | $name = dba_fetch("${msgID}_name_${i}", $dbh); |
70 | 70 | $comment = dba_fetch("${msgID}_comment_${i}", $dbh); |
71 | 71 | // push a new struct onto the return array |
@@ -14,5 +14,5 @@ |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer |
17 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
17 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
18 | 18 | PhpXmlRpc\Autoloader::register(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @license code licensed under the BSD License: see file license.txt |
10 | 10 | */ |
11 | 11 | |
12 | -require_once __DIR__ . "/_bootstrap.php"; |
|
12 | +require_once __DIR__."/_bootstrap.php"; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Forward an xmlrpc request to another server, and return to client the response received. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $url = $encoder->decode($req->getParam(0)); |
30 | 30 | $client = new PhpXmlRpc\Client($url); |
31 | 31 | |
32 | - if ($req->getNumParams() > 3) { |
|
32 | + if ($req->getNumParams()>3) { |
|
33 | 33 | // we have to set some options onto the client. |
34 | 34 | // Note that if we do not untaint the received values, warnings might be generated... |
35 | 35 | $options = $encoder->decode($req->getParam(3)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $client->setSSLVerifyPeer($val); |
50 | 50 | break; |
51 | 51 | case 'Timeout': |
52 | - $timeout = (integer)$val; |
|
52 | + $timeout = (integer) $val; |
|
53 | 53 | break; |
54 | 54 | } // switch |
55 | 55 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // add debug info into response we give back to caller |
70 | - PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: " . $req->serialize()); |
|
70 | + PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: ".$req->serialize()); |
|
71 | 71 | |
72 | 72 | return $client->send($req, $timeout); |
73 | 73 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php require_once __DIR__ . "/_bootstrap.php"; ?><html lang="en"> |
|
1 | +<?php require_once __DIR__."/_bootstrap.php"; ?><html lang="en"> |
|
2 | 2 | <head><title>xmlrpc - Mail demo</title></head> |
3 | 3 | <body> |
4 | 4 | <h1>Mail demo</h1> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <?php |
15 | 15 | |
16 | 16 | // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer |
17 | -include_once __DIR__ . "/../../src/Autoloader.php"; |
|
17 | +include_once __DIR__."/../../src/Autoloader.php"; |
|
18 | 18 | PhpXmlRpc\Autoloader::register(); |
19 | 19 | |
20 | 20 | if (isset($_POST["mailto"]) && $_POST["mailto"]) { |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | print "<font color=\"red\">"; |
39 | 39 | print "Mail send failed<br/>\n"; |
40 | 40 | print "Fault: "; |
41 | - print "Code: " . htmlspecialchars($resp->faultCode()) . |
|
42 | - " Reason: '" . htmlspecialchars($resp->faultString()) . "'<br/>"; |
|
41 | + print "Code: ".htmlspecialchars($resp->faultCode()). |
|
42 | + " Reason: '".htmlspecialchars($resp->faultString())."'<br/>"; |
|
43 | 43 | print "</font><br/>"; |
44 | 44 | } |
45 | 45 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php require_once __DIR__ . "/_bootstrap.php"; ?><html lang="en"> |
|
1 | +<?php require_once __DIR__."/_bootstrap.php"; ?><html lang="en"> |
|
2 | 2 | <head><title>xmlrpc - Introspect demo</title></head> |
3 | 3 | <body> |
4 | 4 | <h1>Introspect demo</h1> |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | function display_error($r) |
11 | 11 | { |
12 | 12 | print "An error occurred: "; |
13 | - print "Code: " . $r->faultCode() |
|
14 | - . " Reason: '" . $r->faultString() . "'<br/>"; |
|
13 | + print "Code: ".$r->faultCode() |
|
14 | + . " Reason: '".$r->faultString()."'<br/>"; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $client = new PhpXmlRpc\Client(XMLRPCSERVER); |
18 | 18 | |
19 | 19 | // First off, let's retrieve the list of methods available on the remote server |
20 | -print "<h3>methods available at http://" . $client->server . $client->path . "</h3>\n"; |
|
20 | +print "<h3>methods available at http://".$client->server.$client->path."</h3>\n"; |
|
21 | 21 | $req = new PhpXmlRpc\Request('system.listMethods'); |
22 | 22 | $resp = $client->send($req); |
23 | 23 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | // Then, retrieve the signature and help text of each available method |
30 | 30 | foreach ($v as $methodName) { |
31 | - print "<h4>" . $methodName->scalarval() . "</h4>\n"; |
|
31 | + print "<h4>".$methodName->scalarval()."</h4>\n"; |
|
32 | 32 | // build messages first, add params later |
33 | 33 | $m1 = new PhpXmlRpc\Request('system.methodHelp'); |
34 | 34 | $m2 = new PhpXmlRpc\Request('system.methodSignature'); |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | if ($val->kindOf() == "array") { |
60 | 60 | foreach ($val as $x) { |
61 | 61 | $ret = $x[0]; |
62 | - print "<code>" . htmlspecialchars($ret->scalarval()) . " " |
|
63 | - . htmlspecialchars($methodName->scalarval()) . "("; |
|
64 | - if ($x->count() > 1) { |
|
65 | - for ($k = 1; $k < $x->count(); $k++) { |
|
62 | + print "<code>".htmlspecialchars($ret->scalarval())." " |
|
63 | + . htmlspecialchars($methodName->scalarval())."("; |
|
64 | + if ($x->count()>1) { |
|
65 | + for ($k = 1; $k<$x->count(); $k++) { |
|
66 | 66 | $y = $x[$k]; |
67 | 67 | print htmlspecialchars($y->scalarval()); |
68 | - if ($k < $x->count() - 1) { |
|
68 | + if ($k<$x->count()-1) { |
|
69 | 69 | print ", "; |
70 | 70 | } |
71 | 71 | } |