PHP code example of netlogix / supervisor

1. Go to this page and download the library: Download netlogix/supervisor 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/ */

    

netlogix / supervisor example snippets


class Provider implements \Netlogix\Supervisor\Provider
{
    /**
     * @return array<\Netlogix\Supervisor\Model\Program>
     */
    public function getPrograms(): array
    {
        $name = 'this-is-a-program';
        $groupName = 'default';
        $command = './flow changes:poll ; sleep 5';
        $programSettings = [
            'environment' =>  \sprintf(
                "FLOW_CONTEXT='%s'",
                Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development'
            ),
            'directory' => \FLOW_PATH_ROOT
        ];
        return [
            new \Netlogix\Supervisor\Model\Program(
                $name,
                $groupName,
                $command,
                $programSettings
            );
        ];
    }
}