nyholm / psr7-server
Helper classes to handle PSR-7 server requests
Installs: 3 869 456
Dependents: 262
Suggesters: 4
Security: 0
Stars: 90
Watchers: 7
Forks: 21
Open Issues: 11
Requires
- php: ^7.1 || ^8.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0 || ^2.0
Requires (Dev)
- nyholm/nsa: ^1.1
- nyholm/psr7: ^1.3
- phpunit/phpunit: ^7.0 || ^8.5 || ^9.3
README
A helper class that can create ANY PSR-7 server request.
Installation
composer require nyholm/psr7-server
Usage
// Instanciate ANY PSR-17 factory implementations. Here is nyholm/psr7 as an example $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); $creator = new \Nyholm\Psr7Server\ServerRequestCreator( $psr17Factory, // ServerRequestFactory $psr17Factory, // UriFactory $psr17Factory, // UploadedFileFactory $psr17Factory // StreamFactory ); $serverRequest = $creator->fromGlobals();
Other packages
- nyholm/psr7 - A super fast PSR-7 implementation.
- laminas/laminas-httphandlerrunner - To send/emit PSR-7 responses