@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/08ServerTest.php'; |
|
3 | +include_once __DIR__.'/08ServerTest.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests which stress http features of the library. |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | $methods = array(); |
30 | 30 | // as long as we are descendants, get_class_methods will list private/protected methods |
31 | - foreach(get_class_methods('ServerTest') as $method) |
|
31 | + foreach (get_class_methods('ServerTest') as $method) |
|
32 | 32 | { |
33 | 33 | if (strpos($method, 'test') === 0 && !in_array($method, $this->unsafeMethods)) |
34 | 34 | { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0) |
298 | 298 | { |
299 | 299 | $version = explode('.', PHP_VERSION); |
300 | - $this->client->setSSLVersion(min(4 + $version[1], 7)); |
|
300 | + $this->client->setSSLVersion(min(4+$version[1], 7)); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | $this->$method(); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | preg_match('/ubunutu([0-9]+)/', $output[0], $matches); |
331 | 331 | $ubuntuVersion = @$matches[1]; |
332 | 332 | } |
333 | - if ($ubuntuVersion >= 20 && $this->args['SSLVERSION'] != 6) { |
|
333 | + if ($ubuntuVersion>=20 && $this->args['SSLVERSION'] != 6) { |
|
334 | 334 | $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher'); |
335 | 335 | return; |
336 | 336 | } |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_SOCKET_OPTS, |
354 | 354 | array('ssl' => array( |
355 | 355 | // security level is available as of php 7.2.0 + openssl 1.1.0 according to the docs |
356 | - 'security_level' => min(2 + $version[1], 5), |
|
356 | + 'security_level' => min(2+$version[1], 5), |
|
357 | 357 | 'capture_session_meta' => true, |
358 | 358 | )) |
359 | 359 | ); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | /// does not work well with TLS < 1.2. |
362 | 362 | /// @todo push this IF to the test matrix config, leave here only the setting of security_level? |
363 | 363 | if ($this->args['SSLVERSION'] == 0) { |
364 | - $this->client->setSSLVersion(min(5 + $version[1], 7)); |
|
364 | + $this->client->setSSLVersion(min(5+$version[1], 7)); |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | $this->$method(); |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0) |
403 | 403 | { |
404 | 404 | $version = explode('.', PHP_VERSION); |
405 | - $this->client->setSSLVersion(min(4 + $version[1], 7)); |
|
405 | + $this->client->setSSLVersion(min(4+$version[1], 7)); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | $this->$method(); |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | // this checks for a non-failed call |
619 | 619 | $time = microtime(true); |
620 | 620 | $this->send($m); |
621 | - $time = microtime(true) - $time; |
|
621 | + $time = microtime(true)-$time; |
|
622 | 622 | $this->assertGreaterThan(1.0, $time); |
623 | 623 | $this->assertLessThan(2.0, $time); |
624 | 624 | |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $m = new xmlrpcmsg('tests.sleep', array(new xmlrpcval(5, 'int'))); |
627 | 627 | $time = microtime(true); |
628 | 628 | $r = $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail'])); |
629 | - $time = microtime(true) - $time; |
|
629 | + $time = microtime(true)-$time; |
|
630 | 630 | $this->assertGreaterThan(2.0, $time); |
631 | 631 | $this->assertLessThan(4.0, $time); |
632 | 632 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | $this->addQueryParams(array('SLOW_LORIS' => 1)); |
647 | 647 | $time = microtime(true); |
648 | 648 | $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail'])); |
649 | - $time = microtime(true) - $time; |
|
649 | + $time = microtime(true)-$time; |
|
650 | 650 | $this->assertGreaterThan(2.0, $time); |
651 | 651 | $this->assertLessThan(4.0, $time); |
652 | 652 | } |
@@ -337,10 +337,10 @@ discard block |
||
337 | 337 | $server = $parts['host']; |
338 | 338 | $path = isset($parts['path']) ? $parts['path'] : ''; |
339 | 339 | if (isset($parts['query'])) { |
340 | - $path .= '?' . $parts['query']; |
|
340 | + $path .= '?'.$parts['query']; |
|
341 | 341 | } |
342 | 342 | if (isset($parts['fragment'])) { |
343 | - $path .= '#' . $parts['fragment']; |
|
343 | + $path .= '#'.$parts['fragment']; |
|
344 | 344 | } |
345 | 345 | if (isset($parts['port'])) { |
346 | 346 | $port = $parts['port']; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | } |
358 | 358 | if ($path == '' || $path[0] != '/') { |
359 | - $this->path = '/' . $path; |
|
359 | + $this->path = '/'.$path; |
|
360 | 360 | } else { |
361 | 361 | $this->path = $path; |
362 | 362 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | //$this->accepted_charset_encodings = $ch->knownCharsets(); |
389 | 389 | |
390 | 390 | // initialize user_agent string |
391 | - $this->user_agent = PhpXmlRpc::$xmlrpcName . ' ' . PhpXmlRpc::$xmlrpcVersion; |
|
391 | + $this->user_agent = PhpXmlRpc::$xmlrpcName.' '.PhpXmlRpc::$xmlrpcVersion; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | */ |
561 | 561 | public function setSSLVerifyPeer($i) |
562 | 562 | { |
563 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
563 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
564 | 564 | |
565 | 565 | $this->verifypeer = $i; |
566 | 566 | return $this; |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | public function setSSLVerifyHost($i) |
579 | 579 | { |
580 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
580 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
581 | 581 | |
582 | 582 | $this->verifyhost = $i; |
583 | 583 | return $this; |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | */ |
594 | 594 | public function setSSLVersion($i) |
595 | 595 | { |
596 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
596 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
597 | 597 | |
598 | 598 | $this->sslversion = $i; |
599 | 599 | return $this; |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | */ |
659 | 659 | public function setRequestCompression($compMethod) |
660 | 660 | { |
661 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
661 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
662 | 662 | |
663 | 663 | $this->request_compression = $compMethod; |
664 | 664 | return $this; |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | */ |
709 | 709 | public function setCurlOptions($options) |
710 | 710 | { |
711 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
711 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
712 | 712 | |
713 | 713 | $this->extracurlopts = $options; |
714 | 714 | return $this; |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | */ |
722 | 722 | public function setUseCurl($useCurlMode) |
723 | 723 | { |
724 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
724 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
725 | 725 | |
726 | 726 | $this->use_curl = $useCurlMode; |
727 | 727 | return $this; |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | */ |
740 | 740 | public function setUserAgent($agentString) |
741 | 741 | { |
742 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
742 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
743 | 743 | |
744 | 744 | $this->user_agent = $agentString; |
745 | 745 | return $this; |
@@ -771,12 +771,12 @@ discard block |
||
771 | 771 | } |
772 | 772 | } |
773 | 773 | |
774 | - $url = $this->method . '://' . $this->server; |
|
774 | + $url = $this->method.'://'.$this->server; |
|
775 | 775 | if ($this->port == 0 || ($this->port == 80 && in_array($this->method, array('http', 'http10', 'http11', 'h2c'))) || |
776 | 776 | ($this->port == 443 && in_array($this->method, array('https', 'h2')))) { |
777 | - return $url . $this->path; |
|
777 | + return $url.$this->path; |
|
778 | 778 | } else { |
779 | - return $url . ':' . $this->port . $this->path; |
|
779 | + return $url.':'.$this->port.$this->path; |
|
780 | 780 | } |
781 | 781 | } |
782 | 782 | |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | public function send($req, $timeout = 0, $method = '') |
820 | 820 | { |
821 | 821 | if ($method !== '' || $timeout !== 0) { |
822 | - $this->logDeprecation("Using non-default values for arguments 'method' and 'timeout' when calling method " . __METHOD__ . ' is deprecated'); |
|
822 | + $this->logDeprecation("Using non-default values for arguments 'method' and 'timeout' when calling method ".__METHOD__.' is deprecated'); |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | // if user does not specify http protocol, use native method of this client |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | $payload = $a; |
939 | 939 | $encodingHdr = "Content-Encoding: gzip\r\n"; |
940 | 940 | } else { |
941 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzencode failure in compressing request'); |
|
941 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzencode failure in compressing request'); |
|
942 | 942 | } |
943 | 943 | } else if (function_exists('gzcompress')) { |
944 | 944 | $a = @gzcompress($payload); |
@@ -946,14 +946,14 @@ discard block |
||
946 | 946 | $payload = $a; |
947 | 947 | $encodingHdr = "Content-Encoding: deflate\r\n"; |
948 | 948 | } else { |
949 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzcompress failure in compressing request'); |
|
949 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzcompress failure in compressing request'); |
|
950 | 950 | } |
951 | 951 | } else { |
952 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported by this PHP install'); |
|
952 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported by this PHP install'); |
|
953 | 953 | } |
954 | 954 | } else { |
955 | 955 | if ($opts['request_compression'] != '') { |
956 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported'); |
|
956 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported'); |
|
957 | 957 | } |
958 | 958 | } |
959 | 959 | |
@@ -961,16 +961,16 @@ discard block |
||
961 | 961 | $credentials = ''; |
962 | 962 | if ($opts['username'] != '') { |
963 | 963 | if ($opts['authtype'] != 1) { |
964 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported with HTTP 1.0'); |
|
964 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported with HTTP 1.0'); |
|
965 | 965 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
966 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': only Basic auth is supported with HTTP 1.0'); |
|
966 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': only Basic auth is supported with HTTP 1.0'); |
|
967 | 967 | } |
968 | - $credentials = 'Authorization: Basic ' . base64_encode($opts['username'] . ':' . $opts['password']) . "\r\n"; |
|
968 | + $credentials = 'Authorization: Basic '.base64_encode($opts['username'].':'.$opts['password'])."\r\n"; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | $acceptedEncoding = ''; |
972 | 972 | if (is_array($opts['accepted_compression']) && count($opts['accepted_compression'])) { |
973 | - $acceptedEncoding = 'Accept-Encoding: ' . implode(', ', $opts['accepted_compression']) . "\r\n"; |
|
973 | + $acceptedEncoding = 'Accept-Encoding: '.implode(', ', $opts['accepted_compression'])."\r\n"; |
|
974 | 974 | } |
975 | 975 | |
976 | 976 | if ($port == 0) { |
@@ -991,21 +991,21 @@ discard block |
||
991 | 991 | } elseif ($method === 'h2') { |
992 | 992 | $protocol = 'https'; |
993 | 993 | } else if (strpos($protocol, ':') !== false) { |
994 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": warning - attempted hacking attempt?. The protocol requested for the call is: '$protocol'"); |
|
995 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], PhpXmlRpc::$xmlrpcerr['unsupported_option'] . |
|
994 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": warning - attempted hacking attempt?. The protocol requested for the call is: '$protocol'"); |
|
995 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], PhpXmlRpc::$xmlrpcerr['unsupported_option']. |
|
996 | 996 | " attempted hacking attempt?. The protocol requested for the call is: '$protocol'"); |
997 | 997 | } |
998 | 998 | /// @todo this does not work atm (tested at least with an http proxy forwarding to an https server) - we |
999 | 999 | /// should implement the CONNECT protocol |
1000 | - $uri = $protocol . '://' . $server . ':' . $port . $path; |
|
1000 | + $uri = $protocol.'://'.$server.':'.$port.$path; |
|
1001 | 1001 | if ($opts['proxy_user'] != '') { |
1002 | 1002 | if ($opts['proxy_authtype'] != 1) { |
1003 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported with HTTP 1.0'); |
|
1003 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported with HTTP 1.0'); |
|
1004 | 1004 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1005 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': only Basic auth to proxy is supported with socket transport'); |
|
1005 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': only Basic auth to proxy is supported with socket transport'); |
|
1006 | 1006 | } |
1007 | - $proxyCredentials = 'Proxy-Authorization: Basic ' . base64_encode($opts['proxy_user'] . ':' . |
|
1008 | - $opts['proxy_pass']) . "\r\n"; |
|
1007 | + $proxyCredentials = 'Proxy-Authorization: Basic '.base64_encode($opts['proxy_user'].':'. |
|
1008 | + $opts['proxy_pass'])."\r\n"; |
|
1009 | 1009 | } |
1010 | 1010 | } else { |
1011 | 1011 | $connectServer = $server; |
@@ -1022,14 +1022,14 @@ discard block |
||
1022 | 1022 | $version = ''; |
1023 | 1023 | foreach ($opts['cookies'] as $name => $cookie) { |
1024 | 1024 | /// @todo should we sanitize the cookie value on behalf of the user? See setCookie comments |
1025 | - $cookieHeader .= ' ' . $name . '=' . $cookie['value'] . ";"; |
|
1025 | + $cookieHeader .= ' '.$name.'='.$cookie['value'].";"; |
|
1026 | 1026 | } |
1027 | - $cookieHeader = 'Cookie:' . $version . substr($cookieHeader, 0, -1) . "\r\n"; |
|
1027 | + $cookieHeader = 'Cookie:'.$version.substr($cookieHeader, 0, -1)."\r\n"; |
|
1028 | 1028 | } |
1029 | 1029 | |
1030 | 1030 | $extraHeaders = ''; |
1031 | 1031 | if (is_array($this->extra_headers) && $this->extra_headers) { |
1032 | - $extraHeaders = implode("\r\n", $this->extra_headers) . "\r\n"; |
|
1032 | + $extraHeaders = implode("\r\n", $this->extra_headers)."\r\n"; |
|
1033 | 1033 | } |
1034 | 1034 | |
1035 | 1035 | // omit port if default |
@@ -1037,24 +1037,24 @@ discard block |
||
1037 | 1037 | if (($port == 80 && in_array($method, array('http', 'http10', 'http11'))) || ($port == 443 && $method == 'https')) { |
1038 | 1038 | $port = ''; |
1039 | 1039 | } else { |
1040 | - $port = ':' . $port; |
|
1041 | - } |
|
1042 | - |
|
1043 | - $op = 'POST ' . $uri . " HTTP/1.0\r\n" . |
|
1044 | - 'User-Agent: ' . $opts['user_agent'] . "\r\n" . |
|
1045 | - 'Host: ' . $server . $port . "\r\n" . |
|
1046 | - $credentials . |
|
1047 | - $proxyCredentials . |
|
1048 | - $acceptedEncoding . |
|
1049 | - $encodingHdr . |
|
1050 | - 'Accept-Charset: ' . implode(',', $opts['accepted_charset_encodings']) . "\r\n" . |
|
1051 | - $cookieHeader . |
|
1052 | - 'Content-Type: ' . $req->getContentType() . "\r\n" . |
|
1053 | - $extraHeaders . |
|
1054 | - 'Content-Length: ' . strlen($payload) . "\r\n\r\n" . |
|
1040 | + $port = ':'.$port; |
|
1041 | + } |
|
1042 | + |
|
1043 | + $op = 'POST '.$uri." HTTP/1.0\r\n". |
|
1044 | + 'User-Agent: '.$opts['user_agent']."\r\n". |
|
1045 | + 'Host: '.$server.$port."\r\n". |
|
1046 | + $credentials. |
|
1047 | + $proxyCredentials. |
|
1048 | + $acceptedEncoding. |
|
1049 | + $encodingHdr. |
|
1050 | + 'Accept-Charset: '.implode(',', $opts['accepted_charset_encodings'])."\r\n". |
|
1051 | + $cookieHeader. |
|
1052 | + 'Content-Type: '.$req->getContentType()."\r\n". |
|
1053 | + $extraHeaders. |
|
1054 | + 'Content-Length: '.strlen($payload)."\r\n\r\n". |
|
1055 | 1055 | $payload; |
1056 | 1056 | |
1057 | - if ($opts['debug'] > 1) { |
|
1057 | + if ($opts['debug']>1) { |
|
1058 | 1058 | $this->getLogger()->debug("---SENDING---\n$op\n---END---"); |
1059 | 1059 | } |
1060 | 1060 | |
@@ -1080,7 +1080,7 @@ discard block |
||
1080 | 1080 | |
1081 | 1081 | if ($opts['sslversion'] != 0) { |
1082 | 1082 | /// @see https://www.php.net/manual/en/function.curl-setopt.php, https://www.php.net/manual/en/migration56.openssl.php |
1083 | - switch($opts['sslversion']) { |
|
1083 | + switch ($opts['sslversion']) { |
|
1084 | 1084 | /// @todo what does this map to? 1.0-1.3? |
1085 | 1085 | //case 1: // TLSv1 |
1086 | 1086 | // break; |
@@ -1104,12 +1104,12 @@ discard block |
||
1104 | 1104 | $contextOptions['ssl']['crypto_method'] = STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; |
1105 | 1105 | } else { |
1106 | 1106 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1107 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': TLS-1.3 only is supported with PHP 7.4 or later'); |
|
1107 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': TLS-1.3 only is supported with PHP 7.4 or later'); |
|
1108 | 1108 | } |
1109 | 1109 | break; |
1110 | 1110 | default: |
1111 | 1111 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1112 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': Unsupported required TLS version'); |
|
1112 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': Unsupported required TLS version'); |
|
1113 | 1113 | } |
1114 | 1114 | } |
1115 | 1115 | } |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | |
1123 | 1123 | $context = stream_context_create($contextOptions); |
1124 | 1124 | |
1125 | - if ($opts['timeout'] <= 0) { |
|
1125 | + if ($opts['timeout']<=0) { |
|
1126 | 1126 | $connectTimeout = ini_get('default_socket_timeout'); |
1127 | 1127 | } else { |
1128 | 1128 | $connectTimeout = $opts['timeout']; |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | $fp = @stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout, |
1142 | 1142 | STREAM_CLIENT_CONNECT, $context); |
1143 | 1143 | if ($fp) { |
1144 | - if ($opts['timeout'] > 0) { |
|
1144 | + if ($opts['timeout']>0) { |
|
1145 | 1145 | stream_set_timeout($fp, $opts['timeout'], 0); |
1146 | 1146 | } |
1147 | 1147 | } else { |
@@ -1150,8 +1150,8 @@ discard block |
||
1150 | 1150 | $this->errstr = $err['message']; |
1151 | 1151 | } |
1152 | 1152 | |
1153 | - $this->errstr = 'Connect error: ' . $this->errstr; |
|
1154 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')'); |
|
1153 | + $this->errstr = 'Connect error: '.$this->errstr; |
|
1154 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr.' ('.$this->errno.')'); |
|
1155 | 1155 | } |
1156 | 1156 | |
1157 | 1157 | if (!fputs($fp, $op, strlen($op))) { |
@@ -1231,19 +1231,19 @@ discard block |
||
1231 | 1231 | $opts['keepalive'], $opts['key'], $opts['keypass'], $opts['sslversion']); |
1232 | 1232 | |
1233 | 1233 | if (!$curl) { |
1234 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . |
|
1234 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail']. |
|
1235 | 1235 | ': error during curl initialization. Check php error log for details'); |
1236 | 1236 | } |
1237 | 1237 | |
1238 | 1238 | $result = curl_exec($curl); |
1239 | 1239 | |
1240 | - if ($opts['debug'] > 1) { |
|
1240 | + if ($opts['debug']>1) { |
|
1241 | 1241 | $message = "---CURL INFO---\n"; |
1242 | 1242 | foreach (curl_getinfo($curl) as $name => $val) { |
1243 | 1243 | if (is_array($val)) { |
1244 | 1244 | $val = implode("\n", $val); |
1245 | 1245 | } |
1246 | - $message .= $name . ': ' . $val . "\n"; |
|
1246 | + $message .= $name.': '.$val."\n"; |
|
1247 | 1247 | } |
1248 | 1248 | $message .= '---END---'; |
1249 | 1249 | $this->getLogger()->debug($message); |
@@ -1253,8 +1253,8 @@ discard block |
||
1253 | 1253 | /// @todo we should use a better check here - what if we get back '' or '0'? |
1254 | 1254 | |
1255 | 1255 | $this->errstr = 'no response'; |
1256 | - $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . |
|
1257 | - ': ' . curl_error($curl)); |
|
1256 | + $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail']. |
|
1257 | + ': '.curl_error($curl)); |
|
1258 | 1258 | curl_close($curl); |
1259 | 1259 | if ($opts['keepalive']) { |
1260 | 1260 | $this->xmlrpc_curl_handle = null; |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | $payload = $a; |
1313 | 1313 | $encodingHdr = 'Content-Encoding: gzip'; |
1314 | 1314 | } else { |
1315 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzencode failure in compressing request'); |
|
1315 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzencode failure in compressing request'); |
|
1316 | 1316 | } |
1317 | 1317 | } else if (function_exists('gzcompress')) { |
1318 | 1318 | $a = @gzcompress($payload); |
@@ -1320,14 +1320,14 @@ discard block |
||
1320 | 1320 | $payload = $a; |
1321 | 1321 | $encodingHdr = 'Content-Encoding: deflate'; |
1322 | 1322 | } else { |
1323 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzcompress failure in compressing request'); |
|
1323 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzcompress failure in compressing request'); |
|
1324 | 1324 | } |
1325 | 1325 | } else { |
1326 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported by this PHP install'); |
|
1326 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported by this PHP install'); |
|
1327 | 1327 | } |
1328 | 1328 | } else { |
1329 | 1329 | if ($opts['request_compression'] != '') { |
1330 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported'); |
|
1330 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported'); |
|
1331 | 1331 | } |
1332 | 1332 | } |
1333 | 1333 | |
@@ -1341,12 +1341,12 @@ discard block |
||
1341 | 1341 | // http, https |
1342 | 1342 | $protocol = $method; |
1343 | 1343 | if (strpos($protocol, ':') !== false) { |
1344 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'"); |
|
1344 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'"); |
|
1345 | 1345 | return false; |
1346 | 1346 | } |
1347 | 1347 | } |
1348 | 1348 | } |
1349 | - $curl = curl_init($protocol . '://' . $server . ':' . $port . $path); |
|
1349 | + $curl = curl_init($protocol.'://'.$server.':'.$port.$path); |
|
1350 | 1350 | if (!$curl) { |
1351 | 1351 | return false; |
1352 | 1352 | } |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | // results into variable |
1361 | 1361 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
1362 | 1362 | |
1363 | - if ($opts['debug'] > 1) { |
|
1363 | + if ($opts['debug']>1) { |
|
1364 | 1364 | curl_setopt($curl, CURLOPT_VERBOSE, true); |
1365 | 1365 | /// @todo redirect curlopt_stderr to some stream which can be piped to the logger |
1366 | 1366 | } |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | } |
1386 | 1386 | } |
1387 | 1387 | // extra headers |
1388 | - $headers = array('Content-Type: ' . $req->getContentType(), 'Accept-Charset: ' . implode(',', $opts['accepted_charset_encodings'])); |
|
1388 | + $headers = array('Content-Type: '.$req->getContentType(), 'Accept-Charset: '.implode(',', $opts['accepted_charset_encodings'])); |
|
1389 | 1389 | // if no keepalive is wanted, let the server know it in advance |
1390 | 1390 | if (!$opts['keepalive']) { |
1391 | 1391 | $headers[] = 'Connection: close'; |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | if (defined('CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE')) { |
1422 | 1422 | curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE); |
1423 | 1423 | } else { |
1424 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install'); |
|
1424 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. HTTP2 is not supported by the current PHP/curl install'); |
|
1425 | 1425 | curl_close($curl); |
1426 | 1426 | return false; |
1427 | 1427 | } |
@@ -1432,11 +1432,11 @@ discard block |
||
1432 | 1432 | } |
1433 | 1433 | |
1434 | 1434 | if ($opts['username'] && $opts['password']) { |
1435 | - curl_setopt($curl, CURLOPT_USERPWD, $opts['username'] . ':' . $opts['password']); |
|
1435 | + curl_setopt($curl, CURLOPT_USERPWD, $opts['username'].':'.$opts['password']); |
|
1436 | 1436 | if (defined('CURLOPT_HTTPAUTH')) { |
1437 | 1437 | curl_setopt($curl, CURLOPT_HTTPAUTH, $opts['authtype']); |
1438 | 1438 | } elseif ($opts['authtype'] != 1) { |
1439 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install'); |
|
1439 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported by the current PHP/curl install'); |
|
1440 | 1440 | curl_close($curl); |
1441 | 1441 | return false; |
1442 | 1442 | } |
@@ -1481,13 +1481,13 @@ discard block |
||
1481 | 1481 | if ($opts['proxyport'] == 0) { |
1482 | 1482 | $opts['proxyport'] = 8080; // NB: even for HTTPS, local connection is on port 8080 |
1483 | 1483 | } |
1484 | - curl_setopt($curl, CURLOPT_PROXY, $opts['proxy'] . ':' . $opts['proxyport']); |
|
1484 | + curl_setopt($curl, CURLOPT_PROXY, $opts['proxy'].':'.$opts['proxyport']); |
|
1485 | 1485 | if ($opts['proxy_user']) { |
1486 | - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $opts['proxy_user'] . ':' . $opts['proxy_pass']); |
|
1486 | + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $opts['proxy_user'].':'.$opts['proxy_pass']); |
|
1487 | 1487 | if (defined('CURLOPT_PROXYAUTH')) { |
1488 | 1488 | curl_setopt($curl, CURLOPT_PROXYAUTH, $opts['proxy_authtype']); |
1489 | 1489 | } elseif ($opts['proxy_authtype'] != 1) { |
1490 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
|
1490 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
|
1491 | 1491 | curl_close($curl); |
1492 | 1492 | return false; |
1493 | 1493 | } |
@@ -1499,7 +1499,7 @@ discard block |
||
1499 | 1499 | if (count($opts['cookies'])) { |
1500 | 1500 | $cookieHeader = ''; |
1501 | 1501 | foreach ($opts['cookies'] as $name => $cookie) { |
1502 | - $cookieHeader .= $name . '=' . $cookie['value'] . '; '; |
|
1502 | + $cookieHeader .= $name.'='.$cookie['value'].'; '; |
|
1503 | 1503 | } |
1504 | 1504 | curl_setopt($curl, CURLOPT_COOKIE, substr($cookieHeader, 0, -2)); |
1505 | 1505 | } |
@@ -1508,7 +1508,7 @@ discard block |
||
1508 | 1508 | curl_setopt($curl, $opt, $val); |
1509 | 1509 | } |
1510 | 1510 | |
1511 | - if ($opts['debug'] > 1) { |
|
1511 | + if ($opts['debug']>1) { |
|
1512 | 1512 | $this->getLogger()->debug("---SENDING---\n$payload\n---END---"); |
1513 | 1513 | } |
1514 | 1514 | |
@@ -1609,7 +1609,7 @@ discard block |
||
1609 | 1609 | $call['methodName'] = new Value($req->method(), 'string'); |
1610 | 1610 | $numParams = $req->getNumParams(); |
1611 | 1611 | $params = array(); |
1612 | - for ($i = 0; $i < $numParams; $i++) { |
|
1612 | + for ($i = 0; $i<$numParams; $i++) { |
|
1613 | 1613 | $params[$i] = $req->getParam($i); |
1614 | 1614 | } |
1615 | 1615 | $call['params'] = new Value($params, 'array'); |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | $response = array(); |
1632 | 1632 | |
1633 | 1633 | if ($this->return_type == 'xml') { |
1634 | - for ($i = 0; $i < count($reqs); $i++) { |
|
1634 | + for ($i = 0; $i<count($reqs); $i++) { |
|
1635 | 1635 | $response[] = new static::$responseClass($rets, 0, '', 'xml', $result->httpResponse()); |
1636 | 1636 | } |
1637 | 1637 | |
@@ -1639,21 +1639,21 @@ discard block |
||
1639 | 1639 | if (!is_array($rets)) { |
1640 | 1640 | // bad return type from system.multicall |
1641 | 1641 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1642 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': not an array', 'phpvals', $result->httpResponse()); |
|
1642 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': not an array', 'phpvals', $result->httpResponse()); |
|
1643 | 1643 | } |
1644 | 1644 | $numRets = count($rets); |
1645 | 1645 | if ($numRets != count($reqs)) { |
1646 | 1646 | // wrong number of return values. |
1647 | 1647 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1648 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'phpvals', |
|
1648 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'phpvals', |
|
1649 | 1649 | $result->httpResponse()); |
1650 | 1650 | } |
1651 | 1651 | |
1652 | - for ($i = 0; $i < $numRets; $i++) { |
|
1652 | + for ($i = 0; $i<$numRets; $i++) { |
|
1653 | 1653 | $val = $rets[$i]; |
1654 | 1654 | if (!is_array($val)) { |
1655 | 1655 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1656 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct", |
|
1656 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct", |
|
1657 | 1657 | 'phpvals', $result->httpResponse()); |
1658 | 1658 | } |
1659 | 1659 | switch (count($val)) { |
@@ -1661,7 +1661,7 @@ discard block |
||
1661 | 1661 | if (!isset($val[0])) { |
1662 | 1662 | // Bad value |
1663 | 1663 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1664 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has no value", |
|
1664 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has no value", |
|
1665 | 1665 | 'phpvals', $result->httpResponse()); |
1666 | 1666 | } |
1667 | 1667 | // Normal return value |
@@ -1673,20 +1673,20 @@ discard block |
||
1673 | 1673 | if (!is_int($code)) { |
1674 | 1674 | /// @todo should we check that it is != 0? |
1675 | 1675 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1676 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
1676 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
1677 | 1677 | 'phpvals', $result->httpResponse()); |
1678 | 1678 | } |
1679 | 1679 | $str = @$val['faultString']; |
1680 | 1680 | if (!is_string($str)) { |
1681 | 1681 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1682 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no FaultString", |
|
1682 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no FaultString", |
|
1683 | 1683 | 'phpvals', $result->httpResponse()); |
1684 | 1684 | } |
1685 | 1685 | $response[$i] = new static::$responseClass(0, $code, $str, 'phpvals', $result->httpResponse()); |
1686 | 1686 | break; |
1687 | 1687 | default: |
1688 | 1688 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1689 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
1689 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
1690 | 1690 | 'phpvals', $result->httpResponse()); |
1691 | 1691 | } |
1692 | 1692 | } |
@@ -1695,14 +1695,14 @@ discard block |
||
1695 | 1695 | // return type == 'xmlrpcvals' |
1696 | 1696 | if ($rets->kindOf() != 'array') { |
1697 | 1697 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1698 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array", 'xmlrpcvals', |
|
1698 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array", 'xmlrpcvals', |
|
1699 | 1699 | $result->httpResponse()); |
1700 | 1700 | } |
1701 | 1701 | $numRets = $rets->count(); |
1702 | 1702 | if ($numRets != count($reqs)) { |
1703 | 1703 | // wrong number of return values. |
1704 | 1704 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1705 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'xmlrpcvals', |
|
1705 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'xmlrpcvals', |
|
1706 | 1706 | $result->httpResponse()); |
1707 | 1707 | } |
1708 | 1708 | |
@@ -1711,7 +1711,7 @@ discard block |
||
1711 | 1711 | case 'array': |
1712 | 1712 | if ($val->count() != 1) { |
1713 | 1713 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1714 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
1714 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
1715 | 1715 | 'phpvals', $result->httpResponse()); |
1716 | 1716 | } |
1717 | 1717 | // Normal return value |
@@ -1720,28 +1720,28 @@ discard block |
||
1720 | 1720 | case 'struct': |
1721 | 1721 | if ($val->count() != 2) { |
1722 | 1722 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1723 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
1723 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
1724 | 1724 | 'phpvals', $result->httpResponse()); |
1725 | 1725 | } |
1726 | 1726 | /** @var Value $code */ |
1727 | 1727 | $code = $val['faultCode']; |
1728 | 1728 | if ($code->kindOf() != 'scalar' || $code->scalarTyp() != 'int') { |
1729 | 1729 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1730 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
1730 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
1731 | 1731 | 'xmlrpcvals', $result->httpResponse()); |
1732 | 1732 | } |
1733 | 1733 | /** @var Value $str */ |
1734 | 1734 | $str = $val['faultString']; |
1735 | 1735 | if ($str->kindOf() != 'scalar' || $str->scalarTyp() != 'string') { |
1736 | 1736 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1737 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
1737 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
1738 | 1738 | 'xmlrpcvals', $result->httpResponse()); |
1739 | 1739 | } |
1740 | 1740 | $response[] = new static::$responseClass(0, $code->scalarVal(), $str->scalarVal(), 'xmlrpcvals', $result->httpResponse()); |
1741 | 1741 | break; |
1742 | 1742 | default: |
1743 | 1743 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1744 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct", |
|
1744 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct", |
|
1745 | 1745 | 'xmlrpcvals', $result->httpResponse()); |
1746 | 1746 | } |
1747 | 1747 | } |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | $authType = 1, $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
1777 | 1777 | $method = 'http') |
1778 | 1778 | { |
1779 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
1779 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
1780 | 1780 | |
1781 | 1781 | return $this->sendPayloadSocket($req, $server, $port, $timeout, $username, $password, $authType, null, null, |
1782 | 1782 | null, null, $proxyHost, $proxyPort, $proxyUsername, $proxyPassword, $proxyAuthType, $method); |
@@ -1814,7 +1814,7 @@ discard block |
||
1814 | 1814 | $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $keepAlive = false, $key = '', $keyPass = '', |
1815 | 1815 | $sslVersion = 0) |
1816 | 1816 | { |
1817 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
1817 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
1818 | 1818 | |
1819 | 1819 | return $this->sendPayloadCURL($req, $server, $port, $timeout, $username, |
1820 | 1820 | $password, $authType, $cert, $certPass, $caCert, $caCertDir, $proxyHost, $proxyPort, |
@@ -2027,7 +2027,7 @@ discard block |
||
2027 | 2027 | public function &__get($name) |
2028 | 2028 | { |
2029 | 2029 | if (in_array($name, static::$options)) { |
2030 | - $this->logDeprecation('Getting property Client::' . $name . ' is deprecated'); |
|
2030 | + $this->logDeprecation('Getting property Client::'.$name.' is deprecated'); |
|
2031 | 2031 | return $this->$name; |
2032 | 2032 | } |
2033 | 2033 | |
@@ -2038,12 +2038,12 @@ discard block |
||
2038 | 2038 | case 'server': |
2039 | 2039 | case 'port': |
2040 | 2040 | case 'path': |
2041 | - $this->logDeprecation('Getting property Client::' . $name . ' is deprecated'); |
|
2041 | + $this->logDeprecation('Getting property Client::'.$name.' is deprecated'); |
|
2042 | 2042 | return $this->$name; |
2043 | 2043 | default: |
2044 | 2044 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
2045 | 2045 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
2046 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
2046 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
2047 | 2047 | $result = null; |
2048 | 2048 | return $result; |
2049 | 2049 | } |
@@ -2052,7 +2052,7 @@ discard block |
||
2052 | 2052 | public function __set($name, $value) |
2053 | 2053 | { |
2054 | 2054 | if (in_array($name, static::$options)) { |
2055 | - $this->logDeprecation('Setting property Client::' . $name . ' is deprecated'); |
|
2055 | + $this->logDeprecation('Setting property Client::'.$name.' is deprecated'); |
|
2056 | 2056 | $this->$name = $value; |
2057 | 2057 | return; |
2058 | 2058 | } |
@@ -2064,20 +2064,20 @@ discard block |
||
2064 | 2064 | case 'server': |
2065 | 2065 | case 'port': |
2066 | 2066 | case 'path': |
2067 | - $this->logDeprecation('Setting property Client::' . $name . ' is deprecated'); |
|
2067 | + $this->logDeprecation('Setting property Client::'.$name.' is deprecated'); |
|
2068 | 2068 | $this->$name = $value; |
2069 | 2069 | return; |
2070 | 2070 | default: |
2071 | 2071 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
2072 | 2072 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
2073 | - trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
2073 | + trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
2074 | 2074 | } |
2075 | 2075 | } |
2076 | 2076 | |
2077 | 2077 | public function __isset($name) |
2078 | 2078 | { |
2079 | 2079 | if (in_array($name, static::$options)) { |
2080 | - $this->logDeprecation('Checking property Client::' . $name . ' is deprecated'); |
|
2080 | + $this->logDeprecation('Checking property Client::'.$name.' is deprecated'); |
|
2081 | 2081 | return isset($this->$name); |
2082 | 2082 | } |
2083 | 2083 | |
@@ -2088,7 +2088,7 @@ discard block |
||
2088 | 2088 | case 'server': |
2089 | 2089 | case 'port': |
2090 | 2090 | case 'path': |
2091 | - $this->logDeprecation('Checking property Client::' . $name . ' is deprecated'); |
|
2091 | + $this->logDeprecation('Checking property Client::'.$name.' is deprecated'); |
|
2092 | 2092 | return isset($this->$name); |
2093 | 2093 | default: |
2094 | 2094 | return false; |
@@ -2098,7 +2098,7 @@ discard block |
||
2098 | 2098 | public function __unset($name) |
2099 | 2099 | { |
2100 | 2100 | if (in_array($name, static::$options)) { |
2101 | - $this->logDeprecation('Unsetting property Client::' . $name . ' is deprecated'); |
|
2101 | + $this->logDeprecation('Unsetting property Client::'.$name.' is deprecated'); |
|
2102 | 2102 | unset($this->$name); |
2103 | 2103 | return; |
2104 | 2104 | } |
@@ -2110,13 +2110,13 @@ discard block |
||
2110 | 2110 | case 'server': |
2111 | 2111 | case 'port': |
2112 | 2112 | case 'path': |
2113 | - $this->logDeprecation('Unsetting property Client::' . $name . ' is deprecated'); |
|
2113 | + $this->logDeprecation('Unsetting property Client::'.$name.' is deprecated'); |
|
2114 | 2114 | unset($this->$name); |
2115 | 2115 | return; |
2116 | 2116 | default: |
2117 | 2117 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
2118 | 2118 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
2119 | - trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
2119 | + trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
2120 | 2120 | } |
2121 | 2121 | } |
2122 | 2122 | } |