Process::run()

int run(callable|null $callback = null) Runs the process. The callback receives the type of output (out or err) and some bytes from the output in real-time. It allows to have feedback from the independent process during execution. The STDOUT and STDERR are also available after the process is finished via the getOutput() and getErrorOutput() methods. Parameters callable|null $callback A PHP callback to run whenever there is some output available on STDOUT or STDERR Return Value

Process::setEnhanceWindowsCompatibility()

Process setEnhanceWindowsCompatibility(bool $enhance) Sets whether or not Windows compatibility is enabled. Parameters bool $enhance Return Value Process The current Process instance

Process::setEnhanceSigchildCompatibility()

Process setEnhanceSigchildCompatibility(bool $enhance) Activates sigchild compatibility mode. Sigchild compatibility mode is required to get the exit code and determine the success of a process when PHP has been compiled with the --enable-sigchild option Parameters bool $enhance Return Value Process The current Process instance

Process::isTerminated()

bool isTerminated() Checks if the process is terminated. Return Value bool true if process is terminated, false otherwise

Process::mustRun()

Process mustRun(callable $callback = null) Runs the process. This is identical to run() except that an exception is thrown if the process exits with a non-zero exit code. Parameters callable $callback Return Value Process Exceptions RuntimeException if PHP was compiled with --enable-sigchild and the enhanced sigchild compatibility mode is not enabled ProcessFailedException if the process didn't terminate successfully

Process::restart()

Process restart(callable $callback = null) Restarts the process. Be warned that the process is cloned before being started. Parameters callable $callback A PHP callback to run whenever there is some output available on STDOUT or STDERR Return Value Process The new process Exceptions RuntimeException When process can't be launched RuntimeException When process is already running See also start()

Process::isTty()

bool isTty() Checks if the TTY mode is enabled. Return Value bool true if the TTY mode is enabled, false otherwise

Process::isPty()

bool isPty() Returns PTY state. Return Value bool

Process::isStarted()

bool isStarted() Checks if the process has been started with no regard to the current state. Return Value bool true if status is ready, false otherwise

Process::isSuccessful()

bool isSuccessful() Checks if the process ended successfully. Return Value bool true if the process ended successfully, false otherwise