onion/swoole
Composer 安装命令:
composer require onion/swoole
包简介
Compatibility package for Swoole support of Onion applications
README 文档
README
This is a minimal wrapper that handles the creation of the Swoole\Http\Server and it's
initialization and allows any application already written using onion/framework to
"just work" with the app server.
Configuration
This package's default factories require minor configuration additions in order to get up and running:
Config
<?php ### Configuration return [ 'application' => [ 'server' => [ 'address' => '', // The address on which to bind the app server. Binds on '0.0.0.0' if none is provided 'port' => 1234, // The port on which the server to listen. A random one will be used if none is provided 'options' => [ // A list of options that is being passed directly to `Swoole\Http\Server::set()` for configuration ] ] ] ];
Dependencies
<?php return [ 'factories' => [ // ... Definitions // The base application is still in use, just make sure to register it directly as class name \Onion\Framework\Application\Application::class => \Onion\Framework\Application\Factory\ApplicationFactory::class, // The app server \Swoole\Http\Server::class => \Onion\Extra\Swoole\Factory\HttpServerFactory::class, // The definition of the application wrapper \Onion\Framework\Application\Interfaces\ApplicationInterface::class => \Onion\Framework\Application\Factory\SwooleApplicationFactory::class, // ... More definitions ], ];
Note that we assume that you have something similar to the following in your index.php file:
<?php // Bootstrap /** * Note the usage of the ApplicationInterface to fetch the application instance, * this (or your equivalent) key should be changed to return the SwooleApplication * instance */ $container->get(\Onion\Framework\Application\Interfaces\ApplicationInterface::class) ->run(); // Note the ServerRequest::fromGlobals() is not necessary here, so it can be omitted
onion/swoole 适用场景与选型建议
onion/swoole 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 46 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 05 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 onion/swoole 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 onion/swoole 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 46
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-07