Skip to content

Commit

Permalink
Issue mikehaertl#6 Modified proc_open() pipe setup on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehaertl committed Jun 30, 2015
1 parent bf2724c commit a3f3aa5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function execute()
} else {
$descriptors = array(
1 => array('pipe','w'),
2 => array('pipe','w'),
2 => array('pipe', $this->getIsWindows() ? 'a' : 'w'),
);
$process = proc_open($command, $descriptors, $pipes, $this->procCwd, $this->procEnv, $this->procOptions);

Expand Down Expand Up @@ -311,6 +311,14 @@ public function execute()
return true;
}

/**
* @return bool whether we are on a Windows OS
*/
public function getIsWindows()
{
return strncasecmp(PHP_OS, 'WIN', 3)===0;
}

/**
* @return string the current command string to execute
*/
Expand Down

0 comments on commit a3f3aa5

Please sign in to comment.