"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Symfony/Component/HttpClient/Response/ResponseTrait.php" between
symfony-4.4.14.tar.gz and symfony-4.4.15.tar.gz

About: Symfony is a web application framework for PHP projects. Source code (4.4 series).

ResponseTrait.php  (symfony-4.4.14):ResponseTrait.php  (symfony-4.4.15)
skipping to change at line 118 skipping to change at line 118
foreach (self::stream([$this]) as $chunk) { foreach (self::stream([$this]) as $chunk) {
if (!$chunk->isLast()) { if (!$chunk->isLast()) {
$content .= $chunk->getContent(); $content .= $chunk->getContent();
} }
} }
if (null !== $content) { if (null !== $content) {
return $content; return $content;
} }
if ('HEAD' === $this->info['http_method'] || \in_array($this->info[' if (null === $this->content) {
http_code'], [204, 304], true)) { throw new TransportException('Cannot get the content of the resp
return ''; onse twice: buffering is disabled.');
}
} else {
foreach (self::stream([$this]) as $chunk) {
// Chunks are buffered in $this->content already
} }
throw new TransportException('Cannot get the content of the response
twice: buffering is disabled.');
}
foreach (self::stream([$this]) as $chunk) {
// Chunks are buffered in $this->content already
} }
rewind($this->content); rewind($this->content);
return stream_get_contents($this->content); return stream_get_contents($this->content);
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
skipping to change at line 379 skipping to change at line 377
if (null !== $e) { if (null !== $e) {
$response->info['error'] = $e->getMessage(); $response->info['error'] = $e->getMessage();
if ($e instanceof \Error) { if ($e instanceof \Error) {
throw $e; throw $e;
} }
$chunk = new ErrorChunk($response->offset, $e); $chunk = new ErrorChunk($response->offset, $e);
} else { } else {
if (0 === $response->offset && null === $respons
e->content) {
$response->content = fopen('php://memory', '
w+');
}
$chunk = new LastChunk($response->offset); $chunk = new LastChunk($response->offset);
} }
} elseif ($chunk instanceof ErrorChunk) { } elseif ($chunk instanceof ErrorChunk) {
unset($responses[$j]); unset($responses[$j]);
$elapsedTimeout = $timeoutMax; $elapsedTimeout = $timeoutMax;
} elseif ($chunk instanceof FirstChunk) { } elseif ($chunk instanceof FirstChunk) {
if ($response->logger) { if ($response->logger) {
$info = $response->getInfo(); $info = $response->getInfo();
$response->logger->info(sprintf('Response: "%s % s"', $info['http_code'], $info['url'])); $response->logger->info(sprintf('Response: "%s % s"', $info['http_code'], $info['url']));
} }
 End of changes. 3 change blocks. 
10 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)