@@ -29,7 +29,7 @@ |
||
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
32 | - if (is_file($file = __DIR__ . str_replace(array('PhpXmlRpc\\', '\\'), '/', $class).'.php')) { |
|
32 | + if (is_file($file = __DIR__.str_replace(array('PhpXmlRpc\\', '\\'), '/', $class).'.php')) { |
|
33 | 33 | require $file; |
34 | 34 | } |
35 | 35 | } |
@@ -39,10 +39,10 @@ |
||
39 | 39 | $flags = ENT_COMPAT; |
40 | 40 | // avoid warnings on php < 5.4... |
41 | 41 | if (defined('ENT_HTML401')) { |
42 | - $flags = $flags | ENT_HTML401; |
|
42 | + $flags = $flags | ENT_HTML401; |
|
43 | 43 | } |
44 | 44 | if (defined('ENT_SUBSTITUTE')) { |
45 | - $flags = $flags | ENT_SUBSTITUTE; |
|
45 | + $flags = $flags | ENT_SUBSTITUTE; |
|
46 | 46 | } |
47 | 47 | if ($encoding != null) { |
48 | 48 | print "<PRE>\n".htmlentities($message, $flags, $encoding)."\n</PRE>"; |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | // test for php version |
18 | 18 | $ver = phpversion(); |
19 | 19 | $tests['php_version'] = array(); |
20 | - $tests['php_version']['description'] = 'PHP version found: ' . $ver . ".\n\n"; |
|
21 | - if (version_compare($ver, '5.3.0') < 0) { |
|
20 | + $tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n"; |
|
21 | + if (version_compare($ver, '5.3.0')<0) { |
|
22 | 22 | $tests['php_version']['status'] = 0; |
23 | 23 | $tests['php_version']['description'] .= 'This version of PHP is not compatible with this release of the PHP XMLRPC library. Please upgrade to php 5.1.0 or later'; |
24 | 24 | } else { |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | // test for php version |
52 | 52 | $ver = phpversion(); |
53 | 53 | $tests['php_version'] = array(); |
54 | - $tests['php_version']['description'] = 'PHP version found: ' . $ver . ".\n\n"; |
|
55 | - if (version_compare($ver, '5.3.0') < 0) { |
|
54 | + $tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n"; |
|
55 | + if (version_compare($ver, '5.3.0')<0) { |
|
56 | 56 | $tests['php_version']['status'] = 0; |
57 | 57 | $tests['php_version']['description'] .= 'This version of PHP is not compatible with the PHP XMLRPC library. Please upgrade to 5.1.0 or later'; |
58 | 58 | } else { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $info = curl_version(); |
80 | 80 | $tests['curl']['status'] = 2; |
81 | 81 | $tests['curl']['description'] = "The cURL extension is enabled.\n\nYou will be able to send and receive messages using 'HTTPS' and 'HTTP 1.1' protocols"; |
82 | - if (version_compare($ver, '4.3.8') < 0) { |
|
82 | + if (version_compare($ver, '4.3.8')<0) { |
|
83 | 83 | $tests['curl']['status'] = 1; |
84 | 84 | $tests['curl']['description'] .= ".\nPlease note that the current cURL install does not support keep-alives"; |
85 | 85 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | <?php |
168 | 168 | $res = phpxmlrpc_verify_compat('server'); |
169 | 169 | foreach ($res as $test => $result) { |
170 | - echo '<tr><td class="res' . $result['status'] . '">' . htmlspecialchars($test) . '</td><td class="result">' . htmlspecialchars($result['description']) . "</td></tr>\n"; |
|
170 | + echo '<tr><td class="res'.$result['status'].'">'.htmlspecialchars($test).'</td><td class="result">'.htmlspecialchars($result['description'])."</td></tr>\n"; |
|
171 | 171 | } |
172 | 172 | ?> |
173 | 173 | </tbody> |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | <?php |
185 | 185 | $res = phpxmlrpc_verify_compat('client'); |
186 | 186 | foreach ($res as $test => $result) { |
187 | - echo '<tr><td class="res' . $result['status'] . '">' . htmlspecialchars($test) . '</td><td class="result">' . htmlspecialchars($result['description']) . "</td></tr>\n"; |
|
187 | + echo '<tr><td class="res'.$result['status'].'">'.htmlspecialchars($test).'</td><td class="result">'.htmlspecialchars($result['description'])."</td></tr>\n"; |
|
188 | 188 | } |
189 | 189 | ?> |
190 | 190 | </tbody> |
@@ -176,8 +176,7 @@ |
||
176 | 176 | } else { |
177 | 177 | $escapedData .= $ch; |
178 | 178 | } |
179 | - } |
|
180 | - else if ($ii < 128) { |
|
179 | + } else if ($ii < 128) { |
|
181 | 180 | /// @todo shall we replace this with a (supposedly) faster str_replace? |
182 | 181 | /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? |
183 | 182 | switch ($ii) { |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | if (count($this->xml_iso88591_Entities['in'])) { |
77 | 77 | return; |
78 | 78 | } |
79 | - for ($i = 0; $i < 32; $i++) { |
|
79 | + for ($i = 0; $i<32; $i++) { |
|
80 | 80 | $this->xml_iso88591_Entities["in"][] = chr($i); |
81 | 81 | $this->xml_iso88591_Entities["out"][] = "&#{$i};"; |
82 | 82 | } |
83 | 83 | |
84 | 84 | /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? |
85 | 85 | |
86 | - for ($i = 160; $i < 256; $i++) { |
|
86 | + for ($i = 160; $i<256; $i++) { |
|
87 | 87 | $this->xml_iso88591_Entities["in"][] = chr($i); |
88 | 88 | $this->xml_iso88591_Entities["out"][] = "&#{$i};"; |
89 | 89 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | break;*/ |
112 | 112 | |
113 | 113 | default: |
114 | - throw new ValueErrorException('Unsupported table: ' . $tableName); |
|
114 | + throw new ValueErrorException('Unsupported table: '.$tableName); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $srcEncoding = 'UTF-8'; |
164 | 164 | } |
165 | 165 | |
166 | - $conversion = strtoupper($srcEncoding . '_' . $destEncoding); |
|
166 | + $conversion = strtoupper($srcEncoding.'_'.$destEncoding); |
|
167 | 167 | |
168 | 168 | // list ordered with (expected) most common scenarios first |
169 | 169 | switch ($conversion) { |
@@ -181,20 +181,20 @@ discard block |
||
181 | 181 | // NB: this will choke on invalid UTF-8, going most likely beyond EOF |
182 | 182 | $escapedData = ''; |
183 | 183 | // be kind to users creating string xml-rpc values out of different php types |
184 | - $data = (string)$data; |
|
184 | + $data = (string) $data; |
|
185 | 185 | $ns = strlen($data); |
186 | - for ($nn = 0; $nn < $ns; $nn++) { |
|
186 | + for ($nn = 0; $nn<$ns; $nn++) { |
|
187 | 187 | $ch = $data[$nn]; |
188 | 188 | $ii = ord($ch); |
189 | 189 | // 7 bits in 1 byte: 0bbbbbbb (127) |
190 | - if ($ii < 32) { |
|
190 | + if ($ii<32) { |
|
191 | 191 | if ($conversion == 'UTF-8_US-ASCII') { |
192 | 192 | $escapedData .= sprintf('&#%d;', $ii); |
193 | 193 | } else { |
194 | 194 | $escapedData .= $ch; |
195 | 195 | } |
196 | 196 | } |
197 | - else if ($ii < 128) { |
|
197 | + else if ($ii<128) { |
|
198 | 198 | /// @todo shall we replace this with a (supposedly) faster str_replace? |
199 | 199 | /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? |
200 | 200 | switch ($ii) { |
@@ -219,25 +219,25 @@ discard block |
||
219 | 219 | } // 11 bits in 2 bytes: 110bbbbb 10bbbbbb (2047) |
220 | 220 | elseif ($ii >> 5 == 6) { |
221 | 221 | $b1 = ($ii & 31); |
222 | - $b2 = (ord($data[$nn + 1]) & 63); |
|
223 | - $ii = ($b1 * 64) + $b2; |
|
222 | + $b2 = (ord($data[$nn+1]) & 63); |
|
223 | + $ii = ($b1 * 64)+$b2; |
|
224 | 224 | $escapedData .= sprintf('&#%d;', $ii); |
225 | 225 | $nn += 1; |
226 | 226 | } // 16 bits in 3 bytes: 1110bbbb 10bbbbbb 10bbbbbb |
227 | 227 | elseif ($ii >> 4 == 14) { |
228 | 228 | $b1 = ($ii & 15); |
229 | - $b2 = (ord($data[$nn + 1]) & 63); |
|
230 | - $b3 = (ord($data[$nn + 2]) & 63); |
|
231 | - $ii = ((($b1 * 64) + $b2) * 64) + $b3; |
|
229 | + $b2 = (ord($data[$nn+1]) & 63); |
|
230 | + $b3 = (ord($data[$nn+2]) & 63); |
|
231 | + $ii = ((($b1 * 64)+$b2) * 64)+$b3; |
|
232 | 232 | $escapedData .= sprintf('&#%d;', $ii); |
233 | 233 | $nn += 2; |
234 | 234 | } // 21 bits in 4 bytes: 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb |
235 | 235 | elseif ($ii >> 3 == 30) { |
236 | 236 | $b1 = ($ii & 7); |
237 | - $b2 = (ord($data[$nn + 1]) & 63); |
|
238 | - $b3 = (ord($data[$nn + 2]) & 63); |
|
239 | - $b4 = (ord($data[$nn + 3]) & 63); |
|
240 | - $ii = ((((($b1 * 64) + $b2) * 64) + $b3) * 64) + $b4; |
|
237 | + $b2 = (ord($data[$nn+1]) & 63); |
|
238 | + $b3 = (ord($data[$nn+2]) & 63); |
|
239 | + $b4 = (ord($data[$nn+3]) & 63); |
|
240 | + $ii = ((((($b1 * 64)+$b2) * 64)+$b3) * 64)+$b4; |
|
241 | 241 | $escapedData .= sprintf('&#%d;', $ii); |
242 | 242 | $nn += 3; |
243 | 243 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | // If src is UTF8, we run htmlspecialchars before converting to the target charset, as |
291 | 291 | // htmlspecialchars has limited charset support, but it groks utf8 |
292 | 292 | if ($srcEncoding === 'UTF-8') { |
293 | - $data = htmlspecialchars($data, defined('ENT_XML1') ? ENT_XML1 | ENT_QUOTES : ENT_QUOTES, 'UTF-8'); |
|
293 | + $data = htmlspecialchars($data, defined('ENT_XML1') ? ENT_XML1 | ENT_QUOTES : ENT_QUOTES, 'UTF-8'); |
|
294 | 294 | } |
295 | 295 | if ($srcEncoding !== $destEncoding) { |
296 | 296 | try { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | if ($data === false) { |
304 | 304 | $escapedData = ''; |
305 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": Converting from $srcEncoding to $destEncoding via mbstring: failed..."); |
|
305 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": Converting from $srcEncoding to $destEncoding via mbstring: failed..."); |
|
306 | 306 | } else { |
307 | 307 | if ($srcEncoding === 'UTF-8') { |
308 | 308 | $escapedData = $data; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | } |
313 | 313 | } else { |
314 | 314 | $escapedData = ''; |
315 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": Converting from $srcEncoding to $destEncoding: not supported..."); |
|
315 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": Converting from $srcEncoding to $destEncoding: not supported..."); |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | if (function_exists('mb_list_encodings')) { |
331 | 331 | $knownCharsets = array_unique(array_merge($knownCharsets, array_diff(mb_list_encodings(), array( |
332 | 332 | 'pass', 'auto', 'wchar', 'BASE64', 'UUENCODE', 'ASCII', 'HTML-ENTITIES', 'Quoted-Printable', |
333 | - '7bit','8bit', 'byte2be', 'byte2le', 'byte4be', 'byte4le' |
|
333 | + '7bit', '8bit', 'byte2be', 'byte2le', 'byte4be', 'byte4le' |
|
334 | 334 | )))); |
335 | 335 | } |
336 | 336 | return $knownCharsets; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function isValidCharset($encoding, $validList) |
349 | 349 | { |
350 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
350 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
351 | 351 | |
352 | 352 | if (is_string($validList)) { |
353 | 353 | $validList = explode(',', $validList); |
@@ -377,14 +377,14 @@ discard block |
||
377 | 377 | */ |
378 | 378 | public function getEntities($charset) |
379 | 379 | { |
380 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
380 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
381 | 381 | |
382 | 382 | switch ($charset) |
383 | 383 | { |
384 | 384 | case 'iso88591': |
385 | 385 | return $this->xml_iso88591_Entities; |
386 | 386 | default: |
387 | - throw new ValueErrorException('Unsupported charset: ' . $charset); |
|
387 | + throw new ValueErrorException('Unsupported charset: '.$charset); |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | } |
@@ -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 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | if (isset($_GET['run'])) { |
5 | 5 | $path = parse_url($_GET['run']); |
6 | 6 | if (isset($path['query'])) { |
7 | - $query = '?' . $path['query']; |
|
7 | + $query = '?'.$path['query']; |
|
8 | 8 | } |
9 | 9 | } |
10 | 10 |
@@ -13,7 +13,12 @@ |
||
13 | 13 | <html lang="en"> |
14 | 14 | <head> |
15 | 15 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
16 | - <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
16 | + <title><?php if (defined('DEFAULT_WSTYPE') && DEFAULT_WSTYPE == 1) { |
|
17 | + echo 'JSON-RPC'; |
|
18 | +} else { |
|
19 | + echo 'XML-RPC'; |
|
20 | +} |
|
21 | +?> Debugger</title> |
|
17 | 22 | </head> |
18 | 23 | <frameset rows="360,*"> |
19 | 24 | <frame name="frmcontroller" src="controller.php<?php echo htmlspecialchars($query); ?>" marginwidth="0" |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @license code licensed under the BSD License: see file license.txt |
7 | 7 | **/ |
8 | 8 | |
9 | -$coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
9 | +$coverageFile = realpath(__DIR__."/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
10 | 10 | |
11 | 11 | // has to be the same value as used in index.php |
12 | 12 | $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage'; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/_prepend.php"; |
|
2 | +require_once __DIR__."/_prepend.php"; |
|
3 | 3 | |
4 | 4 | output('<html lang="en"> |
5 | 5 | <head><title>phpxmlrpc - Which toolkit demo</title></head> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | <methodName>interopEchoTests.whichToolkit</methodName> |
20 | 20 | <params/> |
21 | 21 | </methodCall>'; |
22 | -output("XML custom request:<br/><pre>" . htmlspecialchars($payload) . "</pre>\n"); |
|
22 | +output("XML custom request:<br/><pre>".htmlspecialchars($payload)."</pre>\n"); |
|
23 | 23 | |
24 | 24 | $client = new Client(XMLRPCSERVER); |
25 | 25 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if (!$resp->faultCode()) { |
41 | 41 | |
42 | 42 | $xml = $resp->value(); |
43 | - output("XML response:<br/><pre>" . htmlspecialchars($xml) . "</pre>\n"); |
|
43 | + output("XML response:<br/><pre>".htmlspecialchars($xml)."</pre>\n"); |
|
44 | 44 | |
45 | 45 | $encoder = new Encoder(); |
46 | 46 | // from xml to xml-rpc Response |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | |
53 | 53 | output("Toolkit info:<br/>\n"); |
54 | 54 | output("<pre>"); |
55 | - output("name: " . htmlspecialchars($value["toolkitName"]) . "\n"); |
|
56 | - output("version: " . htmlspecialchars($value["toolkitVersion"]) . "\n"); |
|
57 | - output("docs: " . htmlspecialchars($value["toolkitDocsUrl"]) . "\n"); |
|
58 | - output("os: " . htmlspecialchars($value["toolkitOperatingSystem"]) . "\n"); |
|
55 | + output("name: ".htmlspecialchars($value["toolkitName"])."\n"); |
|
56 | + output("version: ".htmlspecialchars($value["toolkitVersion"])."\n"); |
|
57 | + output("docs: ".htmlspecialchars($value["toolkitDocsUrl"])."\n"); |
|
58 | + output("os: ".htmlspecialchars($value["toolkitOperatingSystem"])."\n"); |
|
59 | 59 | output("</pre>"); |
60 | 60 | } else { |
61 | 61 | output("An error occurred: "); |
62 | - output("Code: " . htmlspecialchars($resp->faultCode()) . " Reason: '" . htmlspecialchars($resp->faultString()) . "'\n"); |
|
62 | + output("Code: ".htmlspecialchars($resp->faultCode())." Reason: '".htmlspecialchars($resp->faultString())."'\n"); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | output("</body></html>\n"); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/_prepend.php"; |
|
2 | +require_once __DIR__."/_prepend.php"; |
|
3 | 3 | |
4 | 4 | output('<html lang="en"> |
5 | 5 | <head><title>phpxmlrpc - Proxy demo</title></head> |