63 public function add($argument)
65 $this->arguments[] = $argument;
144 $this->env[$name] = $value;
162 $this->env = array_replace($this->env, $variables);
197 $this->timeout = null;
223 $this->options[$name] = $value;
235 $this->outputDisabled =
true;
247 $this->outputDisabled =
false;
261 if (0 === count($this->prefix) && 0 === count($this->arguments)) {
262 throw new LogicException(
'You must add() command arguments before calling getProcess().');
267 $arguments = array_merge($this->prefix, $this->arguments);
268 $script = implode(
' ', array_map(
array(__NAMESPACE__.
'\\ProcessUtils',
'escapeArgument'),
$arguments));
270 if ($this->inheritEnv) {
278 if ($this->outputDisabled) {
279 $process->disableOutput();
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
enableOutput()
Enables fetching output and error output from the underlying process.
static create(array $arguments=array())
Creates a process builder instance.
setTimeout($timeout)
Sets the process timeout.
setPrefix($prefix)
Adds a prefix to the command string.
setEnv($name, $value)
Sets an environment variable.
inheritEnvironmentVariables($inheritEnv=true)
Sets whether environment variables will be inherited or not.
setOption($name, $value)
Adds a proc_open option.
static validateInput($caller, $input)
Validates and normalizes a Process input.
Create styles array
The data for the language used.
LogicException for the Process Component.
getProcess()
Creates a Process instance and returns it.
Process is a thin wrapper around proc_* functions to easily start independent PHP processes...
setArguments(array $arguments)
Sets the arguments of the process.
setWorkingDirectory($cwd)
Sets the working directory.
disableOutput()
Disables fetching output and error output from the underlying process.
__construct(array $arguments=array())
Constructor.
setInput($input)
Sets the input of the process.
addEnvironmentVariables(array $variables)
Adds a set of environment variables.
add($argument)
Adds an unescaped argument to the command string.