GithubHelp home page GithubHelp logo

isabella232 / supervisord-php-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raventools/supervisord-php-client

0.0 0.0 0.0 176 KB

PHP client library for supervisord which utilizes its XML-RPC interface

License: GNU General Public License v3.0

supervisord-php-client's Introduction

supervisord PHP client

A PHP client library for supervisor which utilizes its XML-RPC interface.

This package has been submitted to Packagist so you can install it from there.

Usage

  1. Include the library and import the class:
require 'SupervisorClient.php';
use SupervisorClient\SupervisorClient;
  1. Instantiate the client for [unix_http_server] configuration:
$supervisor = new SupervisorClient('unix:///var/run/supervisor.sock');

or

  1. Instantiate the client for [inet_http_server] configuration:
$supervisor = new SupervisorClient('YourDomain.com', 9001);
  1. Make an RPC call and dump its result:
$all_process_info = $supervisor->getAllProcessInfo();
var_dump($all_process_info);

The dumped result of the RPC call:

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!

supervisord-php-client's People

Contributors

mondalaci avatar ivan1986 avatar glaslos avatar stelian avatar chaud avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.