f3-factory/fatfree-psr7
Composer 安装命令:
composer require f3-factory/fatfree-psr7
包简介
A fat-free PHP8 implementation of PSR-7 and PSR-17
关键字:
README 文档
README
This is a lightweight PSR-7 implementation for PHP 8.0+.
Installation
composer require f3-factory/fatfree-psr7
Usage
The package includes a PSR-17 factory.
Use these factories according to specs to create Request, Response, Uri, Stream objects.
Tests
Run the test suite:
composer test
NB: Custom tests were mostly taken from Nyholm/psr7.
Benchmarks
Benchmarks done with devanych/psr-http-benchmark on php 8.0+.
Checkout benchmark branch, start docker composer, then run in container:
COMPOSER_ROOT_VERSION=1.0 composer update
Run benchmarks on php 8.0+:
cd benchmark/
php benchmark.php fatfree 50000
Test results (best of 3 on MacBook M2 Pro)
| Runs: 50,000 | Guzzle | HttpSoft | Laminas | Nyholm | Slim | Fatfree |
|---|---|---|---|---|---|---|
| Runs per second | 14412 | 18608 | 17641 | 20549 | 14444 | 22233 |
| Average time per run | 0.0694 ms | 0.0537 ms | 0.0567 ms | 0.0487 ms | 0.0692 ms | 0.0450 ms |
| Total time | 3.4691 s | 2.6869 s | 2.8342 s | 2.4331 s | 3.4616 s | 2.2488 s |
f3-factory/fatfree-psr7 适用场景与选型建议
f3-factory/fatfree-psr7 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 108 次下载、GitHub Stars 达 6, 最近一次更新时间为 2022 年 10 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「psr-7」 「http-message」 「psr-17」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 f3-factory/fatfree-psr7 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 f3-factory/fatfree-psr7 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 f3-factory/fatfree-psr7 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Model of a web-based resource
Simple PHP Library for RESTful APIs
A High Performance API Framework By Swoole Extension
Multipart PSR-7 stream factories based on PSR-17 factories.
Interfaces for web resource models and services to retrieve and create them
Lightweight and strict implementation of PSR-7 HTTP Message including PSR-17 HTTP Factories.
统计信息
- 总下载量: 108
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 19
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-19