netlogix/supervisor 问题修复 & 功能扩展

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

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

netlogix/supervisor

最新稳定版本:1.1.3

Composer 安装命令:

composer require netlogix/supervisor

包简介

Create supervisor program groups and programs via CLI.

README 文档

README

This package creates supervisor configuration files via flow CLI.

Configuration files are named "group-something.conf" when they contain a supervisor group configuration or "program-something.conf" when they contain a supervisor program configuration. Both are created at Configuration/Supervisor within your application.

Setup:

Supervisor allows to "include" other files and even allows for globbing.

# cat /etc/supervisor/supervisord.conf [include] files=/etc/supervisor/conf.d/*.conf /var/www/*/Configuration/Supervisor/group.conf /var/www/*/Configuration/Supervisor/program*.conf 

Creating supervisor files dynamically is intended to be a compile time step, preferably on deployment.

Available configuration options:

Program settings get passed to the supervisor configuration file without validation, so every current and future configuration option is available.

See: http://supervisord.org/configuration.html#program-x-section-settings

Available flow commands:

./flow supervisor:create Creates supervisor configuration ./flow supervisor:startgroups Starts all programs of configured groups ./flow supervisor:stopgroups Stops all programs of configured groups ./flow supervisor:updategroups Reloads config and starts/stops programs accordingly 

Create supervisor settings via YAML:

Although supervisor programs can be created entirely via yaml, those are basically static because the yaml configuration format does not provide iteration or dynamic construction mechanisms.

Netlogix: Supervisor: programs: changes-command-controller-polling-action: command: './flow changes:poll ; sleep 5' name: 'this-is-a-program' environment: "FLOW_CONTEXT='%env:FLOW_CONTEXT%'" directory: "%FLOW_PATH_ROOT%"

For more details: See Configuration/Settings.yaml.example

Create supervisor settings via PHP:

There is a Provider interface which allows other packages to hook an and create Supervisor Program settings in a completely programmatic manner.

class Provider implements \Netlogix\Supervisor\Provider { /**  * @return array<\Netlogix\Supervisor\Model\Program>  */ public function getPrograms(): array { $name = 'this-is-a-program'; $groupName = 'default'; $command = './flow changes:poll ; sleep 5'; $programSettings = [ 'environment' => \sprintf( "FLOW_CONTEXT='%s'", Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development' ), 'directory' => \FLOW_PATH_ROOT ]; return [ new \Netlogix\Supervisor\Model\Program( $name, $groupName, $command, $programSettings ); ]; } }

Configure group settings:

Groups are created on demand as soon as a program assigns itself to the group. This means groups don't need to be configured beforehand or even at all.

If no further configuration is presented, the supervisor group name is generated from the "groupName" configuration option of a program.

Groups can override their names. This menas several programs can e.g. refer to the same group "default" but the group can be renamed if different applications share a common supervisor daemon.

This setting also provides a priority setting.

Netlogix: Supervisor: groups: default: name: "%FLOW_PATH_ROOT%" priority: 200

Renamed identifiers:

Both, group names and program names need to be cleaned to comply with supervisors naming scheme. This is done automatically, so even if the group name is configured as %FLOW_PATH_ROOT% it will be transformed to var-www-document-root.

统计信息

  • 总下载量: 217.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固