@@ -25,23 +25,46 @@ $ composer create-project zegnat/website-starter
2525
26261 . Using [ Auryn] [ ] to get actual dependency injections. Never pass around
2727 a container.
28- 2 . Using [ Diactoros] [ ] to only have to work with
29- [ PSR-7 Requests and Responses] [ PSR-7 ] .
30- 3 . Using [ Middleland] [ ] to run through all configured
28+ 2 . Using [ PSR-7 HTTP message objects] [ PSR-7 ] with [ PSR-17 factories] [ PSR-17 ]
29+ for all request and response handling.
30+ 3 . Using [ nyholm/psr7-server] [ ] to create the initial [ PSR-7] [ ] request.
31+ 4 . Using [ Middleland] [ ] to run through all configured
3132 [ PSR-15 Middlewares] [ PSR-15 ] .
32- 4 . Using [ FastRoute] [ ] to parse requested URIs and find the matching
33+ 5 . Using [ FastRoute] [ ] to parse requested URIs and find the matching
3334 [ PSR-15 RequestHandlers] [ PSR-15 ] .
34- 5 . Using [ PHP_CodeSniffer] [ ] to check all code against the
35+ 6 . Using [ PHP_CodeSniffer] [ ] to check all code against the
3536 [ PSR-2 Coding Style Guide] [ PSR-2 ] .
37+ 7 . Using a [ Zend Emitter] [ ] to output a final response to the web server.
38+
39+ ## PSR-7 & PSR-17 Providers
40+
41+ By default this project loads [ Diactoros] [ ] for its [ PSR-7] [ ] objects and
42+ matching [ PSR-17] [ ] factories.
43+
44+ The providers can easily be swapped for a different set of implementations.
45+ Simply remove the dependency from composer and add a new one. Example:
46+
47+ ``` bash
48+ $ composer remove zendframework/zend-diactoros
49+ $ composer require nyholm/psr7
50+ ```
51+
52+ Then change [ the injector configuration] ( config/injector.php ) to tell
53+ [ Auryn] [ ] which factories it should use. In the case of [ nyholm/psr7] [ ] all of
54+ them can be defined as ` Nyholm\Psr7\Factory\Psr17Factory::class ` .
3655
3756[ Auryn ] : https://github.com/rdlowrey/auryn
3857[ Diactoros ] : https://zendframework.github.io/zend-diactoros/
3958[ FastRoute ] : https://github.com/nikic/FastRoute
4059[ Middleland ] : https://github.com/oscarotero/middleland
60+ [ nyholm/psr7 ] : https://github.com/Nyholm/psr7
61+ [ nyholm/psr7-server ] : https://github.com/Nyholm/psr7-server
4162[ PHP_CodeSniffer ] : https://github.com/squizlabs/PHP_CodeSniffer
4263[ PSR-2 ] : http://www.php-fig.org/psr/psr-2/
4364[ PSR-7 ] : http://www.php-fig.org/psr/psr-7/
4465[ PSR-15 ] : https://www.php-fig.org/psr/psr-15/
66+ [ PSR-17 ] : https://www.php-fig.org/psr/psr-17/
67+ [ Zend Emitter ] : https://docs.zendframework.com/zend-httphandlerrunner/emitters/
4568
4669## License
4770
0 commit comments