Amp\Process\Process classProcess

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 functionstart()

Start the process.

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

Wait for the process to end.

kill —public functionkill()

Forcibly end the process.

signal —public functionsignal(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 functiongetPid():Amp\Promise
No documentation.
getCommand —public functiongetCommand():string

Returns the command to execute.

getWorkingDirectory —public functiongetWorkingDirectory():string

Gets the current working directory.

getEnv —public functiongetEnv():string[]

Gets the environment variables array.

getOptions —public functiongetOptions():array

Gets the options to pass to proc_open().

isRunning —public functionisRunning():bool

Determines if the process is still running.

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

Gets the process input stream (STDIN).

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

Gets the process output stream (STDOUT).

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

Gets the process error stream (STDERR).