mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
WS, preparation for the new doc style
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184001 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
534a8a8a18
commit
c0c41907a7
10 changed files with 441 additions and 458 deletions
|
@ -1,45 +1,44 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.escapeshellarg">
|
||||
<refnamediv>
|
||||
<refname>escapeshellarg</refname>
|
||||
<refpurpose>Escape a string to be used as a shell argument</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>escapeshellarg</methodname>
|
||||
<methodparam><type>string</type><parameter>arg</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>escapeshellarg</function> adds single quotes around a string
|
||||
and quotes/escapes any existing single quotes allowing you to pass a
|
||||
string directly to a shell function and having it be treated as a single
|
||||
safe argument. This function should be used to escape individual
|
||||
arguments to shell functions coming from user input. The shell functions
|
||||
include <function>exec</function>, <function>system</function> and the
|
||||
<link linkend="language.operators.execution">backtick operator</link>.
|
||||
A standard use would be:</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.escapeshellarg">
|
||||
<refnamediv>
|
||||
<refname>escapeshellarg</refname>
|
||||
<refpurpose>Escape a string to be used as a shell argument</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>escapeshellarg</methodname>
|
||||
<methodparam><type>string</type><parameter>arg</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>escapeshellarg</function> adds single quotes around a string
|
||||
and quotes/escapes any existing single quotes allowing you to pass a
|
||||
string directly to a shell function and having it be treated as a single
|
||||
safe argument. This function should be used to escape individual
|
||||
arguments to shell functions coming from user input. The shell functions
|
||||
include <function>exec</function>, <function>system</function> and the
|
||||
<link linkend="language.operators.execution">backtick operator</link>.
|
||||
A standard use would be:</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
system('ls '.escapeshellarg($dir));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>escapeshellcmd</function>, <function>exec</function>,
|
||||
<function>popen</function>, <function>system</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>escapeshellcmd</function>, <function>exec</function>,
|
||||
<function>popen</function>, <function>system</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.escapeshellcmd">
|
||||
<refnamediv>
|
||||
<refname>escapeshellcmd</refname>
|
||||
<refpurpose>Escape shell metacharacters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>escapeshellcmd</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>escapeshellcmd</function> escapes any characters in a
|
||||
string that might be used to trick a shell command into executing
|
||||
arbitrary commands. This function should be used to make sure
|
||||
that any data coming from user input is escaped before this data
|
||||
is passed to the <function>exec</function> or
|
||||
<function>system</function> functions, or to the <link
|
||||
linkend="language.operators.execution">backtick
|
||||
operator</link>. A standard use would be:</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.escapeshellcmd">
|
||||
<refnamediv>
|
||||
<refname>escapeshellcmd</refname>
|
||||
<refpurpose>Escape shell metacharacters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>escapeshellcmd</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>escapeshellcmd</function> escapes any characters in a
|
||||
string that might be used to trick a shell command into executing
|
||||
arbitrary commands. This function should be used to make sure
|
||||
that any data coming from user input is escaped before this data
|
||||
is passed to the <function>exec</function> or
|
||||
<function>system</function> functions, or to the <link
|
||||
linkend="language.operators.execution">backtick
|
||||
operator</link>. A standard use would be:</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$e = escapeshellcmd($userinput);
|
||||
|
@ -36,17 +36,16 @@ $f = escapeshellcmd($filename);
|
|||
system("touch \"/tmp/$f\"; ls -l \"/tmp/$f\"");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>escapeshellarg</function>, <function>exec</function>,
|
||||
<function>popen</function>, <function>system</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>escapeshellarg</function>, <function>exec</function>,
|
||||
<function>popen</function>, <function>system</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.15 $ -->
|
||||
<!-- $Revision: 1.16 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.exec">
|
||||
<refnamediv>
|
||||
<refname>exec</refname>
|
||||
<refpurpose>Execute an external program</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>exec</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">output</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>output</parameter> argument is present, then the
|
||||
specified array will be filled with every line of output from the
|
||||
command. Line endings, such as <literal>\n</literal>, are not
|
||||
included in this array. 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>output</parameter> argument, then the
|
||||
return status of the executed command will be written to this
|
||||
variable.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>An <function>exec</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.exec">
|
||||
<refnamediv>
|
||||
<refname>exec</refname>
|
||||
<refpurpose>Execute an external program</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>exec</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">output</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>output</parameter> argument is present, then the
|
||||
specified array will be filled with every line of output from the
|
||||
command. Line endings, such as <literal>\n</literal>, are not
|
||||
included in this array. 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>output</parameter> argument, then the
|
||||
return status of the executed command will be written to this
|
||||
variable.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>An <function>exec</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// outputs the username that owns the running php/httpd process
|
||||
|
@ -49,22 +49,22 @@
|
|||
echo exec('whoami');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
&warn.escapeshell;
|
||||
¬e.exec-bg;
|
||||
¬e.exec-path;
|
||||
&warn.sm.exec;
|
||||
<para>
|
||||
See also <function>system</function>,
|
||||
<function>passthru</function>, <function>popen</function>,
|
||||
<function>escapeshellcmd</function>
|
||||
<function>pcntl_exec</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
&warn.escapeshell;
|
||||
¬e.exec-bg;
|
||||
¬e.exec-path;
|
||||
&warn.sm.exec;
|
||||
<para>
|
||||
See also <function>system</function>,
|
||||
<function>passthru</function>, <function>popen</function>,
|
||||
<function>escapeshellcmd</function>
|
||||
<function>pcntl_exec</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,47 +1,45 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.passthru">
|
||||
<refnamediv>
|
||||
<refname>passthru</refname>
|
||||
<refpurpose>
|
||||
Execute an external program and display raw output
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>passthru</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>passthru</function> function is similar to the
|
||||
<function>exec</function> function in that it executes a
|
||||
<parameter>command</parameter>. If the
|
||||
<parameter>return_var</parameter> argument is present, the return
|
||||
status of the Unix command will be placed here. This function
|
||||
should be used in place of <function>exec</function> or
|
||||
<function>system</function> when the output from the Unix command
|
||||
is binary data which needs to be passed directly back to the
|
||||
browser. A common use for this is to execute something like the
|
||||
pbmplus utilities that can output an image stream directly. By
|
||||
setting the Content-type to <emphasis>image/gif</emphasis> and
|
||||
then calling a pbmplus program to output a gif, you can create
|
||||
PHP scripts that output images directly.
|
||||
</para>
|
||||
&warn.escapeshell;
|
||||
¬e.exec-bg;
|
||||
¬e.exec-path;
|
||||
&warn.sm.exec;
|
||||
<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>
|
||||
<refentry id="function.passthru">
|
||||
<refnamediv>
|
||||
<refname>passthru</refname>
|
||||
<refpurpose>Execute an external program and display raw output</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>passthru</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>passthru</function> function is similar to the
|
||||
<function>exec</function> function in that it executes a
|
||||
<parameter>command</parameter>. If the
|
||||
<parameter>return_var</parameter> argument is present, the return
|
||||
status of the Unix command will be placed here. This function
|
||||
should be used in place of <function>exec</function> or
|
||||
<function>system</function> when the output from the Unix command
|
||||
is binary data which needs to be passed directly back to the
|
||||
browser. A common use for this is to execute something like the
|
||||
pbmplus utilities that can output an image stream directly. By
|
||||
setting the Content-type to <emphasis>image/gif</emphasis> and
|
||||
then calling a pbmplus program to output a gif, you can create
|
||||
PHP scripts that output images directly.
|
||||
</para>
|
||||
&warn.escapeshell;
|
||||
¬e.exec-bg;
|
||||
¬e.exec-path;
|
||||
&warn.sm.exec;
|
||||
<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>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,32 +1,29 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.28 -->
|
||||
<refentry id='function.proc-close'>
|
||||
<refnamediv>
|
||||
<refname>proc_close</refname>
|
||||
<refpurpose>
|
||||
Close a process opened by <function>proc_open</function> and return the exit code of that
|
||||
process.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>proc_close</methodname>
|
||||
<methodparam><type>resource</type><parameter>process</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>proc_close</function> is similar to <function>pclose</function>
|
||||
except that it only works on processes opened by
|
||||
<function>proc_open</function>.
|
||||
<function>proc_close</function> waits for the process to terminate, and
|
||||
returns its exit code. If you have open pipes to that process, you
|
||||
should <function>fclose</function> them prior to calling this function in
|
||||
order to avoid a deadlock - the child process may not be able to exit
|
||||
while the pipes are open.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id='function.proc-close'>
|
||||
<refnamediv>
|
||||
<refname>proc_close</refname>
|
||||
<refpurpose>Close a process opened by <function>proc_open</function> and return the exit code of that process.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>proc_close</methodname>
|
||||
<methodparam><type>resource</type><parameter>process</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>proc_close</function> is similar to <function>pclose</function>
|
||||
except that it only works on processes opened by
|
||||
<function>proc_open</function>.
|
||||
<function>proc_close</function> waits for the process to terminate, and
|
||||
returns its exit code. If you have open pipes to that process, you
|
||||
should <function>fclose</function> them prior to calling this function in
|
||||
order to avoid a deadlock - the child process may not be able to exit
|
||||
while the pipes are open.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,97 +1,96 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id='function.proc-get-status'>
|
||||
<refnamediv>
|
||||
<refname>proc_get_status</refname>
|
||||
<refpurpose>
|
||||
Get information about a process opened by <function>proc_open</function>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>proc_get_status</methodname>
|
||||
<methodparam><type>resource</type><parameter>process</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>proc_get_status</function> fetches data about a
|
||||
process opened using <function>proc_open</function>. The
|
||||
collected information is returned in an array containing the
|
||||
following elements:
|
||||
</para>
|
||||
<informaltable>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row><entry>element</entry><entry>type</entry><entry>description</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>command</entry>
|
||||
<entry><type>string</type></entry>
|
||||
<entry>The command string that was passed to
|
||||
<function>proc_open</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>pid</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>process id</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>running</entry>
|
||||
<entry><type>bool</type></entry>
|
||||
<entry>
|
||||
&true; if the process is still running, &false; if it has
|
||||
terminated
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>signaled</entry>
|
||||
<entry><type>bool</type></entry>
|
||||
<entry>
|
||||
&true; if the child process has been terminated by
|
||||
an uncaught signal. Always set to &false; on Windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>stopped</entry>
|
||||
<entry><type>bool</type></entry>
|
||||
<entry>
|
||||
&true; if the child process has been stopped by a
|
||||
signal. Always set to &false; on Windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>exitcode</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>
|
||||
the exit code returned by the process (which is only
|
||||
meaningful if <literal>running</literal> is &false;)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>termsig</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>
|
||||
the number of the signal that caused the child process to terminate
|
||||
its execution (only meaningful if <literal>signaled</literal> is &true;)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>stopsig</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>
|
||||
the number of the signal that caused the child process to stop its
|
||||
execution (only meaningful if <literal>stopped</literal> is &true;)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
See also <function>proc_open</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id='function.proc-get-status'>
|
||||
<refnamediv>
|
||||
<refname>proc_get_status</refname>
|
||||
<refpurpose>Get information about a process opened by <function>proc_open</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>proc_get_status</methodname>
|
||||
<methodparam><type>resource</type><parameter>process</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>proc_get_status</function> fetches data about a
|
||||
process opened using <function>proc_open</function>. The
|
||||
collected information is returned in an array containing the
|
||||
following elements:
|
||||
</para>
|
||||
<informaltable>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row><entry>element</entry><entry>type</entry><entry>description</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>command</entry>
|
||||
<entry><type>string</type></entry>
|
||||
<entry>
|
||||
The command string that was passed to <function>proc_open</function>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>pid</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>process id</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>running</entry>
|
||||
<entry><type>bool</type></entry>
|
||||
<entry>
|
||||
&true; if the process is still running, &false; if it has
|
||||
terminated
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>signaled</entry>
|
||||
<entry><type>bool</type></entry>
|
||||
<entry>
|
||||
&true; if the child process has been terminated by
|
||||
an uncaught signal. Always set to &false; on Windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>stopped</entry>
|
||||
<entry><type>bool</type></entry>
|
||||
<entry>
|
||||
&true; if the child process has been stopped by a
|
||||
signal. Always set to &false; on Windows.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>exitcode</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>
|
||||
the exit code returned by the process (which is only
|
||||
meaningful if <literal>running</literal> is &false;)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>termsig</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>
|
||||
the number of the signal that caused the child process to terminate
|
||||
its execution (only meaningful if <literal>signaled</literal> is &true;)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>stopsig</entry>
|
||||
<entry><type>int</type></entry>
|
||||
<entry>
|
||||
the number of the signal that caused the child process to stop its
|
||||
execution (only meaningful if <literal>stopped</literal> is &true;)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
See also <function>proc_open</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,42 +1,40 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id='function.proc-nice'>
|
||||
<refnamediv>
|
||||
<refname>proc_nice</refname>
|
||||
<refpurpose>
|
||||
Change the priority of the current process
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>proc_nice</methodname>
|
||||
<methodparam><type>int</type><parameter>increment</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>proc_nice</function> changes the priority of the current
|
||||
process by the amount specified in <parameter>increment</parameter>. A
|
||||
positive <parameter>increment</parameter> will lower the priority of the
|
||||
current process, whereas a negative <parameter>increment</parameter>
|
||||
will raise the priority. If an error occurs, like the user lacks
|
||||
permission to change the priority, an error of level
|
||||
<constant>E_WARNING</constant> is generated and &false; is returned.
|
||||
Otherwise, &true; is returned.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>proc_nice</function> will only exist if your system has 'nice'
|
||||
capabilities. 'nice' conforms to: SVr4, SVID EXT, AT&T, X/OPEN, BSD
|
||||
4.3. This means that <function>proc_nice</function> is not available
|
||||
on Windows.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<function>proc_nice</function> is not related to
|
||||
<function>proc_open</function> and its associated functions in any way.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id='function.proc-nice'>
|
||||
<refnamediv>
|
||||
<refname>proc_nice</refname>
|
||||
<refpurpose>Change the priority of the current process</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>proc_nice</methodname>
|
||||
<methodparam><type>int</type><parameter>increment</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>proc_nice</function> changes the priority of the current
|
||||
process by the amount specified in <parameter>increment</parameter>. A
|
||||
positive <parameter>increment</parameter> will lower the priority of the
|
||||
current process, whereas a negative <parameter>increment</parameter>
|
||||
will raise the priority. If an error occurs, like the user lacks
|
||||
permission to change the priority, an error of level
|
||||
<constant>E_WARNING</constant> is generated and &false; is returned.
|
||||
Otherwise, &true; is returned.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<function>proc_nice</function> will only exist if your system has 'nice'
|
||||
capabilities. 'nice' conforms to: SVr4, SVID EXT, AT&T, X/OPEN, BSD
|
||||
4.3. This means that <function>proc_nice</function> is not available
|
||||
on Windows.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<function>proc_nice</function> is not related to
|
||||
<function>proc_open</function> and its associated functions in any way.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,46 +1,41 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry id='function.proc-terminate'>
|
||||
<refnamediv>
|
||||
<refname>proc_terminate</refname>
|
||||
<refpurpose>
|
||||
kills a process opened by proc_open
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>proc_terminate</methodname>
|
||||
<methodparam><type>resource</type><parameter>process</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>signal</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
Signals a <parameter>process</parameter> (created using
|
||||
<function>proc_open</function>) that it should terminate.
|
||||
<function>proc_terminate</function> returns immediately and does not wait
|
||||
for the process to terminate.
|
||||
</para>
|
||||
<para>
|
||||
The optional
|
||||
<parameter>signal</parameter> is only useful on <acronym>POSIX</acronym>
|
||||
operating systems; you may specify a signal to send to the process using
|
||||
the <literal>kill(2)</literal> system call. The default is
|
||||
<literal>SIGTERM</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>proc_terminate</function> allows you terminate the process and
|
||||
continue with other tasks. You may poll the process (to see if it has
|
||||
stopped yet) by using the <function>proc_get_status</function> function.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also <function>proc_open</function>, <function>proc_close</function>,
|
||||
and <function>proc_get_status</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry id='function.proc-terminate'>
|
||||
<refnamediv>
|
||||
<refname>proc_terminate</refname>
|
||||
<refpurpose>kills a process opened by proc_open</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>proc_terminate</methodname>
|
||||
<methodparam><type>resource</type><parameter>process</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>signal</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Signals a <parameter>process</parameter> (created using
|
||||
<function>proc_open</function>) that it should terminate.
|
||||
<function>proc_terminate</function> returns immediately and does not wait
|
||||
for the process to terminate.
|
||||
</para>
|
||||
<para>
|
||||
The optional
|
||||
<parameter>signal</parameter> is only useful on <acronym>POSIX</acronym>
|
||||
operating systems; you may specify a signal to send to the process using
|
||||
the <literal>kill(2)</literal> system call. The default is
|
||||
<literal>SIGTERM</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<function>proc_terminate</function> allows you terminate the process and
|
||||
continue with other tasks. You may poll the process (to see if it has
|
||||
stopped yet) by using the <function>proc_get_status</function> function.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>proc_open</function>, <function>proc_close</function>,
|
||||
and <function>proc_get_status</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,45 +1,43 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.2 -->
|
||||
<refentry id='function.shell-exec'>
|
||||
<refnamediv>
|
||||
<refname>shell_exec</refname>
|
||||
<refpurpose>
|
||||
Execute command via shell and return the complete output as a string
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>shell_exec</methodname>
|
||||
<methodparam><type>string</type><parameter>cmd</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is identical to the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>shell_exec</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id='function.shell-exec'>
|
||||
<refnamediv>
|
||||
<refname>shell_exec</refname>
|
||||
<refpurpose>Execute command via shell and return the complete output as a string</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>shell_exec</methodname>
|
||||
<methodparam><type>string</type><parameter>cmd</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function is identical to the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>shell_exec</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$output = shell_exec('ls -lart');
|
||||
echo "<pre>$output</pre>";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
¬e.sm.disabled;
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also <function>exec</function> and
|
||||
<function>escapeshellcmd</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
¬e.sm.disabled;
|
||||
|
||||
<para>
|
||||
See also <function>exec</function> and
|
||||
<function>escapeshellcmd</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.24 -->
|
||||
<refentry id="function.system">
|
||||
<refnamediv>
|
||||
<refname>system</refname>
|
||||
<refpurpose>Execute an external program and display the output</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>system</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
&warn.escapeshell;
|
||||
¬e.exec-bg;
|
||||
<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>
|
||||
<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>
|
||||
<example>
|
||||
<title><function>system</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.system">
|
||||
<refnamediv>
|
||||
<refname>system</refname>
|
||||
<refpurpose>Execute an external program and display the output</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>system</methodname>
|
||||
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
&warn.escapeshell;
|
||||
¬e.exec-bg;
|
||||
<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>
|
||||
<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>
|
||||
<example>
|
||||
<title><function>system</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo '<pre>';
|
||||
|
@ -57,20 +57,20 @@ echo '
|
|||
<hr />Return value: ' . $retval;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
¬e.exec-path;
|
||||
&warn.sm.exec;
|
||||
<para>
|
||||
See also <function>exec</function>,
|
||||
<function>passthru</function>, <function>popen</function>,
|
||||
<function>escapeshellcmd</function>,
|
||||
<function>pcntl_exec</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
¬e.exec-path;
|
||||
&warn.sm.exec;
|
||||
<para>
|
||||
See also <function>exec</function>,
|
||||
<function>passthru</function>, <function>popen</function>,
|
||||
<function>escapeshellcmd</function>,
|
||||
<function>pcntl_exec</function>, and the <link
|
||||
linkend="language.operators.execution">backtick operator</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
Loading…
Reference in a new issue