symfony/symfony — pull request #7401 by hakre (2013-03-16 05:01:55+00:00)
Title: [Process] Fixed Process to work on Windows with CgiHttpKernel (2.0)

- A working directory that does not exist does not work.
- Descriptors formatting.
- stream_set_blocking() takes integer not boolean as second parameter.
- Streams on Windows that didn't set to non-blocking should only fread()
when there are bytes to read and only fclosed() while being eof. Fixes
PHP Bug #51800 (for 2.2, not for 2.0).
- Added ProcessStreams incl. support to have read and write descriptors
both as pipes or tempfiles.
- Changed callback calls (internal callbacks, external callbacks unchanged).
- ProcessTest::testProcessPipes() should work on windows again.

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

This PR introduces a new class called `ProcessStreams`. It's only used internally from within `Process` and it manages the descriptors / pipes / files when opening a process and when selecting streams.

It's done with the outlook of further changes to `Process` up to 2.2 against which I was bugfixing first but Igor told me I should backport things down to 2.0 which I did now. Because in 2.0 things were done differently in `Process` I extracted part of the methods into `ProcessStreams`.

I need some guidance, never did create such a huge one here in this project.