An object for asynchronously spawning and managing an external process.
Process::__construct(string $command, string $cwd = '', array $env = , array $options = )
Creates a new process. The process will be run by executing the command specified by
The working directory can be set by specifying
$cwd is empty, the process will inherit the working directory of the current process.
Additional environment variables can be passed to the process by passing in an array of values to
$env, where keys and values correspond to the names of the variables and their values.
Starts the process execution.
Resolves when the process ends.
Coroutine: Calls to this function must be preceded with
yield within another coroutine or wrapped with
new Coroutine() to create an awaitable.
Forcefully kills the process.
Process::signal(int $signo): void
Sends the given POSIX process signal to the running process.
- A POSIX signal number. Use constants such as
Returns the PID of the child process. Value is only meaningful if the process has been started and PHP was not compiled with
Gets the command to execute. Returns the current working directory or null if inherited from the current PHP process.
Gets the current working directory.
Gets an associative array of environment variables passed to the process.
Gets the options to pass to
Determines if the process is still running.
Gets the process input stream (STDIN).
Gets the process output stream (STDERR).
Gets the process error stream (STDOUT).Next: Process