yiisoft/yii-http
Composer 安装命令:
composer require yiisoft/yii-http
包简介
Yii HTTP Application
关键字:
README 文档
README
Yii HTTP Application
This Yii framework package provides the application class, as well as the events and handlers needed to interact with HTTP. The package is implemented using PSR-7 interfaces.
Requirements
- PHP 8.1 - 8.5.
Installation
The package could be installed with Composer:
composer require yiisoft/yii-http
General usage
In case you use one of the Yii 3 standard application templates, then the application is already configured there and is running using yiisoft/yii-runner-http package.
If not, then use one of the HTTP runners that is suitable for your environment:
and create an entry script as described in readme of the packages.
If you do not use Yii HTTP runners, then the code for launching the application in your entry script may look like this:
use Yiisoft\Yii\Http\Application; use Yiisoft\Yii\Http\Handler\NotFoundHandler; use Yiisoft\Yii\Http\Handler\ThrowableHandler; /** * @var Psr\EventDispatcher\EventDispatcherInterface $eventDispatcher * @var Psr\Http\Message\ResponseFactoryInterface $responseFactory * @var Psr\Http\Message\ServerRequestInterface $request * @var Yiisoft\ErrorHandler\Middleware\ErrorCatcher $errorCatcher * @var Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher $dispatcher */ $fallbackHandler = new NotFoundHandler($responseFactory); $application = new Application($dispatcher, $eventDispatcher, $fallbackHandler); try { $application->start(); $response = $application->handle($request); // Emit a response. } catch (Throwable $throwable) { $handler = new ThrowableHandler($throwable); $response = $errorCatcher->process($request, $handler); // Emit a response with information about the error. } finally { $application->afterEmit($response ?? null); $application->shutdown(); }
Documentation
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii HTTP Application is free software. It is released under the terms of the BSD License.
Please see LICENSE for more information.
Maintained by Yii Software.
Support the project
Follow updates
yiisoft/yii-http 适用场景与选型建议
yiisoft/yii-http 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 237.42k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2021 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「http」 「application」 「yii」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yiisoft/yii-http 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yiisoft/yii-http 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yiisoft/yii-http 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Kinikit - PHP Application development framework MVC component
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
A Laravel queue connector to process jobs at the end of the application
Priveate for SkeekS CMS
C3JS By phpanonymous (Mahmoud Ibrahim)
统计信息
- 总下载量: 237.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 24
- 依赖项目数: 41
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-11-10