reference/exec/functions/shell-exec.xml
7973fd533364af4dd6282ca9e7bee2dffec39b1c
...
...
@@ -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.2 -->
4
-
<refentry xml:id='function.shell-exec' xmlns="http://docbook.org/ns/docbook">
4
+
<refentry xml:id="function.shell-exec" xmlns="http://docbook.org/ns/docbook">
5
5
<refnamediv>
6
6
<refname>shell_exec</refname>
7
7
<refpurpose>Execute command via shell and return the complete output as a string</refpurpose>
...
...
@@ -10,13 +10,19 @@
10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
12
<methodsynopsis>
13
-
<type>string</type><methodname>shell_exec</methodname>
14
-
<methodparam><type>string</type><parameter>cmd</parameter></methodparam>
13
+
<type class="union"><type>string</type><type>false</type><type>null</type></type><methodname>shell_exec</methodname>
14
+
<methodparam><type>string</type><parameter>command</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
-
This function is identical to the <link
18
-
linkend="language.operators.execution">backtick operator</link>.
17
+
This function is identical to the <link linkend="language.operators.execution">backtick operator</link>.
19
18
</para>
19
+
<note>
20
+
<para>
21
+
On Windows, the underlying pipe is opened in text mode which can cause the
22
+
function to fail for binary output. Consider to use <function>popen</function>
23
+
instead for such cases.
24
+
</para>
25
+
</note>
20
26
</refsect1>
21
27

22
28
<refsect1 role="parameters">
...
...
@@ -24,7 +30,7 @@
24
30
<para>
25
31
<variablelist>
26
32
<varlistentry>
27
-
<term><parameter>cmd</parameter></term>
33
+
<term><parameter>command</parameter></term>
28
34
<listitem>
29
35
<para>
30
36
The command that will be executed.
...
...
@@ -38,8 +44,8 @@
38
44
<refsect1 role="returnvalues">
39
45
&reftitle.returnvalues;
40
46
<para>
41
-
The output from the executed command or &null; if an error occurred or the
42
-
command produces no output.
47
+
A &string; containing the output from the executed command, &false; if the pipe
48
+
cannot be established or &null; if an error occurs or the command produces no output.
43
49
</para>
44
50
<note>
45
51
<para>
...
...
@@ -51,6 +57,14 @@
51
57
</note>
52
58
</refsect1>
53
59

60
+
<refsect1 role="errors">
61
+
&reftitle.errors;
62
+
<para>
63
+
An <constant>E_WARNING</constant> level error is generated
64
+
when the pipe cannot be established.
65
+
</para>
66
+
</refsect1>
67
+

54
68
<refsect1 role="examples">
55
69
&reftitle.examples;
56
70
<para>
...
...
@@ -68,15 +82,6 @@ echo "<pre>$output</pre>";
68
82
</para>
69
83
</refsect1>
70
84

71
-
<refsect1 role="notes">
72
-
&reftitle.notes;
73
-
<note>
74
-
<para>
75
-
&sm.disabled;
76
-
</para>
77
-
</note>
78
-
</refsect1>
79
-

80
85
<refsect1 role="seealso">
81
86
&reftitle.seealso;
82
87
<para>
...
...
@@ -87,7 +92,6 @@ echo "<pre>$output</pre>";
87
92
</para>
88
93
</refsect1>
89
94
</refentry>
90
-

91
95
<!-- Keep this comment at the end of the file
92
96
Local variables:
93
97
mode: sgml
94
98