phasync
ProcessRunner / __construct

Method

ProcessRunner::__construct

Starts the process.

Description#

public ProcessRunner::__construct(
    array $command,
    ?string $cwd = null,
    ?array $env = null
)

Parameters#

$command array
The executable and its arguments, one element each
$cwd ?string = null
The working directory of the child; null: the current one
$env ?array = null
The environment of the child, replacing the current one; null: inherit it

Errors / Exceptions#

ExceptionWhen
RuntimeExceptionIf the command is not found or not executable, or cannot be started
LogicExceptionOn Windows before PHP 8.3