/**
* Sets the input of the process.
*
- * @param mixed $input The input as a string
+ * @param resource|scalar|\Traversable|null $input The input content
*
* @return $this
*
* @throws InvalidArgumentException In case the argument is invalid
- *
- * Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
*/
public function setInput($input)
{
$arguments = array_merge($this->prefix, $this->arguments);
$script = implode(' ', array_map(array(__NAMESPACE__.'\\ProcessUtils', 'escapeArgument'), $arguments));
+ $process = new Process($script, $this->cwd, $this->env, $this->input, $this->timeout, $options);
+
if ($this->inheritEnv) {
- // include $_ENV for BC purposes
- $env = array_replace($_ENV, $_SERVER, $this->env);
- } else {
- $env = $this->env;
+ $process->inheritEnvironmentVariables();
}
-
- $process = new Process($script, $this->cwd, $env, $this->input, $this->timeout, $options);
-
if ($this->outputDisabled) {
$process->disableOutput();
}