/processes

Get list of processes on windows, linux or mac. Check existence if you have a PID.

Primary LanguagePHPMIT LicenseMIT

Devium\Processes Build Status

Installation

composer require devium/processes

Usage

use Devium\Processes\Processes;

// some PID, integer
$pid = 1234;
// get all processes except both session leaders, default false
$all = true;

$processes = new Processes($all);
$processes->get() // return array of processes where key is PID
$processes->exists($pid) // true or false

Structure of processes array

For windows

{
  "PID": {
    "pid": "integer",
    "ppid": "integer",
    "name": "string"
  }
}

For unix-like systems

{
  "PID": {
    "pid": "integer",
    "ppid": "integer",
    "name": "string",
    "uid": "integer",
    "cpu": "float",
    "memory": "float",
    "cmd": "string"
  }
}

Testing

composer test

License

The Devium\Processes package is open-sourced software licensed under the MIT license.