ProcessBuilder::setInput()

ProcessBuilder setInput(resource|scalar|Traversable|null $input) Sets the input of the process. Parameters resource|scalar|Traversable|null $input The input content Return Value ProcessBuilder Exceptions InvalidArgumentException In case the argument is invalid

ProcessBuilder

class ProcessBuilder Process builder. Methods __construct(array $arguments = array()) Constructor. static ProcessBuilder create(array $arguments = array()) Creates a process builder instance. ProcessBuilder add(string $argument) Adds an unescaped argument to the command string. ProcessBuilder setPrefix(string|array $prefix) Adds a prefix to the command string. ProcessBuilder setArguments(array $arguments) Sets the arguments of the process. ProcessBuilder setWorki

ProcessBuilder::enableOutput()

ProcessBuilder enableOutput() Enables fetching output and error output from the underlying process. Return Value ProcessBuilder

ProcessBuilder::add()

ProcessBuilder add(string $argument) Adds an unescaped argument to the command string. Parameters string $argument A command argument Return Value ProcessBuilder

ProcessBuilder::addEnvironmentVariables()

ProcessBuilder addEnvironmentVariables(array $variables) Adds a set of environment variables. Already existing environment variables with the same name will be overridden by the new values passed to this method. Pass null to unset a variable. Parameters array $variables The variables Return Value ProcessBuilder

ProcessBuilder::disableOutput()

ProcessBuilder disableOutput() Disables fetching output and error output from the underlying process. Return Value ProcessBuilder

ProcessBuilder::create()

static ProcessBuilder create(array $arguments = array()) Creates a process builder instance. Parameters array $arguments An array of arguments Return Value ProcessBuilder

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

Process::signal()

Process signal(int $signal) Sends a POSIX signal to the process. Parameters int $signal A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) Return Value Process Exceptions LogicException In case the process is not running RuntimeException In case --enable-sigchild is activated and the process can't be killed RuntimeException In case of failure

Process::wait()

int wait(callable $callback = null) Waits for the process to terminate. 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 valid PHP callback Return Value int The exitcode of the process Exceptions RuntimeException When process timed out RuntimeException When process stopped afte