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

int The exit status code

Exceptions

RuntimeException When process can't be launched
RuntimeException When process stopped after receiving signal
LogicException In case a callback is provided and output has been disabled
doc_Symfony
2016-10-28 06:26:59
Comments
Leave a Comment

Please login to continue.