From 380aca5e92c650702cdaed4c87104c3e0b651ce1 Mon Sep 17 00:00:00 2001 From: Solvent Date: Fri, 15 Oct 2021 07:05:00 +0500 Subject: [PATCH] Add a new PSR-17 factory to Psr17FactoryProvider --- README.md | 5 ++++- Slim/Factory/Psr17/HttpSoftPsr17Factory.php | 19 +++++++++++++++++++ Slim/Factory/Psr17/Psr17FactoryProvider.php | 1 + composer.json | 2 ++ tests/Factory/AppFactoryTest.php | 3 +++ .../ServerRequestCreatorFactoryTest.php | 3 +++ 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Slim/Factory/Psr17/HttpSoftPsr17Factory.php diff --git a/README.md b/README.md index 59ff1d857..e82f379bf 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ This will install Slim and all required dependencies. Slim requires PHP 7.3 or n Before you can get up and running with Slim you will need to choose a PSR-7 implementation that best fits your application. A few notable ones: - [Slim-Psr7](https://github.com/slimphp/Slim-Psr7) - This is the Slim Framework PSR-7 implementation -- [Nyholm/psr7](https://github.com/Nyholm/psr7) & [Nyholm/psr7-server](https://github.com/Nyholm/psr7-server) - This is the fastest, strictest and most lightweight implementation available +- [httpsoft/http-message](https://github.com/httpsoft/http-message) & [httpsoft/http-server-request](https://github.com/httpsoft/http-server-request) - This is the fastest, strictest and most lightweight implementation available +- [Nyholm/psr7](https://github.com/Nyholm/psr7) & [Nyholm/psr7-server](https://github.com/Nyholm/psr7-server) - Performance is almost the same as the HttpSoft implementation - [Guzzle/psr7](https://github.com/guzzle/psr7) - This is the implementation used by the Guzzle Client, featuring extra functionality for stream and file handling - [laminas-diactoros](https://github.com/laminas/laminas-diactoros) - This is the Laminas (Zend) PSR-7 implementation @@ -53,6 +54,8 @@ $app = AppFactory::create(); ## Hello World using AppFactory with PSR-7 auto-detection In order for auto-detection to work and enable you to use `AppFactory::create()` and `App::run()` without having to manually create a `ServerRequest` you need to install one of the following implementations: - [Slim-Psr7](https://github.com/slimphp/Slim-Psr7) - Install using `composer require slim/psr7` +- [httpsoft/http-message](https://github.com/httpsoft/http-message) & [httpsoft/http-server-request](https://github.com/httpsoft/http-server-request) - Install using: +`composer require httpsoft/http-message httpsoft/http-server-request` - [Nyholm/psr7](https://github.com/Nyholm/psr7) & [Nyholm/psr7-server](https://github.com/Nyholm/psr7-server) - Install using `composer require nyholm/psr7 nyholm/psr7-server` - [Guzzle/psr7](https://github.com/guzzle/psr7) - Install using `composer require guzzlehttp/psr7` - [laminas-diactoros](https://github.com/laminas/laminas-diactoros) - Install using `composer require laminas/laminas-diactoros` diff --git a/Slim/Factory/Psr17/HttpSoftPsr17Factory.php b/Slim/Factory/Psr17/HttpSoftPsr17Factory.php new file mode 100644 index 000000000..e6d06b3fa --- /dev/null +++ b/Slim/Factory/Psr17/HttpSoftPsr17Factory.php @@ -0,0 +1,19 @@ +