class ProcessBuilder
deprecated
__construct(array $arguments = array()) | ||
static ProcessBuilder | create(array $arguments = array()) Creates a process builder instance. | |
$this | add(string $argument) Adds an unescaped argument to the command string. | |
$this | setPrefix(string|array $prefix) Adds a prefix to the command string. | |
$this | setArguments(array $arguments) Sets the arguments of the process. | |
$this | setWorkingDirectory(null|string $cwd) Sets the working directory. | |
$this | inheritEnvironmentVariables(bool $inheritEnv = true) Sets whether environment variables will be inherited or not. | |
$this | setEnv(string $name, null|string $value) Sets an environment variable. | |
$this | addEnvironmentVariables(array $variables) Adds a set of environment variables. | |
$this | setInput(resource|scalar|Traversable|null $input) Sets the input of the process. | |
$this | setTimeout(float|null $timeout) Sets the process timeout. | |
$this | setOption(string $name, string $value) Adds a proc_open option. | |
$this | disableOutput() Disables fetching output and error output from the underlying process. | |
$this | enableOutput() Enables fetching output and error output from the underlying process. | |
Process | getProcess() Creates a Process instance and returns it. |
array | $arguments | An array of arguments |
Creates a process builder instance.
array | $arguments | An array of arguments |
ProcessBuilder |
Adds an unescaped argument to the command string.
string | $argument | A command argument |
$this |
Adds a prefix to the command string.
The prefix is preserved when resetting arguments.
string|array | $prefix | A command prefix or an array of command prefixes |
$this |
Sets the arguments of the process.
Arguments must not be escaped. Previous arguments are removed.
array | $arguments |
$this |
Sets the working directory.
null|string | $cwd | The working directory |
$this |
Sets whether environment variables will be inherited or not.
bool | $inheritEnv |
$this |
Sets an environment variable.
Setting a variable overrides its previous value. Use null
to unset a defined environment variable.
string | $name | The variable name |
null|string | $value | The variable value |
$this |
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.
array | $variables | The variables |
$this |
Sets the input of the process.
resource|scalar|Traversable|null | $input | The input content |
$this |
InvalidArgumentException | In case the argument is invalid |
Sets the process timeout.
To disable the timeout, set this value to null.
float|null | $timeout |
$this |
InvalidArgumentException |
Adds a proc_open option.
string | $name | The option name |
string | $value | The option value |
$this |
Disables fetching output and error output from the underlying process.
$this |
Enables fetching output and error output from the underlying process.
$this |
Creates a Process instance and returns it.
Process |
LogicException | In case no arguments have been provided |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Process/ProcessBuilder.html