Giter Site home page Giter Site logo

supervisorbundle's Introduction

SupervisorBundle Build Status

SensioLabsInsight

About

This is the official bundle of the Supervisor PHP library.

Installation

Step 1: Install YZSupervisorBundle using Composer

Add YZSupervisorBundle in your composer.json:

{
    "require": {
        "yzalis/supervisor-bundle": "1.0.*@dev"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update yzalis/supervisor-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:

# app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new YZ\SupervisorBundle\YZSupervisorBundle(),
        // ...
    );
}

Step 3: Configure your config.yml file

# app/config/config.yml
yz_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 a 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
YZSupervisorBundle:
    resource: "@YZSupervisorBundle/Resources/config/routing.xml"
    prefix: /supervisor

Here is the result

Supervisor Bundle screenshot

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

License

Supervisor is released under the MIT License. See the bundled LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.