class ProcessTools (View source)

Methods

static bool
term(int $pid, int $lagger_timeout = 0, int $signal = SIGTERM)

Terminate a process, asking PID to terminate or killing it directly.

static bool
kill(int $pid)

Kill a process

static 
signal($pid, $signal = SIGUSR1)

No description

static bool
isRunning(int $pid)

Return true if process is still running, false otherwise

static int
getNiceness(int|null $pid = null)

Get niceness of a running process

static bool
setNiceness($niceness, $pid = null)

Set niceness of a running process

static int
getPid()

Get current process PID

Details

static bool term(int $pid, int $lagger_timeout = 0, int $signal = SIGTERM)

Terminate a process, asking PID to terminate or killing it directly.

Parameters

int $pid
int $lagger_timeout Timeout to wait before killing process if it refuses to terminate
int $signal Signal to send (default to SIGTERM)

Return Value

bool

static bool kill(int $pid)

Kill a process

Parameters

int $pid

Return Value

bool

static signal($pid, $signal = SIGUSR1)

Parameters

$pid
$signal

static bool isRunning(int $pid)

Return true if process is still running, false otherwise

Parameters

int $pid

Return Value

bool

static int getNiceness(int|null $pid = null)

Get niceness of a running process

Parameters

int|null $pid The pid to query, or current process if null

Return Value

int

static bool setNiceness($niceness, $pid = null)

Set niceness of a running process

Parameters

$niceness
$pid

Return Value

bool

static int getPid()

Get current process PID

Return Value

int