Hi!
Initially, this prevents popen_ex from failing when the actual
executable doesn't exist, since "cmd.exe /c c:\foo\bar\xxx.exe" will
*always* successfully start a process. This can be seen in bug
#43327.
Second, is that by having the intermediate process, I'm pretty sure
there's some extra-buffering of the input/output streams going on
(once for the child proc, and once for the cmd.exe). This (probably
along with a too-small pipe buffer) contributes to the behavior found
in #44994.
Finally, I can't for the life of me see what benefit this brings to
the table. Other languages don't need to put cmd.exe in the middle
of their children. The only case may be where someone wants to use
built-in cmd.exe commands like 'dir' on popen_ex() , which would not
be right anyway, and they should explicitly include the command
processor in their command line.
It's pretty big semantic change, not just a bugfix, so I think it'd be
nice to announce and discuss it on the list, not just put it as minor
bugfix.
Also it means that all output redirections, shell commands, etc. stop
working for exec, system, etc. since they all use popen().
I see code out there that uses popen-dependent functions with all this
stuff, so it makes serious BC break.
Also, on Unix system, popen etc. by default use shell.
I recognize there might be a need for calling processes directly, but I
think this can and should be done in BC-compatible manner.
--
Stanislav Malyshev, Zend Software Architect
[email protected] http://www.zend.com/
(408)253-8829 MSN: [email protected]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php