Amp\Process\Process class Process

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(string|string[] $command, string|null $cwd = null, array $env = [], array $options = [])
No documentation.
Type Parameter Description Default Value
string|string[] $command Command to run. none
string|null $cwd Working directory or use an empty string to use the working directory of the parent. null
array $env Environment variables or use an empty array to inherit from the parent. []
array $options Options for `proc_open()`. []
__destruct — public function __destruct()

Stops the process if it is still running.

__clone — public function __clone()
No documentation.
start — public function start()

Start the process.

join — public function join(): Amp\Process\Promise

Wait for the process to end.

kill — public function kill()

Forcibly end the process.

signal — public function signal(int $signo)

Send a signal signal to the process.

Type Parameter Description Default Value
int $signo Signal number to send to process. none
getPid — public function getPid(): Amp\Promise
No documentation.
getCommand — public function getCommand(): string

Returns the command to execute.

getWorkingDirectory — public function getWorkingDirectory(): string

Gets the current working directory.

getEnv — public function getEnv(): string[]

Gets the environment variables array.

getOptions — public function getOptions(): array

Gets the options to pass to proc_open().

isRunning — public function isRunning(): bool

Determines if the process is still running.

getStdin — public function getStdin(): Amp\Process\ProcessOutputStream

Gets the process input stream (STDIN).

getStdout — public function getStdout(): Amp\Process\ProcessInputStream

Gets the process output stream (STDOUT).

getStderr — public function getStderr(): Amp\Process\ProcessInputStream

Gets the process error stream (STDERR).