nyholm / psr7-server
处理PSR-7服务器请求的辅助类
1.1.0
2023-11-08 09:30 UTC
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
一个可以创建任何PSR-7服务器请求的辅助类。
安装
composer require nyholm/psr7-server
使用方法
// 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();
其他包
- nyholm/psr7 - 一个超快的PSR-7实现。
- laminas/laminas-httphandlerrunner - 发送/触发PSR-7响应