Feature #89018

Provide implementation for PSR-17 HTTP Message Factories

Added by Benjamin Franzke 25 days ago. Updated about 1 hour ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Start date:
2019-08-26
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

PSR-17 [1] HTTP Factories are useful in generic middlewares or request handlers, as they allow to create PSR-7 responses without relying on a specific PSR-7 implementation.

Gains for TYPO3 extensions:

  • While the TYPO3's PSR-7 implementation is marked @internal, the availability of the PSR-17 interfaces is considered public TYPO3 API (implementations are made available through the DI container)
  • Allows TYPO3 extensions to inlude generic PSR-15 middlewares from external packages (which may already make use of PSR-17 factories to create PSR-7 response objects).

[1] https://www.php-fig.org/psr/psr-17/

Associated revisions

Revision 7b5612f5 (diff)
Added by Benjamin Franzke about 1 hour ago

[FEATURE] Provide implementation for PSR-17 HTTP Message Factories

Support for PSR-17 HTTP Message Factories has been added.

PSR-17 HTTP Factories are intended to be used by PSR-15 request handlers
in order to create PSR-7 compatible message objects.

Classes may use dependency injection to use any of the available PSR-17
HTTP Factory interfaces.

The Request/Response base class (Message) is adapted to be able to lazily
initialize a stream when getBody() is called.
This is done as the PSR (Stream)RequestFactoryInterface does not allow
to control Stream properties. Therefore it is a performance
optimization to defer initialization. It is likely, that a new
Stream will be added to a Request with withStream() anyway.
(Which would mean resources for the intermediate stream would have
been wasted)

Furthermore some DocBlocks are adapted to reflect the variadic
UriInterface/StreamInterface parameters that are already handled in
code but were not documented. These cases are needed/required
by the PSR-17 factory implementation now.

composer require psr/http-factory:^1.0

Releases: master
Resolves: #89018
Change-Id: Ie6b9d865679bbf6f5d3d030b0ed1a3f277c47a3d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Frank Nägler <>
Reviewed-by: Benni Mack <>
Reviewed-by: Frank Nägler <>

History

#1 Updated by Gerrit Code Review 25 days ago

  • Status changed from New to Under Review

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#2 Updated by Gerrit Code Review 25 days ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#3 Updated by Gerrit Code Review 25 days ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#4 Updated by Gerrit Code Review 25 days ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#5 Updated by Gerrit Code Review 25 days ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#6 Updated by Gerrit Code Review 24 days ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#7 Updated by Gerrit Code Review 24 days ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#8 Updated by Gerrit Code Review 23 days ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#9 Updated by Gerrit Code Review 23 days ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#10 Updated by Gerrit Code Review 16 days ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#11 Updated by Gerrit Code Review 7 days ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#12 Updated by Gerrit Code Review 7 days ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61558

#13 Updated by Benjamin Franzke about 1 hour ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF