indydevguy/supervisor-bundle
Composer 安装命令:
composer require indydevguy/supervisor-bundle
包简介
Manage your supervisor instance in your Symfony application.
README 文档
README
About
This started out as a clone of YZSupervisorBundle, but since YZSupervisorBundle is no longer around I have modified it and updated it for the newest version of Symfony and PHP 7.4+.
This bundle allows you to administer your Supervisor Programs on your Symfony Application with a nice Bootstrap UI!
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require indydevguy/supervisor-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the bundle
Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project (if it doesn't exist yet):
<?php // config/bundles.php return [ // ... IndyDevGuy\Bundle\SupervisorBundle\IDGSupervisorBundle::class => ['all' => true], // ... ];
Step 3: Configure your config.yml file
# app/config/config.yml idg_supervisor: default_environment: dev servers: prod: SUPERVISOR_01: host: 192.168.0.1 username: guest password: password port: 9001 SUPERVISOR_02: host: 192.168.0.2 username: guest password: password port: 9001 dev: locahost: host: 127.0.0.1 username: guest password: password port: 9001 groups: ['example_site']
The group option limits access to specific process groups. When no groups are provided, all groups are listed.
Usage
Iterate over all supervisor servers:
$supervisorManager = $this->container->get('supervisor.manager'); foreach ($supervisorManager->getSupervisors() as $supervisor) { echo $supervisor->getKey(); // ... }
Retrieve specific supervisor servers:
$supervisorManager = $this->container->get('supervisor.manager');
$supervisor = $supervisorManager->getSupervisorByKey('uniqueKey');
echo $supervisor->getKey();
User interface
You can access to a beautiful user interface to monitor all your supervisor servers an process.
Import the routing definition in routing.yml:
# app/config/routing.yml IDGSupervisorBundle: resource: "@IDGSupervisorBundle/Resources/config/routing.yaml" prefix: /supervisor
Here is the result
Unit Tests
To run unit tests, you'll need a set of dependencies you can install using Composer:
php composer.phar install
Once installed, just launch the following command:
phpunit
You're done.
Credits
- Benjamin Laugueux benjamin@yzalis.com
- IndyDevGuy
- All contributors
License
Supervisor is released under the MIT License. See the bundled LICENSE file for details.
统计信息
- 总下载量: 224
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-14
