Skip to content

Infinitiweb/yii2-supervisor-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supervisor manager

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist infinitiweb/yii2-supervisor-manager "^1.1"

or add

"infinitiweb/yii2-supervisor-manager": "^1.1"

to the require section of your composer.json file.

Usage

Add module of extension in app config:

...
    'modules' => [
    ...
        'supervisorManager' => [
            'class' => 'infinitiweb\supervisorManager\Module',
            'authData' => [
                'user' => 'supervisor_user',
                'password' => 'supervisor_pass',
                'url' => 'http://127.0.0.1:9001/RPC2',
            ],
            'supervisorConfiguration' => [
                'configDir' => \Yii::getAlias('@common/config/supervisor'),
                'access' => [
                    'class' => AccessControl::class,
                    'rules' => [
                        [
                            'allow' => true,
                            'roles' => ['@'],
                        ],
                    ],
                ],
            ],
        ],
    ...
    ],
...

Simply use it in your code by:

<?php

use infinitiweb\supervisorManager\widgets\supervisor\SupervisorManagerWidget;

echo SupervisorManagerWidget::widget();

?>