Manage Supervisor configuration in PHP

v0.2.1 2016-05-08 22:49 UTC

This package is auto-updated.

Last update: 2020-02-03 23:22:35 UTC


Latest Version Software License Build Status Code Coverage Quality Score Total Downloads

Manage Supervisor configuration in PHP.


Via Composer

$ composer require supervisorphp/configuration


Create a configuration using the builder.

use Supervisor\Configuration\Configuration;
use Supervisor\Configuration\Section\Supervisord;
use Supervisor\Configuration\Section\Program;
use Indigo\Ini\Renderer;

$config = new Configuration;
$renderer = new Renderer;

$section = new Supervisord(['identifier' => 'supervisor']);

$section = new Program('test', ['command' => 'cat']);

echo $renderer->render($config->toArray());

The following sections are available in this pacakge:

  • Supervisord
  • Supervisorctl
  • UnixHttpServer
  • InetHttpServer
  • Includes**
  • Group*
  • Program*
  • EventListener*
  • FcgiProgram*

*Note: These sections has to be instantiated with a name and optionally a properties array:

$section = new Program('test', ['command' => 'cat']);

**Note: The keyword include is reserved in PHP, so the class name is Includes, but the section name is still include.

Existing configuration

You can parse your existing configuration, and use it as a Configuration object.

use Supervisor\Configuration\Configuration;
use Supervisor\Configuration\Loader\IniFileLoader;

$parser = new File('/etc/supervisor/supervisord.conf');

$configuration = new Configuration;

// argument is optional, returns a new Configuration object if not passed

Available parsers:

Writting configuration

You can use Writers to write configuration to various destinations.

use Supervisor\Configuration;
use Supervisor\Configuration\Writer\File;

// As a second parameter you can optionally pass an instance of Supervisor\Configuration\Renderer
$writer = new File('/etc/supervisor/supervisord.conf');

$configuration = new Configuration;


Available writers:

You can find detailed info about properties for each section here:


$ composer test


Please see CONTRIBUTING for details.



The MIT License (MIT). Please see License File for more information.