@@ -293,10 +293,10 @@ discard block |
||
| 293 | 293 | $server = $parts['host']; |
| 294 | 294 | $path = isset($parts['path']) ? $parts['path'] : ''; |
| 295 | 295 | if (isset($parts['query'])) { |
| 296 | - $path .= '?' . $parts['query']; |
|
| 296 | + $path .= '?'.$parts['query']; |
|
| 297 | 297 | } |
| 298 | 298 | if (isset($parts['fragment'])) { |
| 299 | - $path .= '#' . $parts['fragment']; |
|
| 299 | + $path .= '#'.$parts['fragment']; |
|
| 300 | 300 | } |
| 301 | 301 | if (isset($parts['port'])) { |
| 302 | 302 | $port = $parts['port']; |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | if ($path == '' || $path[0] != '/') { |
| 315 | - $this->path = '/' . $path; |
|
| 315 | + $this->path = '/'.$path; |
|
| 316 | 316 | } else { |
| 317 | 317 | $this->path = $path; |
| 318 | 318 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | //$this->accepted_charset_encodings = $ch->knownCharsets(); |
| 345 | 345 | |
| 346 | 346 | // initialize user_agent string |
| 347 | - $this->user_agent = PhpXmlRpc::$xmlrpcName . ' ' . PhpXmlRpc::$xmlrpcVersion; |
|
| 347 | + $this->user_agent = PhpXmlRpc::$xmlrpcName.' '.PhpXmlRpc::$xmlrpcVersion; |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
@@ -638,12 +638,12 @@ discard block |
||
| 638 | 638 | */ |
| 639 | 639 | public function getUrl() |
| 640 | 640 | { |
| 641 | - $url = $this->method . '://' . $this->server; |
|
| 641 | + $url = $this->method.'://'.$this->server; |
|
| 642 | 642 | if (($this->port = 80 && in_array($this->method, array('http', 'http10', 'http11', 'h2c'))) && |
| 643 | 643 | ($this->port = 443 && in_array($this->method, array('https', 'h2')))) { |
| 644 | - return $url . $this->path; |
|
| 644 | + return $url.$this->path; |
|
| 645 | 645 | } else { |
| 646 | - return $url . ':' . $this->port . $this->path; |
|
| 646 | + return $url.':'.$this->port.$this->path; |
|
| 647 | 647 | } |
| 648 | 648 | } |
| 649 | 649 | |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | */ |
| 785 | 785 | protected function sendPayloadHTTP10($req, $server, $port, $timeout = 0, $username = '', $password = '', |
| 786 | 786 | $authType = 1, $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
| 787 | - $method='http') |
|
| 787 | + $method = 'http') |
|
| 788 | 788 | { |
| 789 | 789 | //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); |
| 790 | 790 | |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | * @param int $sslVersion |
| 818 | 818 | * @return Response |
| 819 | 819 | */ |
| 820 | - protected function sendPayloadHTTPS($req, $server, $port, $timeout = 0, $username = '', $password = '', |
|
| 820 | + protected function sendPayloadHTTPS($req, $server, $port, $timeout = 0, $username = '', $password = '', |
|
| 821 | 821 | $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', $proxyHost = '', $proxyPort = 0, |
| 822 | 822 | $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $keepAlive = false, $key = '', $keyPass = '', |
| 823 | 823 | $sslVersion = 0) |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | */ |
| 857 | 857 | protected function sendPayloadSocket($req, $server, $port, $timeout = 0, $username = '', $password = '', |
| 858 | 858 | $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', $proxyHost = '', $proxyPort = 0, |
| 859 | - $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method='http', $key = '', $keyPass = '', |
|
| 859 | + $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method = 'http', $key = '', $keyPass = '', |
|
| 860 | 860 | $sslVersion = 0) |
| 861 | 861 | { |
| 862 | 862 | /// @todo log a warning if passed an unsupported method |
@@ -893,16 +893,16 @@ discard block |
||
| 893 | 893 | // thanks to Grant Rauscher <[email protected]> for this |
| 894 | 894 | $credentials = ''; |
| 895 | 895 | if ($username != '') { |
| 896 | - $credentials = 'Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n"; |
|
| 896 | + $credentials = 'Authorization: Basic '.base64_encode($username.':'.$password)."\r\n"; |
|
| 897 | 897 | if ($authType != 1) { |
| 898 | 898 | /// @todo make this a proper error, i.e. return a failure |
| 899 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported with HTTP 1.0'); |
|
| 899 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported with HTTP 1.0'); |
|
| 900 | 900 | } |
| 901 | 901 | } |
| 902 | 902 | |
| 903 | 903 | $acceptedEncoding = ''; |
| 904 | 904 | if (is_array($this->accepted_compression) && count($this->accepted_compression)) { |
| 905 | - $acceptedEncoding = 'Accept-Encoding: ' . implode(', ', $this->accepted_compression) . "\r\n"; |
|
| 905 | + $acceptedEncoding = 'Accept-Encoding: '.implode(', ', $this->accepted_compression)."\r\n"; |
|
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | $proxyCredentials = ''; |
@@ -914,13 +914,13 @@ discard block |
||
| 914 | 914 | $connectPort = $proxyPort; |
| 915 | 915 | $transport = 'tcp'; |
| 916 | 916 | /// @todo check: should we not use https in some cases? |
| 917 | - $uri = 'http://' . $server . ':' . $port . $this->path; |
|
| 917 | + $uri = 'http://'.$server.':'.$port.$this->path; |
|
| 918 | 918 | if ($proxyUsername != '') { |
| 919 | 919 | if ($proxyAuthType != 1) { |
| 920 | 920 | /// @todo make this a proper error, i.e. return a failure |
| 921 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported with HTTP 1.0'); |
|
| 921 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported with HTTP 1.0'); |
|
| 922 | 922 | } |
| 923 | - $proxyCredentials = 'Proxy-Authorization: Basic ' . base64_encode($proxyUsername . ':' . $proxyPassword) . "\r\n"; |
|
| 923 | + $proxyCredentials = 'Proxy-Authorization: Basic '.base64_encode($proxyUsername.':'.$proxyPassword)."\r\n"; |
|
| 924 | 924 | } |
| 925 | 925 | } else { |
| 926 | 926 | $connectServer = $server; |
@@ -935,45 +935,45 @@ discard block |
||
| 935 | 935 | $version = ''; |
| 936 | 936 | foreach ($this->cookies as $name => $cookie) { |
| 937 | 937 | if ($cookie['version']) { |
| 938 | - $version = ' $Version="' . $cookie['version'] . '";'; |
|
| 939 | - $cookieHeader .= ' ' . $name . '="' . $cookie['value'] . '";'; |
|
| 938 | + $version = ' $Version="'.$cookie['version'].'";'; |
|
| 939 | + $cookieHeader .= ' '.$name.'="'.$cookie['value'].'";'; |
|
| 940 | 940 | if ($cookie['path']) { |
| 941 | - $cookieHeader .= ' $Path="' . $cookie['path'] . '";'; |
|
| 941 | + $cookieHeader .= ' $Path="'.$cookie['path'].'";'; |
|
| 942 | 942 | } |
| 943 | 943 | if ($cookie['domain']) { |
| 944 | - $cookieHeader .= ' $Domain="' . $cookie['domain'] . '";'; |
|
| 944 | + $cookieHeader .= ' $Domain="'.$cookie['domain'].'";'; |
|
| 945 | 945 | } |
| 946 | 946 | if ($cookie['port']) { |
| 947 | - $cookieHeader .= ' $Port="' . $cookie['port'] . '";'; |
|
| 947 | + $cookieHeader .= ' $Port="'.$cookie['port'].'";'; |
|
| 948 | 948 | } |
| 949 | 949 | } else { |
| 950 | - $cookieHeader .= ' ' . $name . '=' . $cookie['value'] . ";"; |
|
| 950 | + $cookieHeader .= ' '.$name.'='.$cookie['value'].";"; |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | - $cookieHeader = 'Cookie:' . $version . substr($cookieHeader, 0, -1) . "\r\n"; |
|
| 953 | + $cookieHeader = 'Cookie:'.$version.substr($cookieHeader, 0, -1)."\r\n"; |
|
| 954 | 954 | } |
| 955 | 955 | |
| 956 | 956 | // omit port if default |
| 957 | 957 | if (($port == 80 && in_array($method, array('http', 'http10'))) || ($port == 443 && $method == 'https')) { |
| 958 | - $port = ''; |
|
| 958 | + $port = ''; |
|
| 959 | 959 | } else { |
| 960 | - $port = ':' . $port; |
|
| 960 | + $port = ':'.$port; |
|
| 961 | 961 | } |
| 962 | 962 | |
| 963 | - $op = 'POST ' . $uri . " HTTP/1.0\r\n" . |
|
| 964 | - 'User-Agent: ' . $this->user_agent . "\r\n" . |
|
| 965 | - 'Host: ' . $server . $port . "\r\n" . |
|
| 966 | - $credentials . |
|
| 967 | - $proxyCredentials . |
|
| 968 | - $acceptedEncoding . |
|
| 969 | - $encodingHdr . |
|
| 970 | - 'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings) . "\r\n" . |
|
| 971 | - $cookieHeader . |
|
| 972 | - 'Content-Type: ' . $req->content_type . "\r\nContent-Length: " . |
|
| 973 | - strlen($payload) . "\r\n\r\n" . |
|
| 963 | + $op = 'POST '.$uri." HTTP/1.0\r\n". |
|
| 964 | + 'User-Agent: '.$this->user_agent."\r\n". |
|
| 965 | + 'Host: '.$server.$port."\r\n". |
|
| 966 | + $credentials. |
|
| 967 | + $proxyCredentials. |
|
| 968 | + $acceptedEncoding. |
|
| 969 | + $encodingHdr. |
|
| 970 | + 'Accept-Charset: '.implode(',', $this->accepted_charset_encodings)."\r\n". |
|
| 971 | + $cookieHeader. |
|
| 972 | + 'Content-Type: '.$req->content_type."\r\nContent-Length: ". |
|
| 973 | + strlen($payload)."\r\n\r\n". |
|
| 974 | 974 | $payload; |
| 975 | 975 | |
| 976 | - if ($this->debug > 1) { |
|
| 976 | + if ($this->debug>1) { |
|
| 977 | 977 | $this->getLogger()->debug("---SENDING---\n$op\n---END---"); |
| 978 | 978 | } |
| 979 | 979 | |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | |
| 1001 | 1001 | $context = stream_context_create($contextOptions); |
| 1002 | 1002 | |
| 1003 | - if ($timeout <= 0) { |
|
| 1003 | + if ($timeout<=0) { |
|
| 1004 | 1004 | $connectTimeout = ini_get('default_socket_timeout'); |
| 1005 | 1005 | } else { |
| 1006 | 1006 | $connectTimeout = $timeout; |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | $fp = @stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout, |
| 1013 | 1013 | STREAM_CLIENT_CONNECT, $context); |
| 1014 | 1014 | if ($fp) { |
| 1015 | - if ($timeout > 0) { |
|
| 1015 | + if ($timeout>0) { |
|
| 1016 | 1016 | stream_set_timeout($fp, $timeout, 0); |
| 1017 | 1017 | } |
| 1018 | 1018 | } else { |
@@ -1021,8 +1021,8 @@ discard block |
||
| 1021 | 1021 | $this->errstr = $err['message']; |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | - $this->errstr = 'Connect error: ' . $this->errstr; |
|
| 1025 | - $r = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')'); |
|
| 1024 | + $this->errstr = 'Connect error: '.$this->errstr; |
|
| 1025 | + $r = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr.' ('.$this->errno.')'); |
|
| 1026 | 1026 | |
| 1027 | 1027 | return $r; |
| 1028 | 1028 | } |
@@ -1110,18 +1110,18 @@ discard block |
||
| 1110 | 1110 | $keyPass, $sslVersion); |
| 1111 | 1111 | |
| 1112 | 1112 | if (!$curl) { |
| 1113 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': error during curl initialization. Check php error log for details'); |
|
| 1113 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': error during curl initialization. Check php error log for details'); |
|
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | $result = curl_exec($curl); |
| 1117 | 1117 | |
| 1118 | - if ($this->debug > 1) { |
|
| 1118 | + if ($this->debug>1) { |
|
| 1119 | 1119 | $message = "---CURL INFO---\n"; |
| 1120 | 1120 | foreach (curl_getinfo($curl) as $name => $val) { |
| 1121 | 1121 | if (is_array($val)) { |
| 1122 | 1122 | $val = implode("\n", $val); |
| 1123 | 1123 | } |
| 1124 | - $message .= $name . ': ' . $val . "\n"; |
|
| 1124 | + $message .= $name.': '.$val."\n"; |
|
| 1125 | 1125 | } |
| 1126 | 1126 | $message .= '---END---'; |
| 1127 | 1127 | $this->getLogger()->debug($message); |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | /// @todo we should use a better check here - what if we get back '' or '0'? |
| 1132 | 1132 | |
| 1133 | 1133 | $this->errstr = 'no response'; |
| 1134 | - $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl)); |
|
| 1134 | + $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': '.curl_error($curl)); |
|
| 1135 | 1135 | curl_close($curl); |
| 1136 | 1136 | if ($keepAlive) { |
| 1137 | 1137 | $this->xmlrpc_curl_handle = null; |
@@ -1201,12 +1201,12 @@ discard block |
||
| 1201 | 1201 | // http, https |
| 1202 | 1202 | $protocol = $method; |
| 1203 | 1203 | if (strpos($protocol, ':') !== false) { |
| 1204 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'"); |
|
| 1204 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'"); |
|
| 1205 | 1205 | return false; |
| 1206 | 1206 | } |
| 1207 | 1207 | } |
| 1208 | 1208 | } |
| 1209 | - $curl = curl_init($protocol . '://' . $server . ':' . $port . $this->path); |
|
| 1209 | + $curl = curl_init($protocol.'://'.$server.':'.$port.$this->path); |
|
| 1210 | 1210 | if (!$curl) { |
| 1211 | 1211 | return false; |
| 1212 | 1212 | } |
@@ -1220,7 +1220,7 @@ discard block |
||
| 1220 | 1220 | // results into variable |
| 1221 | 1221 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
| 1222 | 1222 | |
| 1223 | - if ($this->debug > 1) { |
|
| 1223 | + if ($this->debug>1) { |
|
| 1224 | 1224 | curl_setopt($curl, CURLOPT_VERBOSE, true); |
| 1225 | 1225 | /// @todo redirect curlopt_stderr to some stream which can be piped to the logger |
| 1226 | 1226 | } |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | } |
| 1246 | 1246 | } |
| 1247 | 1247 | // extra headers |
| 1248 | - $headers = array('Content-Type: ' . $req->content_type, 'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings)); |
|
| 1248 | + $headers = array('Content-Type: '.$req->content_type, 'Accept-Charset: '.implode(',', $this->accepted_charset_encodings)); |
|
| 1249 | 1249 | // if no keepalive is wanted, let the server know it in advance |
| 1250 | 1250 | if (!$keepAlive) { |
| 1251 | 1251 | $headers[] = 'Connection: close'; |
@@ -1262,7 +1262,7 @@ discard block |
||
| 1262 | 1262 | curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); |
| 1263 | 1263 | // timeout is borked |
| 1264 | 1264 | if ($timeout) { |
| 1265 | - curl_setopt($curl, CURLOPT_TIMEOUT, $timeout == 1 ? 1 : $timeout - 1); |
|
| 1265 | + curl_setopt($curl, CURLOPT_TIMEOUT, $timeout == 1 ? 1 : $timeout-1); |
|
| 1266 | 1266 | } |
| 1267 | 1267 | |
| 1268 | 1268 | switch ($method) { |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE); |
| 1278 | 1278 | } else { |
| 1279 | 1279 | /// @todo make this a proper error, i.e. return a failure |
| 1280 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install'); |
|
| 1280 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. HTTP2 is not supported by the current PHP/curl install'); |
|
| 1281 | 1281 | } |
| 1282 | 1282 | break; |
| 1283 | 1283 | case 'h2': |
@@ -1286,12 +1286,12 @@ discard block |
||
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | if ($username && $password) { |
| 1289 | - curl_setopt($curl, CURLOPT_USERPWD, $username . ':' . $password); |
|
| 1289 | + curl_setopt($curl, CURLOPT_USERPWD, $username.':'.$password); |
|
| 1290 | 1290 | if (defined('CURLOPT_HTTPAUTH')) { |
| 1291 | 1291 | curl_setopt($curl, CURLOPT_HTTPAUTH, $authType); |
| 1292 | 1292 | } elseif ($authType != 1) { |
| 1293 | 1293 | /// @todo make this a proper error, i.e. return a failure |
| 1294 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install'); |
|
| 1294 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported by the current PHP/curl install'); |
|
| 1295 | 1295 | } |
| 1296 | 1296 | } |
| 1297 | 1297 | |
@@ -1334,14 +1334,14 @@ discard block |
||
| 1334 | 1334 | if ($proxyPort == 0) { |
| 1335 | 1335 | $proxyPort = 8080; // NB: even for HTTPS, local connection is on port 8080 |
| 1336 | 1336 | } |
| 1337 | - curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $proxyPort); |
|
| 1337 | + curl_setopt($curl, CURLOPT_PROXY, $proxyHost.':'.$proxyPort); |
|
| 1338 | 1338 | if ($proxyUsername) { |
| 1339 | - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUsername . ':' . $proxyPassword); |
|
| 1339 | + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUsername.':'.$proxyPassword); |
|
| 1340 | 1340 | if (defined('CURLOPT_PROXYAUTH')) { |
| 1341 | 1341 | curl_setopt($curl, CURLOPT_PROXYAUTH, $proxyAuthType); |
| 1342 | 1342 | } elseif ($proxyAuthType != 1) { |
| 1343 | 1343 | /// @todo make this a proper error, i.e. return a failure |
| 1344 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
|
| 1344 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
|
| 1345 | 1345 | } |
| 1346 | 1346 | } |
| 1347 | 1347 | } |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | if (count($this->cookies)) { |
| 1352 | 1352 | $cookieHeader = ''; |
| 1353 | 1353 | foreach ($this->cookies as $name => $cookie) { |
| 1354 | - $cookieHeader .= $name . '=' . $cookie['value'] . '; '; |
|
| 1354 | + $cookieHeader .= $name.'='.$cookie['value'].'; '; |
|
| 1355 | 1355 | } |
| 1356 | 1356 | curl_setopt($curl, CURLOPT_COOKIE, substr($cookieHeader, 0, -2)); |
| 1357 | 1357 | } |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | curl_setopt($curl, $opt, $val); |
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | - if ($this->debug > 1) { |
|
| 1363 | + if ($this->debug>1) { |
|
| 1364 | 1364 | $this->getLogger()->debug("---SENDING---\n$payload\n---END---"); |
| 1365 | 1365 | } |
| 1366 | 1366 | |
@@ -1451,7 +1451,7 @@ discard block |
||
| 1451 | 1451 | $call['methodName'] = new Value($req->method(), 'string'); |
| 1452 | 1452 | $numParams = $req->getNumParams(); |
| 1453 | 1453 | $params = array(); |
| 1454 | - for ($i = 0; $i < $numParams; $i++) { |
|
| 1454 | + for ($i = 0; $i<$numParams; $i++) { |
|
| 1455 | 1455 | $params[$i] = $req->getParam($i); |
| 1456 | 1456 | } |
| 1457 | 1457 | $call['params'] = new Value($params, 'array'); |
@@ -1473,7 +1473,7 @@ discard block |
||
| 1473 | 1473 | $response = array(); |
| 1474 | 1474 | |
| 1475 | 1475 | if ($this->return_type == 'xml') { |
| 1476 | - for ($i = 0; $i < count($reqs); $i++) { |
|
| 1476 | + for ($i = 0; $i<count($reqs); $i++) { |
|
| 1477 | 1477 | $response[] = new Response($rets, 0, '', 'xml', $result->httpResponse()); |
| 1478 | 1478 | } |
| 1479 | 1479 | |
@@ -1481,21 +1481,21 @@ discard block |
||
| 1481 | 1481 | if (!is_array($rets)) { |
| 1482 | 1482 | // bad return type from system.multicall |
| 1483 | 1483 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1484 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': not an array', 'phpvals', $result->httpResponse()); |
|
| 1484 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': not an array', 'phpvals', $result->httpResponse()); |
|
| 1485 | 1485 | } |
| 1486 | 1486 | $numRets = count($rets); |
| 1487 | 1487 | if ($numRets != count($reqs)) { |
| 1488 | 1488 | // wrong number of return values. |
| 1489 | 1489 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1490 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'phpvals', |
|
| 1490 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'phpvals', |
|
| 1491 | 1491 | $result->httpResponse()); |
| 1492 | 1492 | } |
| 1493 | 1493 | |
| 1494 | - for ($i = 0; $i < $numRets; $i++) { |
|
| 1494 | + for ($i = 0; $i<$numRets; $i++) { |
|
| 1495 | 1495 | $val = $rets[$i]; |
| 1496 | 1496 | if (!is_array($val)) { |
| 1497 | 1497 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1498 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct", |
|
| 1498 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct", |
|
| 1499 | 1499 | 'phpvals', $result->httpResponse()); |
| 1500 | 1500 | } |
| 1501 | 1501 | switch (count($val)) { |
@@ -1503,7 +1503,7 @@ discard block |
||
| 1503 | 1503 | if (!isset($val[0])) { |
| 1504 | 1504 | // Bad value |
| 1505 | 1505 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1506 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has no value", |
|
| 1506 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has no value", |
|
| 1507 | 1507 | 'phpvals', $result->httpResponse()); |
| 1508 | 1508 | } |
| 1509 | 1509 | // Normal return value |
@@ -1515,20 +1515,20 @@ discard block |
||
| 1515 | 1515 | if (!is_int($code)) { |
| 1516 | 1516 | /// @todo should we check that it is != 0? |
| 1517 | 1517 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1518 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
| 1518 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
| 1519 | 1519 | 'phpvals', $result->httpResponse()); |
| 1520 | 1520 | } |
| 1521 | 1521 | $str = @$val['faultString']; |
| 1522 | 1522 | if (!is_string($str)) { |
| 1523 | 1523 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1524 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no FaultString", |
|
| 1524 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no FaultString", |
|
| 1525 | 1525 | 'phpvals', $result->httpResponse()); |
| 1526 | 1526 | } |
| 1527 | 1527 | $response[$i] = new Response(0, $code, $str, 'phpvals', $result->httpResponse()); |
| 1528 | 1528 | break; |
| 1529 | 1529 | default: |
| 1530 | 1530 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1531 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
| 1531 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
| 1532 | 1532 | 'phpvals', $result->httpResponse()); |
| 1533 | 1533 | } |
| 1534 | 1534 | } |
@@ -1537,14 +1537,14 @@ discard block |
||
| 1537 | 1537 | // return type == 'xmlrpcvals' |
| 1538 | 1538 | if ($rets->kindOf() != 'array') { |
| 1539 | 1539 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1540 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array", 'xmlrpcvals', |
|
| 1540 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array", 'xmlrpcvals', |
|
| 1541 | 1541 | $result->httpResponse()); |
| 1542 | 1542 | } |
| 1543 | 1543 | $numRets = $rets->count(); |
| 1544 | 1544 | if ($numRets != count($reqs)) { |
| 1545 | 1545 | // wrong number of return values. |
| 1546 | 1546 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1547 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'xmlrpcvals', |
|
| 1547 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'xmlrpcvals', |
|
| 1548 | 1548 | $result->httpResponse()); |
| 1549 | 1549 | } |
| 1550 | 1550 | |
@@ -1553,7 +1553,7 @@ discard block |
||
| 1553 | 1553 | case 'array': |
| 1554 | 1554 | if ($val->count() != 1) { |
| 1555 | 1555 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1556 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
| 1556 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
| 1557 | 1557 | 'phpvals', $result->httpResponse()); |
| 1558 | 1558 | } |
| 1559 | 1559 | // Normal return value |
@@ -1562,28 +1562,28 @@ discard block |
||
| 1562 | 1562 | case 'struct': |
| 1563 | 1563 | if ($val->count() != 2) { |
| 1564 | 1564 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1565 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
| 1565 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
| 1566 | 1566 | 'phpvals', $result->httpResponse()); |
| 1567 | 1567 | } |
| 1568 | 1568 | /** @var Value $code */ |
| 1569 | 1569 | $code = $val['faultCode']; |
| 1570 | 1570 | if ($code->kindOf() != 'scalar' || $code->scalartyp() != 'int') { |
| 1571 | 1571 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1572 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
| 1572 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
| 1573 | 1573 | 'xmlrpcvals', $result->httpResponse()); |
| 1574 | 1574 | } |
| 1575 | 1575 | /** @var Value $str */ |
| 1576 | 1576 | $str = $val['faultString']; |
| 1577 | 1577 | if ($str->kindOf() != 'scalar' || $str->scalartyp() != 'string') { |
| 1578 | 1578 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1579 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
| 1579 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
| 1580 | 1580 | 'xmlrpcvals', $result->httpResponse()); |
| 1581 | 1581 | } |
| 1582 | 1582 | $response[] = new Response(0, $code->scalarval(), $str->scalarval(), 'xmlrpcvals', $result->httpResponse()); |
| 1583 | 1583 | break; |
| 1584 | 1584 | default: |
| 1585 | 1585 | return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
| 1586 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct", |
|
| 1586 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct", |
|
| 1587 | 1587 | 'xmlrpcvals', $result->httpResponse()); |
| 1588 | 1588 | } |
| 1589 | 1589 | } |