]> granicus.if.org Git - php/commit
Support redirect+null descriptors in proc_open
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 5 Jul 2019 15:41:59 +0000 (17:41 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 11 Jul 2019 13:48:10 +0000 (15:48 +0200)
commit6285bb52faf407b07e71497723d13a1b08821352
tree8ad856186eb2685fbfd8a3694754843265bc8100
parent42cac9d7d7e5c82cf3565a33f3dd6c3d2c6b42d4
Support redirect+null descriptors in proc_open

This adds support for doing something like:

    [1 => ['pipe', 'w'], 2 => ['redirect', 1]]

This will make descriptor 2 on the child end a dup'd descriptor 1.
This is mainly useful in conjunction with shell-less mode, because
we don't have an easy way to do "2>&1" there.

Additionally we support:

    [1 => ['pipe', 'w'], 2 => ['null']]

Which would be the same as a >/dev/null or >nul redirect, depending
on platform.
UPGRADING
ext/standard/proc_open.c
ext/standard/tests/general_functions/proc_open_null.phpt [new file with mode: 0644]
ext/standard/tests/general_functions/proc_open_redirect.phpt [new file with mode: 0644]