ProcessBuilder
class ProcessBuilder
Process builder.
Methods
Constructor.
Creates a process builder instance.
Adds an unescaped argument to the command string.
Adds a prefix to the command string.
Sets the arguments of the process.
Sets the working directory.
Sets whether environment variables will be inherited or not.
Sets an environment variable.
Adds a set of environment variables.
Sets the input of the process.
Sets the process timeout.
Adds a proc_open option.
Disables fetching output and error output from the underlying process.
Enables fetching output and error output from the underlying process.
Creates a Process instance and returns it.
Details
at line line 39
__construct(array $arguments = array())
Constructor.
at line line 51
static ProcessBuilder
create(array $arguments = array())
Creates a process builder instance.
at line line 63
ProcessBuilder
add(string $argument)
Adds an unescaped argument to the command string.
at line line 79
ProcessBuilder
setPrefix(string|array $prefix)
Adds a prefix to the command string.
The prefix is preserved when resetting arguments.
at line line 96
ProcessBuilder
setArguments(array $arguments)
Sets the arguments of the process.
Arguments must not be escaped. Previous arguments are removed.
at line line 110
ProcessBuilder
setWorkingDirectory(null|string $cwd)
Sets the working directory.
at line line 124
ProcessBuilder
inheritEnvironmentVariables(bool $inheritEnv = true)
Sets whether environment variables will be inherited or not.
at line line 142
ProcessBuilder
setEnv(string $name, null|string $value)
Sets an environment variable.
Setting a variable overrides its previous value. Use null
to unset a
defined environment variable.
at line line 160
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.
at line line 176
ProcessBuilder
setInput(mixed $input)
Sets the input of the process.
at line line 194
ProcessBuilder
setTimeout(float|null $timeout)
Sets the process timeout.
To disable the timeout, set this value to null.
at line line 221
ProcessBuilder
setOption(string $name, string $value)
Adds a proc_open option.
at line line 233
ProcessBuilder
disableOutput()
Disables fetching output and error output from the underlying process.
at line line 245
ProcessBuilder
enableOutput()
Enables fetching output and error output from the underlying process.
at line line 259
Process
getProcess()
Creates a Process instance and returns it.