Some cosmetic changes.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@19571 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Egon Schmid 2000-02-11 20:24:50 +00:00
parent aee9fb6e49
commit 036eaef972

View file

@ -24,17 +24,16 @@
operator</link>. A standard use would be:</para>
<para>
<informalexample>
<programlisting>
<programlisting role="php">
system(EscapeShellCmd($cmd))
</programlisting>
</informalexample>
</para>
<para>
See also <function>exec</function>, <function>popen</function>,
<function>system</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
</para>
<para>
See also <function>exec</function>, <function>popen</function>,
<function>system</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
</refsect1>
</refentry>
@ -49,51 +48,67 @@ system(EscapeShellCmd($cmd))
<funcsynopsis>
<funcdef>string <function>exec</function></funcdef>
<paramdef>string <parameter>command</parameter></paramdef>
<paramdef>string <parameter><optional>array</optional></parameter></paramdef>
<paramdef>int <parameter><optional>return_var</optional></parameter></paramdef>
<paramdef>string
<parameter><optional>array</optional>
</parameter>
</paramdef>
<paramdef>int
<parameter><optional>return_var</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
<function>exec</function> executes the given <parameter>command</parameter>, however it does not
output anything. It simply returns the last line from the result of the command.
If you need to execute a command and have all the data from the command passed
directly back without any interference, use the <function>PassThru</function>
function.</para>
<function>exec</function> executes the given
<parameter>command</parameter>, however it does not output
anything. It simply returns the last line from the result of the
command. If you need to execute a command and have all the data
from the command passed directly back without any interference,
use the <function>PassThru</function> function.
</para>
<para>
If the <parameter>array</parameter> argument is present, then the specified array will be filled
with every line of output from the command. Note that if the array already contains some
elements, <function>exec</function> will append to the end of the array. If you do not
want the function to append elements, call <function>unset</function> on the array before
passing it to <function>exec</function>.</para>
If the <parameter>array</parameter> argument is present, then the
specified array will be filled with every line of output from the
command. Note that if the array already contains some elements,
<function>exec</function> will append to the end of the array.
If you do not want the function to append elements, call
<function>unset</function> on the array before passing it to
<function>exec</function>.
</para>
<para>
If the <parameter>return_var</parameter> argument is present along with the <parameter>array</parameter>
argument, then the return status of the executed command will be written to this
variable.</para>
If the <parameter>return_var</parameter> argument is present
along with the <parameter>array</parameter> argument, then the
return status of the executed command will be written to this
variable.
</para>
<para>
Note that if you are going to allow data coming from user input to be
passed to this function, then you should be using <function>EscapeShellCmd</function>
to make sure that users cannot trick the system into executing arbitrary commands.</para>
Note that if you are going to allow data coming from user input
to be passed to this function, then you should be using
<function>EscapeShellCmd</function> to make sure that users
cannot trick the system into executing arbitrary commands.
</para>
<para>
See also <function>system</function>,
<function>PassThru</function>, <function>popen</function>,
<function>EscapeShellCmd</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
See also <function>system</function>,
<function>PassThru</function>, <function>popen</function>,
<function>EscapeShellCmd</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
</refsect1>
</refentry>
<refentry id="function.passthru">
<refnamediv>
<refname>passthru</refname>
<refpurpose>Execute an external program and display raw output</refpurpose>
<refpurpose>
Execute an external program and display raw output
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>void <function>passthru</function></funcdef>
<paramdef>string <parameter>command</parameter></paramdef>
<paramdef>int <parameter><optional>return_var</optional></parameter></paramdef>
<paramdef>int
<parameter><optional>return_var</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
The <function>passthru</function> function is similar to the
@ -110,11 +125,11 @@ system(EscapeShellCmd($cmd))
then calling a pbmplus program to output a gif, you can create
PHP scripts that output images directly.</para>
<para>
See also <function>exec</function>,
<function>system</function>, <function>popen</function>,
<function>EscapeShellCmd</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
See also <function>exec</function>, <function>system</function>,
<function>popen</function>, <function>EscapeShellCmd</function>,
and the <link linkend="language.operators.execution">backtick
operator</link>.
</para>
</refsect1>
</refentry>
@ -128,34 +143,45 @@ system(EscapeShellCmd($cmd))
<funcsynopsis>
<funcdef>string <function>system</function></funcdef>
<paramdef>string <parameter>command</parameter></paramdef>
<paramdef>int <parameter><optional>return_var</optional></parameter></paramdef>
<paramdef>int
<parameter><optional>return_var</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
<function>System</function> is just like the C version of the function in that it executes
the given <parameter>command</parameter> and outputs the result. If a variable is provided as
the second argument, then the return status code of the executed command
will be written to this variable.</para>
<function>System</function> is just like the C version of the
function in that it executes the given
<parameter>command</parameter> and outputs the result. If a
variable is provided as the second argument, then the return
status code of the executed command will be written to this
variable.
</para>
<para>
Note, that if you are going to allow data coming from user input to be passed to this function,
then you should be using the <function>EscapeShellCmd</function> function
to make sure that users cannot trick the system into executing arbitrary commands.</para>
Note, that if you are going to allow data coming from user input
to be passed to this function, then you should be using the
<function>EscapeShellCmd</function> function to make sure that
users cannot trick the system into executing arbitrary
commands.
</para>
<para>
The <function>System</function> call also tries to automatically flush the web server's output
buffer after each line of output if PHP is running as a server module.</para>
<para>
Returns the last line of the command output on success, and false on failure.
</para>
The <function>System</function> call also tries to automatically
flush the web server's output buffer after each line of output if
PHP is running as a server module.
</para>
<para>
If you need to execute a command and have all the data from the command passed
directly back without any interference, use the <function>PassThru</function>
function.
</para>
Returns the last line of the command output on success, and false
on failure.
</para>
<para>
See also <function>exec</function>,
<function>PassThru</function>, <function>popen</function>,
<function>EscapeShellCmd</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
If you need to execute a command and have all the data from the
command passed directly back without any interference, use the
<function>PassThru</function> function.
</para>
<para>
See also <function>exec</function>,
<function>PassThru</function>, <function>popen</function>,
<function>EscapeShellCmd</function>, and the <link
linkend="language.operators.execution">backtick operator</link>.
</para>
</refsect1>
</refentry>