reference/exec/functions/proc-open.xml
769812c12f00c1978bf7dd711dca38dbf05462da
...
...
@@ -1,7 +1,7 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
3
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.28 -->
4
-
<refentry xml:id='function.proc-open' xmlns="http://docbook.org/ns/docbook">
4
+
<refentry xml:id="function.proc-open" xmlns="http://docbook.org/ns/docbook">
5
5
<refnamediv>
6
6
<refname>proc_open</refname>
7
7
<refpurpose>
...
...
@@ -11,14 +11,14 @@
11
11
<refsect1 role="description">
12
12
&reftitle.description;
13
13
<methodsynopsis>
14
-
<type>resource</type><methodname>proc_open</methodname>
15
-
<methodparam><type>mixed</type><parameter>cmd</parameter></methodparam>
16
-
<methodparam><type>array</type><parameter>descriptorspec</parameter></methodparam>
17
-
<methodparam><type>array</type><parameter role="reference">pipes</parameter></methodparam>
18
-
<methodparam choice="opt"><type>string</type><parameter>cwd</parameter><initializer>&null;</initializer></methodparam>
19
-
<methodparam choice="opt"><type>array</type><parameter>env</parameter><initializer>&null;</initializer></methodparam>
20
-
<methodparam choice="opt"><type>array</type><parameter>other_options</parameter><initializer>&null;</initializer></methodparam>
21
-
</methodsynopsis>
14
+
<type class="union"><type>resource</type><type>false</type></type><methodname>proc_open</methodname>
15
+
<methodparam><type class="union"><type>array</type><type>string</type></type><parameter>command</parameter></methodparam>
16
+
<methodparam><type>array</type><parameter>descriptor_spec</parameter></methodparam>
17
+
<methodparam><type>array</type><parameter role="reference">pipes</parameter></methodparam>
18
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>cwd</parameter><initializer>&null;</initializer></methodparam>
19
+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>env_vars</parameter><initializer>&null;</initializer></methodparam>
20
+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
21
+
</methodsynopsis>
22
22
<para>
23
23
<function>proc_open</function> is similar to <function>popen</function>
24
24
but provides a much greater degree of control over the program execution.
...
...
@@ -44,7 +44,7 @@
44
44
<para>
45
45
<variablelist>
46
46
<varlistentry>
47
-
<term><parameter>cmd</parameter></term>
47
+
<term><parameter>command</parameter></term>
48
48
<listitem>
49
49
<para>
50
50
The commandline to execute as &string;. Special characters have to be properly escaped,
...
...
@@ -53,19 +53,19 @@
53
53
<note>
54
54
<simpara>
55
55
On <emphasis>Windows</emphasis>, unless <literal>bypass_shell</literal> is set to &true; in
56
-
<parameter>other_options</parameter>, the <parameter>cmd</parameter> is
56
+
<parameter>options</parameter>, the <parameter>command</parameter> is
57
57
passed to <command>cmd.exe</command> (actually, <literal>%ComSpec%</literal>)
58
58
with the <literal>/c</literal> flag as <emphasis>unquoted</emphasis> string
59
59
(i.e. exactly as has been given to <function>proc_open</function>).
60
60
This can cause <command>cmd.exe</command> to remove enclosing quotes from
61
-
<parameter>cmd</parameter> (for details see the <command>cmd.exe</command> documentation),
61
+
<parameter>command</parameter> (for details see the <command>cmd.exe</command> documentation),
62
62
resulting in unexpected, and potentially even dangerous behavior, because
63
63
<command>cmd.exe</command> error messages may contain (parts of) the passed
64
-
<parameter>cmd</parameter> (see example below).
64
+
<parameter>command</parameter> (see example below).
65
65
</simpara>
66
66
</note>
67
67
<para>
68
-
As of PHP 7.4.0, <parameter>cmd</parameter> may be passed as &array; of command parameters.
68
+
As of PHP 7.4.0, <parameter>command</parameter> may be passed as &array; of command parameters.
69
69
In this case the process will be opened directly (without going through a shell)
70
70
and PHP will take care of any necessary argument escaping.
71
71
</para>
...
...
@@ -79,7 +79,7 @@
79
79
</listitem>
80
80
</varlistentry>
81
81
<varlistentry>
82
-
<term><parameter>descriptorspec</parameter></term>
82
+
<term><parameter>descriptor_spec</parameter></term>
83
83
<listitem>
84
84
<para>
85
85
An indexed array where the key represents the descriptor number and the
...
...
@@ -95,6 +95,7 @@
95
95
element is either <literal>r</literal> to pass the read end of the pipe
96
96
to the process, or <literal>w</literal> to pass the write end) and
97
97
<literal>file</literal> (the second element is a filename).
98
+
Note that anything else than <literal>w</literal> is treated like <literal>r</literal>.
98
99
</member>
99
100
<member>
100
101
A stream resource representing a real file descriptor (e.g. opened file,
...
...
@@ -134,7 +135,7 @@
134
135
</listitem>
135
136
</varlistentry>
136
137
<varlistentry>
137
-
<term><parameter>env</parameter></term>
138
+
<term><parameter>env_vars</parameter></term>
138
139
<listitem>
139
140
<para>
140
141
An array with the environment variables for the command that will be
...
...
@@ -143,7 +144,7 @@
143
144
</listitem>
144
145
</varlistentry>
145
146
<varlistentry>
146
-
<term><parameter>other_options</parameter></term>
147
+
<term><parameter>options</parameter></term>
147
148
<listitem>
148
149
<para>
149
150
Allows you to specify additional options. Currently supported options
...
...
@@ -202,21 +203,21 @@
202
203
<entry>7.4.4</entry>
203
204
<entry>
204
205
Added the <literal>create_new_console</literal> option to the
205
-
<parameter>other_options</parameter> parameter.
206
+
<parameter>options</parameter> parameter.
206
207
</entry>
207
208
</row>
208
209
<row>
209
210
<entry>7.4.0</entry>
210
211
<entry>
211
212
<function>proc_open</function> now also accepts an &array;
212
-
for the <parameter>cmd</parameter>.
213
+
for the <parameter>command</parameter>.
213
214
</entry>
214
215
</row>
215
216
<row>
216
217
<entry>7.4.0</entry>
217
218
<entry>
218
219
Added the <literal>create_process_group</literal> option to the
219
-
<parameter>other_options</parameter> parameter.
220
+
<parameter>options</parameter> parameter.
220
221
</entry>
221
222
</row>
222
223
</tbody>
...
...
@@ -308,7 +309,7 @@ operable program or batch file.
308
309
</screen>
309
310
<simpara>
310
311
To work around that behavior, it is usually sufficient to enclose the
311
-
<parameter>cmd</parameter> in additional quotes:
312
+
<parameter>command</parameter> in additional quotes:
312
313
</simpara>
313
314
<programlisting role="php">
314
315
<![CDATA[
...
...
@@ -377,7 +378,6 @@ if (is_resource($process)) {
377
378
</para>
378
379
</refsect1>
379
380
</refentry>
380
-

381
381
<!-- Keep this comment at the end of the file
382
382
Local variables:
383
383
mode: sgml
384
384