@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // assume this is either a standalone install, or installed as Composer dependency |
| 21 | 21 | /// @todo if the latter is true, should we just not skip using the custom Autoloader, and let a top-level |
| 22 | 22 | /// debugger include this one, taking care of autoloading? |
| 23 | - include_once __DIR__ . "/../src/Autoloader.php"; |
|
| 23 | + include_once __DIR__."/../src/Autoloader.php"; |
|
| 24 | 24 | PhpXmlRpc\Autoloader::register(); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // Variables that shouldn't be unset |
| 37 | - $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); |
|
| 37 | + $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); |
|
| 38 | 38 | |
| 39 | 39 | $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, |
| 40 | 40 | isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array() |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | $wstype = defined('DEFAULT_WSTYPE') ? DEFAULT_WSTYPE : 0; |
| 87 | 87 | $id = ''; |
| 88 | 88 | if (isset($_GET['action'])) { |
| 89 | - if (isset($_GET['wstype']) && ($_GET['wstype'] == '2' || $_GET['wstype'] == '1' || $_GET['wstype'] == '0')) { |
|
| 90 | - $wstype = (int)$_GET['wstype']; |
|
| 89 | + if (isset($_GET['wstype']) && ($_GET['wstype'] == '2' || $_GET['wstype'] == '1' || $_GET['wstype'] == '0')) { |
|
| 90 | + $wstype = (int) $_GET['wstype']; |
|
| 91 | 91 | if ($wstype === 1 || $wstype === 2) { |
| 92 | 92 | if (!$hasjsonrpcclient) { |
| 93 | 93 | $wstype = 0; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $host = isset($_GET['host']) ? $_GET['host'] : 'localhost'; // using '' will trigger an xml-rpc error... |
| 103 | 103 | if (isset($_GET['protocol']) && ($_GET['protocol'] == '1' || $_GET['protocol'] == '2' || $_GET['protocol'] == '3' |
| 104 | 104 | || $_GET['protocol'] == '4')) { |
| 105 | - $protocol = (int)$_GET['protocol']; |
|
| 105 | + $protocol = (int) $_GET['protocol']; |
|
| 106 | 106 | } |
| 107 | 107 | if (strpos($host, 'http://') === 0) { |
| 108 | 108 | // NB: if protocol is https or h2, it will override http:// |
@@ -114,18 +114,18 @@ discard block |
||
| 114 | 114 | $protocol = 2; |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | - $port = isset($_GET['port']) ? (int)$_GET['port'] : ''; |
|
| 117 | + $port = isset($_GET['port']) ? (int) $_GET['port'] : ''; |
|
| 118 | 118 | if ($port === 0) { |
| 119 | 119 | $port = ''; |
| 120 | 120 | } |
| 121 | 121 | $path = isset($_GET['path']) ? $_GET['path'] : ''; |
| 122 | 122 | // in case user forgot initial '/' in xml-rpc server path, add it back |
| 123 | 123 | if ($path && ($path[0]) != '/') { |
| 124 | - $path = '/' . $path; |
|
| 124 | + $path = '/'.$path; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (isset($_GET['debug']) && ($_GET['debug'] == '1' || $_GET['debug'] == '2')) { |
| 128 | - $debug = (int)$_GET['debug']; |
|
| 128 | + $debug = (int) $_GET['debug']; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $verifyhost = (isset($_GET['verifyhost']) && ($_GET['verifyhost'] == '1' || $_GET['verifyhost'] == '2')) ? $_GET['verifyhost'] : 0; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | /// @todo what about an https proxy? |
| 143 | 143 | $proxyuser = isset($_GET['proxyuser']) ? $_GET['proxyuser'] : ''; |
| 144 | 144 | $proxypwd = isset($_GET['proxypwd']) ? $_GET['proxypwd'] : ''; |
| 145 | - $timeout = isset($_GET['timeout']) ? (int)$_GET['timeout'] : 0; |
|
| 145 | + $timeout = isset($_GET['timeout']) ? (int) $_GET['timeout'] : 0; |
|
| 146 | 146 | $action = $_GET['action']; |
| 147 | 147 | |
| 148 | 148 | $method = isset($_GET['method']) ? $_GET['method'] : ''; |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | $username = isset($_GET['username']) ? $_GET['username'] : ''; |
| 158 | 158 | $password = isset($_GET['password']) ? $_GET['password'] : ''; |
| 159 | 159 | |
| 160 | - $authtype = (isset($_GET['authtype']) && ($_GET['authtype'] == '2' || $_GET['authtype'] == '8')) ? (int)$_GET['authtype'] : 1; |
|
| 160 | + $authtype = (isset($_GET['authtype']) && ($_GET['authtype'] == '2' || $_GET['authtype'] == '8')) ? (int) $_GET['authtype'] : 1; |
|
| 161 | 161 | |
| 162 | 162 | if (isset($_GET['requestcompression']) && ($_GET['requestcompression'] == '1' || $_GET['requestcompression'] == '2')) { |
| 163 | - (int)$requestcompression = $_GET['requestcompression']; |
|
| 163 | + (int) $requestcompression = $_GET['requestcompression']; |
|
| 164 | 164 | } else { |
| 165 | 165 | $requestcompression = 0; |
| 166 | 166 | } |
| 167 | 167 | if (isset($_GET['responsecompression']) && ($_GET['responsecompression'] == '1' || $_GET['responsecompression'] == '2' || $_GET['responsecompression'] == '3')) { |
| 168 | - $responsecompression = (int)$_GET['responsecompression']; |
|
| 168 | + $responsecompression = (int) $_GET['responsecompression']; |
|
| 169 | 169 | } else { |
| 170 | 170 | $responsecompression = 0; |
| 171 | 171 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/LoggerAwareTestCase.php'; |
|
| 3 | +include_once __DIR__.'/LoggerAwareTestCase.php'; |
|
| 4 | 4 | |
| 5 | 5 | use PhpXmlRpc\Encoder; |
| 6 | 6 | use PhpXmlRpc\Request; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | /// @todo it seems that old php versions can not automatically transform latin to utf8 upon xml parsing. |
| 79 | 79 | /// We should fix that, then re-enable this test |
| 80 | 80 | if (version_compare(PHP_VERSION, '5.6.0', '>=')) { |
| 81 | - $i = $e->decodeXml('<?xml version="1.0" encoding="ISO-8859-15" ?><value><string>' . $string . '</string></value>'); |
|
| 81 | + $i = $e->decodeXml('<?xml version="1.0" encoding="ISO-8859-15" ?><value><string>'.$string.'</string></value>'); |
|
| 82 | 82 | $this->assertEquals($string, $i->scalarVal()); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/LoggerAwareTestCase.php'; |
|
| 3 | +include_once __DIR__.'/LoggerAwareTestCase.php'; |
|
| 4 | 4 | |
| 5 | 5 | use \PhpXmlRpc\Request; |
| 6 | 6 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | public function testI8() |
| 105 | 105 | { |
| 106 | - if (PHP_INT_SIZE == 4 ) { |
|
| 106 | + if (PHP_INT_SIZE == 4) { |
|
| 107 | 107 | $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode'); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | public function testUnicodeInMemberName() |
| 179 | 179 | { |
| 180 | - $str = "G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
| 180 | + $str = "G".chr(252)."nter, El".chr(232)."ne"; |
|
| 181 | 181 | $v = array($str => new xmlrpcval(1)); |
| 182 | 182 | $r = new xmlrpcresp(new xmlrpcval($v, 'struct')); |
| 183 | 183 | $r = $r->serialize(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $response = @utf8_encode( |
| 194 | 194 | '<?xml version="1.0"?> |
| 195 | 195 | <!-- covers what happens when lib receives UTF8 chars in response text and comments --> |
| 196 | -<!-- ' . chr(224) . chr(252) . chr(232) . 'àüè --> |
|
| 196 | +<!-- ' . chr(224).chr(252).chr(232).'àüè --> |
|
| 197 | 197 | <methodResponse> |
| 198 | 198 | <fault> |
| 199 | 199 | <value> |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | </member> |
| 205 | 205 | <member> |
| 206 | 206 | <name>faultString</name> |
| 207 | -<value><string>' . chr(224) . chr(252) . chr(232) . 'àüè</string></value> |
|
| 207 | +<value><string>' . chr(224).chr(252).chr(232).'àüè</string></value> |
|
| 208 | 208 | </member> |
| 209 | 209 | </struct> |
| 210 | 210 | </value> |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $m = $this->newRequest('dummy'); |
| 214 | 214 | $r = $m->parseResponse($response); |
| 215 | 215 | $v = $r->faultString(); |
| 216 | - $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); |
|
| 216 | + $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | public function testBrokenRequests() |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | $i = \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values; |
| 471 | 471 | \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values = true; |
| 472 | 472 | |
| 473 | - foreach($values as $value) { |
|
| 474 | - $f = '<?xml version="1.0"?><methodResponse><params><param><value>' . $value . '</value></param></params></methodResponse> '; |
|
| 473 | + foreach ($values as $value) { |
|
| 474 | + $f = '<?xml version="1.0"?><methodResponse><params><param><value>'.$value.'</value></param></params></methodResponse> '; |
|
| 475 | 475 | $r = $s->parseResponse($f); |
| 476 | 476 | $v = $r->faultCode(); |
| 477 | 477 | $this->assertEquals(2, $v, "Testing $value"); |
@@ -576,11 +576,11 @@ discard block |
||
| 576 | 576 | |
| 577 | 577 | public function testUTF8Response() |
| 578 | 578 | { |
| 579 | - $string = chr(224) . chr(252) . chr(232); |
|
| 579 | + $string = chr(224).chr(252).chr(232); |
|
| 580 | 580 | |
| 581 | 581 | $s = $this->newRequest('dummy'); |
| 582 | - $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> |
|
| 583 | -<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> |
|
| 582 | + $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> |
|
| 583 | +<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> |
|
| 584 | 584 | '; |
| 585 | 585 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 586 | 586 | $v = $r->value(); |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | $this->assertEquals($string, $v); |
| 589 | 589 | |
| 590 | 590 | $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
| 591 | -<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> |
|
| 591 | +<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> |
|
| 592 | 592 | '; |
| 593 | 593 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 594 | 594 | $v = $r->value(); |
@@ -604,11 +604,11 @@ discard block |
||
| 604 | 604 | |
| 605 | 605 | public function testLatin1Response() |
| 606 | 606 | { |
| 607 | - $string = chr(224) . chr(252) . chr(232); |
|
| 607 | + $string = chr(224).chr(252).chr(232); |
|
| 608 | 608 | |
| 609 | 609 | $s = $this->newRequest('dummy'); |
| 610 | - $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> |
|
| 611 | -<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> |
|
| 610 | + $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> |
|
| 611 | +<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> |
|
| 612 | 612 | '; |
| 613 | 613 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 614 | 614 | $v = $r->value(); |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | $this->assertEquals($string, $v); |
| 617 | 617 | |
| 618 | 618 | $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member> |
| 619 | -<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> |
|
| 619 | +<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> |
|
| 620 | 620 | '; |
| 621 | 621 | $r = $s->parseResponse($f, false, 'phpvals'); |
| 622 | 622 | $v = $r->value(); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/ServerAwareTestCase.php'; |
|
| 3 | +include_once __DIR__.'/ServerAwareTestCase.php'; |
|
| 4 | 4 | |
| 5 | 5 | use PhpXmlRpc\Client; |
| 6 | 6 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->client->server .= 'XXX'; |
| 65 | 65 | $dnsinfo = @dns_get_record($this->client->server); |
| 66 | 66 | if ($dnsinfo) { |
| 67 | - $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found'); |
|
| 67 | + $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found'); |
|
| 68 | 68 | } else { |
| 69 | 69 | $m = new xmlrpcmsg('examples.echo', array( |
| 70 | 70 | new xmlrpcval('hello', 'string'), |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | // now test a successful connection |
| 95 | 95 | $server = explode(':', $this->args['HTTPSERVER']); |
| 96 | - if (count($server) > 1) { |
|
| 96 | + if (count($server)>1) { |
|
| 97 | 97 | $this->client->port = $server[1]; |
| 98 | 98 | } |
| 99 | 99 | $this->client->server = $server[0]; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/LoggerAwareTestCase.php'; |
|
| 3 | +include_once __DIR__.'/LoggerAwareTestCase.php'; |
|
| 4 | 4 | |
| 5 | 5 | use PhpXmlRpc\Encoder; |
| 6 | 6 | use PhpXmlRpc\Helper\XMLParser; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | if (version_compare(PHP_VERSION, '8.0', '>=')) { |
| 144 | 144 | $str = sprintf("%f", $v->scalarval()); |
| 145 | 145 | } else { |
| 146 | - $str = (string)$v->scalarval(); |
|
| 146 | + $str = (string) $v->scalarval(); |
|
| 147 | 147 | } |
| 148 | 148 | if (strpos($str, ',') == 1) { |
| 149 | 149 | $r = $v->serialize(); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $this->assertequals(1, count($v1)); |
| 165 | 165 | $out = array('me' => array(), 'mytype' => 2, '_php_class' => null); |
| 166 | 166 | |
| 167 | - foreach($v1 as $key => $val) |
|
| 167 | + foreach ($v1 as $key => $val) |
|
| 168 | 168 | { |
| 169 | 169 | $this->assertArrayHasKey($key, $out); |
| 170 | 170 | $expected = $out[$key]; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $this->assertequals(2, count($v2)); |
| 180 | 180 | $out = array(array('key' => 0, 'value' => 'object'), array('key' => 1, 'value' => 'object')); |
| 181 | 181 | $i = 0; |
| 182 | - foreach($v2 as $key => $val) |
|
| 182 | + foreach ($v2 as $key => $val) |
|
| 183 | 183 | { |
| 184 | 184 | $expected = $out[$i]; |
| 185 | 185 | $this->assertequals($expected['key'], $key); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | { |
| 207 | 207 | // nb: make sure that the serialized xml corresponding to this is > 10MB in size |
| 208 | 208 | $data = array(); |
| 209 | - for ($i = 0; $i < 500000; $i++ ) { |
|
| 209 | + for ($i = 0; $i<500000; $i++) { |
|
| 210 | 210 | $data[] = 'hello world'; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__ . '/LoggerAwareTestCase.php'; |
|
| 3 | +include_once __DIR__.'/LoggerAwareTestCase.php'; |
|
| 4 | 4 | |
| 5 | 5 | use PhpXmlRpc\Response; |
| 6 | 6 | |