Skip to content

Commit a3f3aa5

Browse files
committed
Issue mikehaertl#6 Modified proc_open() pipe setup on Windows
1 parent bf2724c commit a3f3aa5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Command.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public function execute()
283283
} else {
284284
$descriptors = array(
285285
1 => array('pipe','w'),
286-
2 => array('pipe','w'),
286+
2 => array('pipe', $this->getIsWindows() ? 'a' : 'w'),
287287
);
288288
$process = proc_open($command, $descriptors, $pipes, $this->procCwd, $this->procEnv, $this->procOptions);
289289

@@ -311,6 +311,14 @@ public function execute()
311311
return true;
312312
}
313313

314+
/**
315+
* @return bool whether we are on a Windows OS
316+
*/
317+
public function getIsWindows()
318+
{
319+
return strncasecmp(PHP_OS, 'WIN', 3)===0;
320+
}
321+
314322
/**
315323
* @return string the current command string to execute
316324
*/

0 commit comments

Comments
 (0)