symfony/symfony — pull request #8924 by romainneutron (2013-09-03 18:10:44+00:00)
Title: [Process][2.2] Fix Process component on windows

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8836, #8799, #7078
| License | MIT

This PR fixes Process on windows (almost).
- Some unit tests were not Windows compatible
- Use a file handle for STDERR as well as STDOUT to avoid blocking
- Decouple pipes and descriptors from Process

As this move some a part of Process in a sub class, I hope merging this in 2.3 and master would not be a PITA. I'm here to make some adjustments after theses merge if needed.

**Important note** :

We are using file handles instead of streams for `proc_open` pipes as described in the code (see [PHP bug #51800](https://bugs.php.net/bug.php?id=51800)). Unfortunately, this workaround may produce corrupted output/error output in some race conditions. That's why `AbstractProcessTest::testProcessPipes` randomly fails when using file handles (on unix and windows).