git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove usages of 'each', as it is deprecated in php 7.2
[plcapi.git]
/
src
/
Helper
/
Http.php
diff --git
a/src/Helper/Http.php
b/src/Helper/Http.php
index
0fa3f51
..
03a1ab6
100644
(file)
--- a/
src/Helper/Http.php
+++ b/
src/Helper/Http.php
@@
-3,14
+3,12
@@
namespace PhpXmlRpc\Helper;
use PhpXmlRpc\PhpXmlRpc;
namespace PhpXmlRpc\Helper;
use PhpXmlRpc\PhpXmlRpc;
-use PhpXmlRpc\Helper\Logger;
class Http
{
/**
class Http
{
/**
- * Decode a string that is encoded w/ "chunked" transfer encoding
- * as defined in rfc2068 par. 19.4.6
- * code shamelessly stolen from nusoap library by Dietrich Ayala.
+ * Decode a string that is encoded with "chunked" transfer encoding as defined in rfc2068 par. 19.4.6
+ * Code shamelessly stolen from nusoap library by Dietrich Ayala.
*
* @param string $buffer the string to be decoded
*
*
* @param string $buffer the string to be decoded
*
@@
-135,7
+133,7
@@
class Http
}
// be tolerant to line endings, and extra empty lines
$ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos)));
}
// be tolerant to line endings, and extra empty lines
$ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos)));
-
while (list(, $line) = @each($ar)
) {
+
foreach($ar as $line
) {
// take care of multi-line headers and cookies
$arr = explode(':', $line, 2);
if (count($arr) > 1) {
// take care of multi-line headers and cookies
$arr = explode(':', $line, 2);
if (count($arr) > 1) {
@@
-199,7
+197,7
@@
class Http
foreach ($httpResponse['cookies'] as $header => $value) {
$msg .= "COOKIE: $header={$value['value']}\n";
}
foreach ($httpResponse['cookies'] as $header => $value) {
$msg .= "COOKIE: $header={$value['value']}\n";
}
- Logger::debugMessage($msg);
+ Logger::
instance()->
debugMessage($msg);
}
// if CURL was used for the call, http headers have been processed,
}
// if CURL was used for the call, http headers have been processed,
@@
-223,12
+221,12
@@
class Http
if ($httpResponse['headers']['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) {
$data = $degzdata;
if ($debug) {
if ($httpResponse['headers']['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) {
$data = $degzdata;
if ($debug) {
- Logger::debugMessage("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---");
+ Logger::
instance()->
debugMessage("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---");
}
} elseif ($httpResponse['headers']['content-encoding'] == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) {
$data = $degzdata;
if ($debug) {
}
} elseif ($httpResponse['headers']['content-encoding'] == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) {
$data = $degzdata;
if ($debug) {
- Logger::debugMessage("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---");
+ Logger::
instance()->
debugMessage("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---");
}
} else {
error_log('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to decode the deflated data received from server');
}
} else {
error_log('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to decode the deflated data received from server');