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::setTty()

Process setTty(bool $tty) Enables or disables the TTY mode. Parameters bool $tty True to enabled and false to disable Return Value Process The current Process instance Exceptions RuntimeException In case the TTY mode is not supported

Process::setPty()

Process setPty(bool $bool) Sets PTY mode. Parameters bool $bool Return Value Process

Process::setWorkingDirectory()

Process setWorkingDirectory(string $cwd) Sets the current working directory. Parameters string $cwd The new working directory Return Value Process The current Process instance

Process::setTimeout()

Process setTimeout(int|float|null $timeout) Sets the process timeout (max. runtime). To disable the timeout, set this value to null. Parameters int|float|null $timeout The timeout in seconds Return Value Process The current Process instance Exceptions InvalidArgumentException if the timeout is negative

Process::setOptions()

Process setOptions(array $options) Sets the options for proc_open. Parameters array $options The new options Return Value Process The current Process instance

Process::setEnv()

Process setEnv(array $env) Sets the environment variables. An environment variable value should be a string. If it is an array, the variable is ignored. That happens in PHP when 'argv' is registered into the $_ENV array for instance. Parameters array $env The new environment variables Return Value Process The current Process instance

Process::setInput()

Process setInput(resource|scalar|Traversable|null $input) Sets the input. This content will be passed to the underlying process standard input. Parameters resource|scalar|Traversable|null $input The content Return Value Process The current Process instance Exceptions LogicException In case the process is running

Process::setIdleTimeout()

Process setIdleTimeout(int|float|null $timeout) Sets the process idle timeout (max. time since last output). To disable the timeout, set this value to null. Parameters int|float|null $timeout The timeout in seconds Return Value Process The current Process instance Exceptions LogicException if the output is disabled InvalidArgumentException if the timeout is negative

Process::setCommandLine()

Process setCommandLine(string $commandline) Sets the command line to be executed. Parameters string $commandline The command to execute Return Value Process The current Process instance