waryway/micro-service-engine
Composer 安装命令:
composer require waryway/micro-service-engine
包简介
ReactPHP server for use in micro-service applications
README 文档
README
Base Service using ReactPHP for PHP only Microservices
Status
Description
Use this microservice engine to power you microservice! It is an extensible router / server base for ReactPHP. It provides an extremely light weight server and router combo.
The closest comparison I can think of, is express for nodejs. Only, this uses PHP!
Usage
Rough steps to getting this up an running. Example coming soon!
- Create your new PHP microservice application
- Make sure it is PSR-4!
- Add a
Routerclass at the base namespace. - The namespace should be something like... <project>
- Run
composer update - 'composer require waryway/micro-service-engine'
- From the root directory of you new project, simply run:
vendor\bin\server.bat <company>\<project> 0.0.0.0:99 - or for linux:
./vendor/bin/server <company>/<project> 0.0.0.0:99
You can also run vendor\bin\server.bat -h for further information.
Router setup
Make sure to extend the BaseRouter. More details to be added in the future!
Setting routes
The microservice engine is using the nikic/fast-route library. You can find path mapping information in the nikic/fast-route readme.
Example Routers
Example Application
https://github.com/Waryway/MicroServiceEngine/blob/master/example/Router.php
Internal Example
For this repository an example from within this this source code can be viewed by first running computer install, then second, running :
php server Waryway\Example 0.0.0.0:89
You'll be able to visit localhost:89/index.html and localhost:89/hi
waryway/micro-service-engine 适用场景与选型建议
waryway/micro-service-engine 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 668 次下载、GitHub Stars 达 2, 最近一次更新时间为 2017 年 11 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 waryway/micro-service-engine 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 waryway/micro-service-engine 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 668
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-19