Commit a0f9a592 authored by Benni Mack's avatar Benni Mack
Browse files

[TASK] Update to Guzzle 7.3.0 and guzzlehttp/psr7 2.0

Our dependency guzzlehttp/psr7 is raised to 2.0,
however "LazyOpenStream" is now final, and that's
why we need to change our "SelfEmittableLazyOpenStream"
to become a decorator of the LazyOpenStream.

Used composer commands:

composer req guzzlehttp/guzzle:^7.3.0 guzzlehttp/psr7:^2.0
composer req guzzlehttp/guzzle:^7.3.0 guzzlehttp/psr7:^2.0 -d typo3/sysext/core --no-update

Resolves: #94454
Releases: master
Change-Id: Ica487d9bb04bf344e3d763fa83d561e2771afd21
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70437


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 5907b65f
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e246c1dc9e21edf07358183d7e687b01",
"content-hash": "4b048ac1b767d5b6150541e4510a165a",
"packages": [
{
"name": "bacon/bacon-qr-code",
......@@ -863,22 +863,22 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.2.0",
"version": "7.3.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79"
"reference": "7008573787b430c1c1f650e3722d9bba59967628"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79",
"reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628",
"reference": "7008573787b430c1c1f650e3722d9bba59967628",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.4",
"guzzlehttp/psr7": "^1.7",
"guzzlehttp/psr7": "^1.7 || ^2.0",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0"
},
......@@ -886,6 +886,7 @@
"psr/http-client-implementation": "1.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1",
"ext-curl": "*",
"php-http/client-integration-tests": "^3.0",
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
......@@ -899,7 +900,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "7.1-dev"
"dev-master": "7.3-dev"
}
},
"autoload": {
......@@ -941,7 +942,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.2.0"
"source": "https://github.com/guzzle/guzzle/tree/7.3.0"
},
"funding": [
{
......@@ -961,7 +962,7 @@
"type": "github"
}
],
"time": "2020-10-10T11:47:56+00:00"
"time": "2021-03-23T11:33:13+00:00"
},
{
"name": "guzzlehttp/promises",
......@@ -1020,29 +1021,32 @@
},
{
"name": "guzzlehttp/psr7",
"version": "1.8.2",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91"
"reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/1dc8d9cba3897165e16d12bb13d813afb1eb3fe7",
"reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
"php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
"ralouphie/getallheaders": "^3.0"
},
"provide": {
"psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"ext-zlib": "*",
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
"bamarni/composer-bin-plugin": "^1.4.1",
"http-interop/http-factory-tests": "^0.9",
"phpunit/phpunit": "^8.5.8 || ^9.3.10"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
......@@ -1050,16 +1054,13 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7-dev"
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
......@@ -1074,6 +1075,11 @@
{
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://sagikazarmark.hu"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
......@@ -1089,9 +1095,9 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.8.2"
"source": "https://github.com/guzzle/psr7/tree/2.0.0"
},
"time": "2021-04-26T09:17:50+00:00"
"time": "2021-06-30T20:03:07+00:00"
},
{
"name": "masterminds/html5",
......
......@@ -18,6 +18,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Http;
use GuzzleHttp\Psr7\LazyOpenStream;
use GuzzleHttp\Psr7\StreamDecoratorTrait;
use Psr\Http\Message\StreamInterface;
/**
* This class implements a stream that can be used like a usual PSR-7 stream
......@@ -26,12 +28,11 @@ use GuzzleHttp\Psr7\LazyOpenStream;
*
* @internal
*/
class SelfEmittableLazyOpenStream extends LazyOpenStream implements SelfEmittableStreamInterface
class SelfEmittableLazyOpenStream implements SelfEmittableStreamInterface
{
/**
* @var string
*/
protected $filename;
use StreamDecoratorTrait;
protected string $filename;
protected LazyOpenStream $stream;
/**
* Constructor setting up the PHP resource
......@@ -40,7 +41,7 @@ class SelfEmittableLazyOpenStream extends LazyOpenStream implements SelfEmittabl
*/
public function __construct($filename)
{
parent::__construct($filename, 'r');
$this->stream = new LazyOpenStream($filename, 'r');
$this->filename = $filename;
}
......@@ -52,9 +53,6 @@ class SelfEmittableLazyOpenStream extends LazyOpenStream implements SelfEmittabl
readfile($this->filename, false);
}
/**
* @return bool
*/
public function isWritable(): bool
{
return false;
......@@ -68,4 +66,12 @@ class SelfEmittableLazyOpenStream extends LazyOpenStream implements SelfEmittabl
{
throw new \RuntimeException('Cannot write to a ' . self::class, 1538331833);
}
/**
* Creates the underlying stream lazily when required.
*/
protected function createStream(): StreamInterface
{
return $this->stream->stream;
}
}
......@@ -36,8 +36,8 @@
"doctrine/lexer": "^1.2.1",
"egulias/email-validator": "^3.1",
"enshrined/svg-sanitize": "^0.14.1",
"guzzlehttp/guzzle": "^7.2",
"guzzlehttp/psr7": "^1.7.0",
"guzzlehttp/guzzle": "^7.3.0",
"guzzlehttp/psr7": "^2.0",
"nikic/php-parser": "^4.10.4",
"psr/container": "^1.1 || ^2.0",
"psr/event-dispatcher": "^1.0",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment