Methods |
public
|
__construct()
|
#
|
public
|
kill(int $pid): bool
Terminal a process with SIGKILL
Terminal a process with SIGKILL
Parameters
|
#
|
public
|
signal(int $pid, int $signal = self::SIGKILL): bool
Send a POSIX signal a process
Send a POSIX signal a process
|
#
|
public
|
stat(int $pid): array
Stat a running process
|
#
|
public
|
pcount(): int
Get active process count
Get active process count
Count is fetched from cache. {@see flush} may be necessary
|
#
|
public
|
flush(): bool
Flush process accumulator cache
Flush process accumulator cache
|
#
|
public
|
get_processes(): array
Get all processes
|
#
|
public
|
run(string $cmd, array $args = null, array $env = null, array $options = []): bool|array
Run a process
Run a process
Sample response:
Array
(
[stdin] =>
[stdout] => Hello World!!!
[0] => Hello World!!!
[stderr] =>
[1] =>
[output] => Hello World!!!
[errno] => 0
[return] => 0
[error] =>
[success] => 1
)
Parameters
$cmd |
process name, format specifiers allowed
|
$args |
optional arguments to supply to format
|
$env |
optional environment vars to set
|
$options |
optional options, tee: set tee output to file, user: run as user if site admin
|
|
#
|
public
|
schedule_api_cmd($cmd, array|null $args = [], string $when = 'now')
Background an apnscp function with an optional delay
Background an apnscp function with an optional delay
|
#
|