2017 © Pedro Peláez
 

library supervisor-client

PHP library for supervisord

image

mondalaci/supervisor-client

PHP library for supervisord

  • Monday, January 19, 2015
  • by mondalaci
  • Repository
  • 0 Watchers
  • 0 Stars
  • 21,521 Installations
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

DEPRECATION NOTICE, (*1)

Even though this package is known to be fully functional and free of bugs I do not proactively develop it anymore. I try to address issues and PRs but you're rather encouraged to use SupervisorPHP which is a more fully fledged library., (*2)

https://github.com/supervisorphp/supervisor, (*3)

For details see http://supervisorphp.com, (*4)

supervisord PHP client

A PHP client library for supervisor which utilizes its XML-RPC interface., (*5)

This package has been submitted to Packagist so you can install it from there., (*6)

Usage

1) Include the library and import the class:, (*7)

require 'SupervisorClient.php';
use SupervisorClient\SupervisorClient;

2A) Instantiate the client for [unix_http_server] configuration:, (*8)

$supervisor = new SupervisorClient('unix:///var/run/supervisor.sock');

2B) Instantiate the client for [inet_http_server] configuration:, (*9)

$supervisor = new SupervisorClient('YourDomain.com', 9001);

3) Set up authentication and/or connection timeout:, (*10)

$supervisor->setAuth('username', 'password');
$supervisor->setTimeout(10000);  // microseconds

4) Make an RPC call and dump its result:, (*11)

$allProcessInfo = $supervisor->getAllProcessInfo();
var_dump($allProcessInfo);

The dumped result of the RPC call:, (*12)

array(2) {
  [0]=>
  array(14) {
    ["description"]=>
    string(24) "pid 3194, uptime 4:45:46"
    ["pid"]=>
    int(3194)
    ["stderr_logfile"]=>
    string(0) ""
    ["stop"]=>
    int(0)
    ["logfile"]=>
    string(49) "/var/log/supervisor/program1.log"
    ["exitstatus"]=>
    int(0)
    ["spawnerr"]=>
    string(0) ""
    ["now"]=>
    int(1346181399)
    ["group"]=>
    string(25) "group1"
    ["name"]=>
    string(25) "program1"
    ["statename"]=>
    string(7) "RUNNING"
    ["start"]=>
    int(1346164253)
    ["state"]=>
    int(20)
    ["stdout_logfile"]=>
    string(49) "/var/log/supervisor/program1.log"
  }
  [1]=>
  array(14) {
    ["description"]=>
    string(24) "pid 3241, uptime 4:45:45"
    ["pid"]=>
    int(3241)
    ["stderr_logfile"]=>
    string(0) ""
    ["stop"]=>
    int(0)
    ["logfile"]=>
    string(42) "/var/log/supervisor/program2.log"
    ["exitstatus"]=>
    int(0)
    ["spawnerr"]=>
    string(0) ""
    ["now"]=>
    int(1346181399)
    ["group"]=>
    string(8) "group2"
    ["name"]=>
    string(18) "program2"
    ["statename"]=>
    string(7) "RUNNING"
    ["start"]=>
    int(1346164254)
    ["state"]=>
    int(20)
    ["stdout_logfile"]=>
    string(42) "/var/log/supervisor/program2.log"
  }
}

Enjoy!, (*13)

The Versions

19/01 2015

dev-master

9999999-dev

PHP library for supervisord

  Sources   Download

GPL-3.0

The Requires

  • php >=5.3.0
  • ext-xmlrpc *

 

supervisor supervisord