thingston/psr17
Composer 安装命令:
composer require thingston/psr17
包简介
Implementation of PSR-17 standard for factories that create PSR-7 compliant HTTP objects.
README 文档
README
PSR-17 factory implementations for creating PSR-7 HTTP messages with thingston/psr7.
Requirements
- PHP >= 8.5
- Composer
Installation
composer require thingston/psr17
Usage
Instantiate the factory you need and create PSR-7 objects through the PSR-17 interfaces.
<?php declare(strict_types=1); use Thingston\Psr17\RequestFactory; use Thingston\Psr17\ResponseFactory; use Thingston\Psr17\ServerRequestFactory; use Thingston\Psr17\StreamFactory; use Thingston\Psr17\UploadedFileFactory; use Thingston\Psr17\UriFactory; $requestFactory = new RequestFactory(); $responseFactory = new ResponseFactory(); $serverRequestFactory = new ServerRequestFactory(); $streamFactory = new StreamFactory(); $uploadedFileFactory = new UploadedFileFactory(); $uriFactory = new UriFactory(); $request = $requestFactory->createRequest('POST', 'https://example.com/articles'); $response = $responseFactory->createResponse(201); $serverRequest = $serverRequestFactory->createServerRequest( 'GET', 'https://example.com/search?q=psr', ['HTTPS' => 'on'], ); $stream = $streamFactory->createStream('payload'); $uploadedFile = $uploadedFileFactory->createUploadedFile( $streamFactory->createStream('file contents'), null, UPLOAD_ERR_OK, 'example.txt', 'text/plain', ); $uri = $uriFactory->createUri('https://example.com/path?foo=bar');
Available factories
| Factory | Creates |
|---|---|
RequestFactory |
client requests |
ResponseFactory |
responses |
ServerRequestFactory |
server requests, including query and server params |
StreamFactory |
streams from strings, files, or resources |
UploadedFileFactory |
uploaded files |
UriFactory |
URIs |
Testing
composer test
thingston/psr17 适用场景与选型建议
thingston/psr17 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 thingston/psr17 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 thingston/psr17 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 48
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-12