lotharthesavior/hot-reactor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lotharthesavior/hot-reactor

Composer 安装命令:

composer require lotharthesavior/hot-reactor

包简介

Hot Reload Tool.

README 文档

README

Hot Reactor is Hot Reload mechanism for applications. It is built with OpenSwoole development in mind, but it reloads specific commands based on the file changes.

You can install it via composer install or download the project and arrange the .env file with the proper settings.

Setup

There are 2 ways to run the Hot Reactor:

Option 1: run other folders

To run services located in other directories:

Check the .env file for the settings you need to update. The following are the steps to follow:

  • Step 1: update the WORKING_DIR environment setting, to point to the directory where the service is located. default: /var/www/html/
  • Step 2: update the COMMAND environment setting, to point to the command you want to run. default: /usr/bin/php server.php
  • Step 3: update the OBJECTS environment setting, to point to the files you want to watch for changes. default: /var/www/html/|/var/www/html/features/
  • Step 4: update the MAIN_PROCESS_NAME environment setting, to customzie your main process name. default: hot-reactor
  • Step 5: update FILE_EXTENSIONS environment setting, to specify the file extensions to watch for changes. default: php|env

Hot Reactor comes with a command line tool to run the Hot Reactor. You can run the following command to start the Hot Reactor:

php index.php -w "/path/to/your/service" -c "your-command" -o "your-objects"

As in the example, you can also overwrite the WORKING_DIR, COMMAND and OBJECTS settings via command options.

Option 2: install hot reloaded via composer

To install Hot Reactor via composer, you can run the following command:

composer require lotharthesavior/hot-reactor

After installing the package, you can run the following command to start the Hot Reactor:

vendor/bin/hot-reactor -w "/path/to/your/service" -c "your-command" -o "your-objects"

Important: There is a bug related to when you want to restart an app running sub processes with OpenSwoole\Process. Then, you might need to wait for a SIGKILL at the end of the file so the app restarts gracefully. You do that by adding the following code:

Co::run(function () {
    System::waitSignal(SIGKILL, -1);
});

Contributors

We welcome contributions from everyone! If you're interested in helping improve Hot Reactor, please follow these steps:

  1. Fork the repository on GitHub.
  2. Make your changes in a branch named for the feature or fix you're working on.
  3. Submit a pull request through GitHub for review.

Please make sure your contributions adhere to the following guidelines:

  • Code contributions should follow the coding style already established in the project.
  • Include comments in your code where necessary to explain complex or non-obvious parts.
  • Update the README.md if your changes require it.
  • Ensure that your code does not introduce any new bugs or security vulnerabilities.

Thank you for considering contributing to Hot Reactor!

License

Hot Reactor is open-source software licensed under the MIT license. See the LICENSE file for more details.

lotharthesavior/hot-reactor 适用场景与选型建议

lotharthesavior/hot-reactor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 lotharthesavior/hot-reactor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lotharthesavior/hot-reactor 我们能提供哪些服务?
定制开发 / 二次开发

基于 lotharthesavior/hot-reactor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 13
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-14