public function ProcessBuilder::getProcess

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php, line 155

Class

ProcessBuilder
Process builder.

Namespace

Symfony\Component\Process

Code

public function getProcess() {
  if (!$this->prefix && !count($this->arguments)) {
    throw new LogicException('You must add() command arguments before calling getProcess().');
  }
  $options = $this->options;
  $arguments = $this->prefix ? array_merge(array(
    $this->prefix,
  ), $this->arguments) : $this->arguments;
  $script = implode(' ', array_map(array(
    __NAMESPACE__ . '\\ProcessUtils',
    'escapeArgument',
  ), $arguments));
  if ($this->inheritEnv) {
    $env = $this->env ? $this->env + $_ENV : null;
  }
  else {
    $env = $this->env;
  }
  return new Process($script, $this->cwd, $env, $this->stdin, $this->timeout, $options);
}