terablaze/psr7-server

Helper classes to handle PSR-7 server requests(A fork of nyholm/psr7-server, removing final clause from all classes making them extendable)

dev-master 2023-01-22 19:20 UTC

This package is auto-updated.

Last update: 2024-12-23 00:12:48 UTC


README

A helper class that can create ANY PSR-7 server request.

Installation

composer require terablaze/psr7-server

Usage

// Instanciate ANY PSR-17 factory implementations. Here is terablaze/psr7 as an example
$psr17Factory = new \Terablaze\Psr7\Factory\Psr17Factory();

$creator = new \Terablaze\Psr7Server\ServerRequestCreator(
    $psr17Factory, // ServerRequestFactory
    $psr17Factory, // UriFactory
    $psr17Factory, // UploadedFileFactory
    $psr17Factory  // StreamFactory
);

$serverRequest = $creator->fromGlobals();

Other packages