https://github.com/Nyholm/psr7-server
Helper classes to use any PSR7 implementation as your main request and response
https://github.com/Nyholm/psr7-server
Last synced: about 1 year ago
JSON representation
Helper classes to use any PSR7 implementation as your main request and response
- Host: GitHub
- URL: https://github.com/Nyholm/psr7-server
- Owner: Nyholm
- License: mit
- Created: 2018-07-28T06:25:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-08T09:32:58.000Z (over 2 years ago)
- Last Synced: 2025-03-17T00:08:05.226Z (about 1 year ago)
- Language: PHP
- Size: 46.9 KB
- Stars: 94
- Watchers: 6
- Forks: 22
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-resources - Nyholm PSR7 Server - PSR7 Server Library (PHP / PHP Libraries)
- awesome-resources - Nyholm PSR7 Server - PSR7 Server Library (Libraries / Libraries)
README
# Helper class to create PSR-7 server request
[](https://github.com/Nyholm/psr7-server/releases)
[](https://travis-ci.org/Nyholm/psr7-server)
[](https://scrutinizer-ci.com/g/Nyholm/psr7-server)
[](https://scrutinizer-ci.com/g/Nyholm/psr7-server)
[](https://packagist.org/packages/nyholm/psr7-server)
[](https://packagist.org/packages/nyholm/psr7-server)
[](LICENSE)
A helper class that can create ANY PSR-7 server request.
## Installation
```bash
composer require nyholm/psr7-server
```
## Usage
```php
// 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](https://github.com/Nyholm/psr7) - A super fast PSR-7 implementation.
* [laminas/laminas-httphandlerrunner](https://github.com/laminas/laminas-httphandlerrunner) - To send/emit PSR-7 responses