pixelfederation/swoole-bundle
Composer 安装命令:
composer require pixelfederation/swoole-bundle
包简介
Swoole Symfony Bundle
README 文档
README
Symfony integration with Open Swoole to speed up your applications.
| Sponsored by: | |
|---|---|
| Blackfire.io | |
| Travis CI |
Build Matrix
| CI Job | Branch master |
Branch develop |
|---|---|---|
| Circle | ||
| CodeCov | ||
| Travis |
Table of Contents
Quick start guide
-
Make sure you have installed proper Open Swoole PHP Extension and pass other requirements.
-
(optional) Create a new symfony project
composer create-project symfony/skeleton project cd ./project -
Install bundle in your Symfony application
composer require pixelfederation/swoole-bundle
-
Edit
config/bundles.phpreturn [ // ...other bundles K911\Swoole\Bridge\Symfony\Bundle\SwooleBundle::class => ['all' => true], ];
-
Run Swoole HTTP Server
bin/console swoole:server:run
-
Enter http://localhost:9501
-
You can now configure bundle according to your needs
Features
-
Built-in API Server
Swoole Bundle API Server allows managing Swoole HTTP Server in real-time.
- Reload worker processes
- Shutdown server
- Access metrics and settings
-
Improved static files serving
Swoole HTTP Server provides a default static files handler, but it lacks supporting many
Content-Types. To overcome this issue, there is a configurable Advanced Static Files Server. Static files serving remains enabled by default in the development environment. Static files directory defaults to%kernel.project_dir%/public. To configure your custom mime types check configuration reference (keyswoole.http_server.static.mime_types). -
Symfony Messenger integration
Available since version:
0.6Swoole Server Task Transport has been integrated into this bundle to allow easy execution of asynchronous actions. Documentation of this feature is available here.
-
Hot Module Reload (HMR) for development ALPHA
Since Swoole HTTP Server runs in Event Loop and does not flush memory between requests, to keep DX equal with normal servers, this bundle uses code replacement technique, using
inotifyPHP Extension to allow continuous development. It is enabled by default (when the extension is found) and requires no additional configuration. You can turn it off in bundle configuration.Remarks: This feature currently works only on a Linux host machine. It probably won't work with Docker, and it is possible that it works only with configuration:
swoole.http_server.running_mode: process(default). -
Access logs, (disabled by default) logs are configurable is a same way as apache mod log. Documentation of this feature is available here.
Requirements
Current version
- PHP version
>= 8.0 - Open Swoole PHP Extension
>= 4.12.1 - Symfony
>= 5.4.0
Future versions
- PHP version
>= 8.2 - Swoole PHP Extension
>= v22.0.0 - Symfony
>= 6.1
Additional requirements to enable specific features:
- Inotify PHP Extension
^2.0.0to use Hot Module Reload (HMR)- When using PHP 8, inotify version
^3.0.0is required
- When using PHP 8, inotify version
Open Swoole
Bundle requires Open Swoole PHP Extension version 4.10.0 or higher. Active bug fixes are provided only for the latest version.
Version check
To check your installed version you can run the following command:
php -r "echo swoole_version() . \PHP_EOL;" # 4.10.0
Installation
Official GitHub repository openswoole/swoole-src contains comprehensive installation guide. The recommended approach is to install it from source.
pixelfederation/swoole-bundle 适用场景与选型建议
pixelfederation/swoole-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.43k 次下载、GitHub Stars 达 33, 最近一次更新时间为 2019 年 04 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「http」 「bundle」 「server」 「async」 「swoole」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pixelfederation/swoole-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pixelfederation/swoole-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pixelfederation/swoole-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
Provide a way to secure accesses to all routes of an symfony application.
DMS Meetup API Bundle, enables Meetup API clients in services
Bundle Symfony DaplosBundle
统计信息
- 总下载量: 11.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 33
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-26