PHP code example of francodacosta / supervisord

1. Go to this page and download the library: Download francodacosta/supervisord library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

francodacosta / supervisord example snippets


<

ancodacosta\Supervisord\Loader\ArrayLoader;
use Francodacosta\Supervisord\Configuration;
use Francodacosta\Supervisord\Processors\CommandConfigurationProcessor;

// setup supervisord config object, with a processor for command entries
$configuration = new Configuration;
$configuration->registerProcessor(new CommandConfigurationProcessor);

// configuration to generate
$config = array(
    'programs' => array(
        'cat command' => array('command' => 'tail -f /var/log/messages'),
        'ls command' => array('command' => 'ls -la', 'numprocs' => 3),
    )
);

// load the configuration object from the $config array
$loader = new ArrayLoader($config, $configuration);
$supervisordConfig = $loader->load();

// dump the generate configuration
echo $supervisordConfig->generate();