Browse Source

[Process] Workaround for windows based stderr bug

Adrian Rudnik 14 years ago
parent
commit
0c089d8fe3
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/Symfony/Component/Process/Process.php

+ 8 - 1
src/Symfony/Component/Process/Process.php

@@ -100,7 +100,14 @@ class Process
             }
         };
 
-        $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'a'));
+        // Workaround for http://bugs.php.net/bug.php?id=51800
+        if (strstr(PHP_OS, 'WIN')) {
+            $stderrPipeMode = 'a';
+        } else {
+            $stderrPipeMode = 'w';
+        }
+
+        $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', $stderrPipeMode));
 
         $process = proc_open($this->commandline, $descriptors, $pipes, $this->cwd, $this->env, $this->options);