1
0
mirror of https://github.com/php/doc-ja.git synced 2026-04-26 09:28:10 +02:00
Files
archived-doc-ja/reference/exec/functions/exec.xml
T
Moriyoshi Koizumi 40d6ed86b3 Let's unify them :)
# sorry for the huge commit


git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@134146 c90b9560-bf6c-de11-be94-00142212c4b1
2003-07-04 00:06:52 +00:00

79 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- splitted from ./ja/functions/exec.xml, last change in rev 1.1 -->
<!-- sync: 1.2 -->
<refentry id="function.exec">
<refnamediv>
<refname>exec</refname>
<refpurpose>外部プログラムを実行します</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>exec</methodname>
<methodparam><type>string</type><parameter>command</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>array</optional></replaceable>
</parameter></methodparam>
<methodparam><type>int</type><parameter>
<replaceable><optional>return_var</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
<function>exec</function>は指定された
<parameter>command</parameter>を実行しますが、一切の出力はありま
せん。ただ単に、コマンド結果の最後の行を返すだけです。コマンドを実行
し、一切干渉を受けずに直接コマンドから全てのデータを受けとる必要が
あるならば、<function>PassThru</function> 関数を使ってください。
</para>
<para>
引数<parameter>array</parameter>が存在する場合、指定した配列は、
コマンドからの出力の各行で埋められます。配列に既に何らかの要素が
含まれる場合は、<function>exec</function>は配列の最後に追加される
ことに注意してください。関数が要素を追加することを望まないのなら、
それが <function>exec</function> に渡される前に、配列の
<function>unset</function>を呼び出してください。
引数<parameter>return_var</parameter>が、引数
<parameter>array</parameter>と共に存在する場合、実行したコマンドの
ステータスがこの変数に書かれます。
</para>
<para>
ユーザ入力によるデータを、この関数に渡すことを許可したいのであれば、
ユーザがシステムをだまして勝手なコマンドを実行できないように、
<function>escapeshellcmd</function>を使うべきです。
</para>
<para>
この関数を使用してプログラム実行を開始し、バックグラウンドで実行
したままにしたい場合には、プログラムの出力をファイルまたは他の出
力ストリームにリダイレクトする必要があることにも注意して下さい。
さもないと、PHPはそのプログラムの実行が終了するまでハングします。
</para>
<para>
<function>system</function>,<function>passthru</function>,
<function>popen</function>,<function>escapeshellcmd</function>,
<link linkend="language.operators.execution">backtick 演算子</link>
も参照ください。
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->