Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused options passed to proc_open() (Windows only) #62

Merged
merged 1 commit into from
Nov 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Process extends EventEmitter
private $cmd;
private $cwd;
private $env;
private $options;
private $enhanceSigchildCompatibility;
private $pipes;

Expand All @@ -40,13 +39,12 @@ class Process extends EventEmitter
/**
* Constructor.
*
* @param string $cmd Command line to run
* @param string $cwd Current working directory or null to inherit
* @param array $env Environment variables or null to inherit
* @param array $options Options for proc_open()
* @throws LogicException On windows or when proc_open() is not installed
* @param string $cmd Command line to run
* @param null|string $cwd Current working directory or null to inherit
* @param null|array $env Environment variables or null to inherit
* @throws \LogicException On windows or when proc_open() is not installed
*/
public function __construct($cmd, $cwd = null, array $env = null, array $options = array())
public function __construct($cmd, $cwd = null, array $env = null)
{
if (substr(strtolower(PHP_OS), 0, 3) === 'win') {
throw new \LogicException('Windows isn\'t supported due to the blocking nature of STDIN/STDOUT/STDERR pipes.');
Expand All @@ -66,7 +64,6 @@ public function __construct($cmd, $cwd = null, array $env = null, array $options
}
}

$this->options = $options;
$this->enhanceSigchildCompatibility = $this->isSigchildEnabled();
}

Expand Down Expand Up @@ -99,7 +96,7 @@ public function start(LoopInterface $loop, $interval = 0.1)
$cmd = sprintf('(%s) 3>/dev/null; code=$?; echo $code >&3; exit $code', $cmd);
}

$this->process = proc_open($cmd, $fdSpec, $this->pipes, $this->cwd, $this->env, $this->options);
$this->process = proc_open($cmd, $fdSpec, $this->pipes, $this->cwd, $this->env);

if (!is_resource($this->process)) {
throw new \RuntimeException('Unable to launch a new process.');
Expand Down