PHP code example of devium / processes
1. Go to this page and download the library: Download devium/processes 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/ */
devium / processes example snippets
use Devium\Processes\Processes;
// some PID, integer
$pid = 1234;
// get all processes except both session leaders, default false
$all = true;
$processes = new Processes($all);
$exists = $processes->exists($pid); // returns true of false
$arrayOfProcesses = $processes->get(); // returns array of processes where key is PID
// for rescanning processes, call rescan() method
$newArrayOfProcesses = $processes->rescan()->get();
// if you only need an array of processes, just use the static asArray():
$listOfProcesses = Processes::asArray();