toolkit

Proc

Runs a command as a child process, array-form so nothing is interpolated into a shell.

Proc:: Phlat\Toolkit\Proc 1 methods
  • run Runs $command in $cwd and waits for it. $timeout (seconds) kills it if it hangs, so a dead remote can't hold the request. $input is written to its stdin; $env is added to the environment.

Methods

run

Proc::run(array $command, ?string $cwd = null, ?int $timeout = null, ?string $input = null, array $env = []): ProcResult

Runs $command in $cwd and waits for it. $timeout (seconds) kills it if it hangs, so a dead remote can't hold the request. $input is written to its stdin; $env is added to the environment.

Parameters (5)
$command array
$cwd ?string = null
$timeout ?int = null
$input ?string = null
$env array = []

Returns ProcResult

phlat/src/Toolkit/Proc.php:18