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 2021-05-14 03:28 UTC

This package is auto-updated.

Last update: 2021-05-14 03:28:54 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