Skip to content
  • Benjamin Franzke's avatar
    [FEATURE] Provide implementation for PSR-17 HTTP Message Factories · 7b5612f5
    Benjamin Franzke authored and Frank Nägler's avatar Frank Nägler committed
    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: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Tested-by: default avatarFrank Nägler <frank.naegler@typo3.org>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarFrank Nägler <frank.naegler@typo3.org>
    7b5612f5