2017 © Pedro Peláez
 

library supervisor-configuration

Manage Supervisor configuration in PHP

image

indigophp/supervisor-configuration

Manage Supervisor configuration in PHP

  • Wednesday, January 14, 2015
  • by mark.sagikazar
  • Repository
  • 0 Watchers
  • 0 Stars
  • 192 Installations
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Indigo Supervisor Configuration

Latest Version Software License Build Status Code Coverage Quality Score HHVM Status Total Downloads Dependency Status, (*1)

Manage Supervisor configuration in PHP., (*2)

Install

Via Composer, (*3)

``` bash $ composer require indigophp/supervisor-configuration, (*4)


## Usage Create a configuration using the builder. ``` php use Indigo\Supervisor\Configuration; use Indigo\Supervisor\Configuration\Section\Supervisord; use Indigo\Supervisor\Configuration\Section\Program; use Indigo\Supervisor\Configuration\Renderer; $config = new Configuration; $renderer = new Renderer; $section = new Supervisord(['identifier' => 'supervisor']); $config->addSection($section); $section = new Program('test', ['command' => 'cat']); $config->addSection($section); echo $renderer->render($config);

The following sections are available in this pacakge:, (*5)

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

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

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


**__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. ``` php use Indigo\Supervisor\Configuration; use Indigo\Supervisor\Configuration\Parser\File; $parser = new File('/etc/supervisor/supervisord.conf'); $configuration = new Configuration; // argument is optional, returns a new Configuration object if not passed $parser->parse($configuration);

Available parsers:, (*8)

Writting configuration

You can use Writers to write configuration to various destinations., (*9)

``` php use Indigo\Supervisor\Configuration; use Indigo\Supervisor\Configuration\Writer\File;, (*10)

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

$configuration = new Configuration;, (*12)

$writer->write($configuration);, (*13)


Available writers: - _File_ - _Filesystem_ (Using [league/flysystem](https://github.com/thephpleague/flysystem)) You can find detailed info about properties for each section here: [http://supervisord.org/configuration.html](http://supervisord.org/configuration.html) ## Testing ``` bash $ phpspec run

Contributing

Please see CONTRIBUTING for details., (*14)

Credits

License

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

The Versions

14/01 2015

dev-develop

dev-develop https://indigophp.com

Manage Supervisor configuration in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

configuration supervisor

04/01 2015

dev-master

9999999-dev https://indigophp.com

Manage Supervisor configuration in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

configuration supervisor

04/01 2015

v0.1.0

0.1.0.0 https://indigophp.com

Manage Supervisor configuration in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

configuration supervisor