Process::start()

start(callable $callback = null)

Starts the process and returns after writing the input to STDIN.

This method blocks until all STDIN data is sent to the process then it returns while the process runs in the background.

The termination of the process can be awaited with wait().

The callback receives the type of output (out or err) and some bytes from the output in real-time while writing the standard input to the process. It allows to have feedback from the independent process during execution.

Parameters

callable $callback A PHP callback to run whenever there is some output available on STDOUT or STDERR

Exceptions

RuntimeException When process can't be launched
RuntimeException When process is already running
LogicException In case a callback is provided and output has been disabled
doc_Symfony
2016-10-28 06:27:02
Comments
Leave a Comment

Please login to continue.