Bug->Req #78177 [Opn]: Make proc_open accept command array
| From: | sjon@php.net | Date: | Tue, 18 Jun 2019 07:51:29 +0000 |
| Subject: | Bug->Req #78177 [Opn]: Make proc_open accept command array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-221360@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78177&edit=1
ID: 78177
Updated by: sjon@php.net
Reported by: nicolas dot grekas+php at gmail dot com
Summary: Make proc_open accept command array
Status: Open
-Type: Bug
+Type: Feature/Change Request
-Package: Unknown/Other Function
+Package: Program Execution
PHP Version: Next Minor Version
Block user comment: N
Private report: N
New Comment:
implode(' ', array_map('escapeshellarg', $array)) might be a suitable workaround
Previous Comments:
------------------------------------------------------------------------
[2019-06-18 07:45:46] nicolas dot grekas+php at gmail dot com
Description:
------------
Right now, PHP misses a low level primitive to run a process without argument escaping issues.
The reason is that proc_open accepts only a string to define the command, so that a command line
parser is required under the hood.
This also creates the long-lasting issue with signaling, where the shell get them instead of the
command itself.
Both issues would be fixed by having a way to launch shell-less command lines.
All programming language have this, but PHP.
proc_open($array, ...) could be the way to go. We're missing this badly.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78177&edit=1