cvs: phpdoc-ja /reference/misc ini.xml reference.xml /reference/misc/functions connection-aborted.xml connection-status.xml connection-timeout.xml
constant.xml define.xml defined.xml die.xml eval.xml exit.xml get-browser.xml highlight-file.xml highlight-string.xml ignore-user-abort.xml
iptcparse.xml leak.xml pack.xml show-source.xml sleep.xml uniqid.xml unpack.xml usleep.xml

From: Date: Sat, 13 Aug 2005 07:06:05 +0000
Subject: cvs: phpdoc-ja /reference/misc ini.xml reference.xml /reference/misc/functions connection-aborted.xml connection-status.xml connection-timeout.xml
constant.xml define.xml defined.xml die.xml eval.xml exit.xml get-browser.xml highlight-file.xml highlight-string.xml ignore-user-abort.xml
iptcparse.xml leak.xml pack.xml show-source.xml sleep.xml uniqid.xml unpack.xml usleep.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-1119@lists.php.net to get a copy of this message
takagi Sat Aug 13 03:06:05 2005 EDT Removed files: /phpdoc-ja/reference/misc/functions leak.xml iptcparse.xml Modified files: /phpdoc-ja/reference/misc/functions usleep.xml unpack.xml uniqid.xml sleep.xml show-source.xml pack.xml ignore-user-abort.xml highlight-string.xml highlight-file.xml get-browser.xml exit.xml eval.xml die.xml defined.xml define.xml constant.xml connection-timeout.xml connection-status.xml connection-aborted.xml /phpdoc-ja/reference/misc reference.xml ini.xml Log: sync with en.

http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/usleep.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/usleep.xml diff -u phpdoc-ja/reference/misc/functions/usleep.xml:1.4 phpdoc-ja/reference/misc/functions/usleep.xml:1.5 --- phpdoc-ja/reference/misc/functions/usleep.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/usleep.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.14 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.usleep"> <refnamediv> <refname>usleep</refname> @@ -13,18 +15,50 @@ <methodparam><type>int</type><parameter>micro_seconds</parameter></methodparam> </methodsynopsis> <simpara> - <function>usleep</function>関数は、指定した - <parameter>micro_seconds</parameter>の時間だけプログラムの実行を - 遅延させます。 - </simpara> - <simpara> - <function>sleep</function>も参照ください。 + <function>usleep</function> 関数は、指定した + <parameter>micro_seconds</parameter> の時間だけプログラムの実行を + 遅延させます。マイクロ秒は、1 秒の 100 万分の 1 です。 </simpara> + <para> + <example> + <title><function>usleep</function> の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// 現在の時刻 +echo date('h:i:s') . "\n"; + +// 2 秒待つ +usleep(2000000); + +// 復帰! +echo date('h:i:s') . "\n"; + +?> +]]> + </programlisting> + <para> + このスクリプトの出力は以下のようになります。 + </para> + <screen> +<![CDATA[ +11:13:28 +11:13:30 +]]> + </screen> + </example> + </para> <note> <simpara> - この関数はWindowsシステムでは動作しません。 + PHP 5.0.0 より前のバージョンでは、この関数は Windows システム上では + 動作しません。 </simpara> </note> + <simpara> + <function>sleep</function> + および <function>set_time_limit</function> も参照ください。 + </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/unpack.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/unpack.xml diff -u phpdoc-ja/reference/misc/functions/unpack.xml:1.4 phpdoc-ja/reference/misc/functions/unpack.xml:1.5 --- phpdoc-ja/reference/misc/functions/unpack.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/unpack.xml Sat Aug 13 03:06:04 2005 @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.2 --> -<!-- EN-Revision: 1.22 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.unpack"> <refnamediv> <refname>unpack</refname> - <refpurpose>バイナリ文字列からデータを切出します</refpurpose> + <refpurpose>バイナリ文字列からデータを切り出す</refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -14,36 +16,40 @@ <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para> - <parameter>format</parameter>に基づきバイナリ文字列から配列に分解 - します。バイナリ文字列の切出された要素を保持する配列を返します。 + <parameter>format</parameter> に基づき、バイナリ文字列から配列に + 分解します。バイナリ文字列の切り出された要素を保持する配列を返します。 </para> <para> - <function>unpack</function>の動作はPerlとわずかに異なり、 + <function>unpack</function> の動作はPerlとわずかに異なり、 切出されたデータは連想配列に保存されます。 - 実行する際には、別のフォーマットコードとし、スラッシュ/で + 実行する際には、別のフォーマットコードとし、スラッシュ / で 区切る必要があります。 <example> - <title>フォーマット文字列の<function>unpack</function></title> + <title><function>unpack</function> の例</title> <programlisting role="php"> <![CDATA[ -$array = unpack ("c2chars/nint", $binarydata); +<?php +$array = unpack("c2chars/nint", $binarydata); +?> ]]> </programlisting> <para> - 結果の配列は、エントリ "chars1","chars2","int" を保持します。 + 結果の配列は、エントリ "chars1", "chars2", "int" を保持します。 </para> </example> </para> + <caution> + <para> + PHP は内部的に整数を符号付きで保持することに注意しましょう。 + 大きな値の unsigned long を切り出した場合、PHP の内部で保持された値は、 + 同じ大きさの符号付き整数となり、符号無しを指定して切出された場合でも + 結果は負の数となります。 + </para> + </caution> <para> フォーマットコードに関する説明は、 <function>pack</function> も参照ください。 </para> - <para> - PHP は内部的に整数を符号付で保持します。 - 大きな値の unsigned long を切出した場合、PHP の内部で保持された値は、 - 同じ大きさの符号付き整数となり、符号無しを指定して切出された場合でも - 結果は負の数となります。 - </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/uniqid.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ja/reference/misc/functions/uniqid.xml diff -u phpdoc-ja/reference/misc/functions/uniqid.xml:1.3 phpdoc-ja/reference/misc/functions/uniqid.xml:1.4 --- phpdoc-ja/reference/misc/functions/uniqid.xml:1.3 Mon Nov 22 23:45:40 2004 +++ phpdoc-ja/reference/misc/functions/uniqid.xml Sat Aug 13 03:06:04 2005 @@ -1,59 +1,66 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.uniqid"> <refnamediv> <refname>uniqid</refname> - <refpurpose>ユニークなIDを生成する</refpurpose> + <refpurpose>ユニークな ID を生成する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <methodsynopsis> <type>string</type><methodname>uniqid</methodname> - <methodparam><type>string</type><parameter>prefix</parameter></methodparam> - <methodparam><type>bool</type><parameter> - <replaceable><optional>lcg</optional></replaceable> - </parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>prefix</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>more_entropy</parameter></methodparam> </methodsynopsis> <simpara> - <function>uniqid</function>は、ミリ秒単位の現在時刻に基づき先頭辞 - (prefix)を付けたユニークなIDを返します。いくつかのホスト上で同 - 時にIDを生成させる場合、全く同じミリ秒のIDが生成されるのを防ぐの - にprefixが有用です。<parameter>prefix</parameter>には114文字まで - の長さを指定することができます。 + <function>uniqid</function> は、ミリ秒単位の現在時刻に基づき + 先頭辞(prefix)を付けたユニークな ID を返します。prefix は + オプションですが、有用です。例えば、いくつかのホスト上で同時に + ID を生成させる場合、全く同じ ID が生成されるのを防ぐことができます。 + PHP 4.3.1 以前では、<parameter>prefix</parameter> には 114 文字までの + 長さしか指定できませんでした。 </simpara> <simpara> - オプションの <parameter>lcg</parameter> パラメータが &true; の場合、 - <function>uniqid</function> は、より結果をユニークにするために - "combined LCG" を返り値の最後に追加します。 + オプションの <parameter>more_entropy</parameter> パラメータが &true; の場合、 + <function>uniqid</function> は、より結果をユニークにするために、 + combined linear congruential generator を用いた結果を返り値の最後に追加します。 </simpara> <simpara> <parameter>prefix</parameter> を空とした場合、返される文字列の長さは、 - 13文字となります。<parameter>lcg</parameter> が&true;の場合は、 - 23文字となります。 + 13 文字となります。<parameter>more_entropy</parameter> が &true; の場合は、 + 23 文字となります。 </simpara> <note> <simpara> - <parameter>lcg</parameter> パラメータは、PHP 4またはPHP 3.0.13以 - 降でのみ使用可能です。 + <parameter>prefix</parameter> パラメータは PHP 5 ではオプションとなります。 </simpara> </note> <para> - ユニークなIDまたはトークンが必要な場合、そして、ネットワーク経由 - でユーザーにそのトークンを渡そうとする場合(例えば、セッションクッ - キー)、次の例のようにするのが推奨されます。 + ユニークな ID またはトークンが必要な場合、そして、ネットワーク経由で + ユーザにそのトークンを渡そうとする場合(例えば、セッションクッキー)、 + 次の例のようにするのが推奨されます。 + </para> + <para> <informalexample> <programlisting role="php"> <![CDATA[ -$token = md5(uniqid("")); // ランダム要素なし -$better_token = md5(uniqid(rand(),1)); // 推測が困難であり、より優れている。 +<?php +// prefix なし +$token = md5(uniqid()); + +// よりよい方法。推測されにくい +$better_token = md5(uniqid(rand(), true)); +?> ]]> </programlisting> </informalexample> </para> <simpara> - この例は、極めて予測困難な 32 文字のID(128ビット16進数)を - 作成します。 + この例は、極めて予測困難な 32 文字の ID(128 ビット 16 進数) + を作成します。 </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/sleep.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ja/reference/misc/functions/sleep.xml diff -u phpdoc-ja/reference/misc/functions/sleep.xml:1.3 phpdoc-ja/reference/misc/functions/sleep.xml:1.4 --- phpdoc-ja/reference/misc/functions/sleep.xml:1.3 Mon Nov 22 23:45:40 2004 +++ phpdoc-ja/reference/misc/functions/sleep.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.sleep"> <refnamediv> <refname>sleep</refname> @@ -9,15 +11,46 @@ <refsect1> <title>説明</title> <methodsynopsis> - <type>void</type><methodname>sleep</methodname> + <type>int</type><methodname>sleep</methodname> <methodparam><type>int</type><parameter>seconds</parameter></methodparam> </methodsynopsis> <simpara> - 関数<function>sleep</function>は、<parameter>seconds</parameter> - で与えられた秒数分プログラムの実行を遅延させます。 + 関数 <function>sleep</function> は、<parameter>seconds</parameter> + で与えられた秒数ぶんプログラムの実行を遅延させます。 </simpara> + <para> + <example> + <title><function>sleep</function> の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// 現在の時刻 +echo date('h:i:s') . "\n"; + +// 10 秒間遅延させる +sleep(10); + +// 再開! +echo date('h:i:s') . "\n"; + +?> +]]> + </programlisting> + <para> + この例の(10 秒後の)出力は以下のようになります。 + </para> + <screen> +<![CDATA[ +05:31:23 +05:31:33 +]]> + </screen> + </example> + </para> <simpara> - <function>usleep</function> も参照のこと。 + <function>usleep</function> + および <function>set_time_limit</function> も参照ください。 </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/show-source.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/show-source.xml diff -u phpdoc-ja/reference/misc/functions/show-source.xml:1.4 phpdoc-ja/reference/misc/functions/show-source.xml:1.5 --- phpdoc-ja/reference/misc/functions/show-source.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/show-source.xml Sat Aug 13 03:06:04 2005 @@ -1,41 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.10 --> -<!-- EN-Revision: 1.24 Maintainer: hirokawa Status: ready --> - <refentry id="function.show-source"> - <refnamediv> - <refname>show_source</refname> - <refpurpose>ファイルの構文ハイライト表示</refpurpose> - </refnamediv> - <refsect1> - <title>説明</title> - <methodsynopsis> - <type>bool</type><methodname>show_source</methodname> - <methodparam><type>string</type><parameter>filename</parameter></methodparam> - </methodsynopsis> - <simpara> - <function>show_source</function>関数は、組込みのPHP用構文ハイライ - ト表示用に定義された色を使用して<parameter>filename</parameter>の - 構文ハイライト表示を出力します。 - 成功時に&true;、そうでない場合に&false;を返します。(PHP 4) - </simpara> - <simpara> - この関数は、関数<function>highlight_file</function>のエイリアスで - す。 - </simpara> - <note> - <simpara> - 関数 <function>show_source</function> および - <function>highlight_file</function>を使用する場合には、パスワー - ドや潜在的なセキュリティ上の危険を生む類の他の情報のような重要な - 情報を不注意で公開してしまわないように注意する必要があります。 - </simpara> - </note> - <simpara> - <function>highlight_string</function>, - <function>highlight_file</function>も参照ください。 - </simpara> - </refsect1> - </refentry> +<!-- EN-Revision: 1.6 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> +<refentry id="function.show-source"> + <refnamediv> + <refname>show_source</refname> + <refpurpose><function>highlight_file</function> &Alias;</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias; + <function>highlight_file</function>. + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/pack.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-ja/reference/misc/functions/pack.xml diff -u phpdoc-ja/reference/misc/functions/pack.xml:1.5 phpdoc-ja/reference/misc/functions/pack.xml:1.6 --- phpdoc-ja/reference/misc/functions/pack.xml:1.5 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/pack.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.2 --> -<!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.pack"> <refnamediv> <refname>pack</refname> @@ -12,20 +14,21 @@ <type>string</type><methodname>pack</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam> </methodsynopsis> <para> - 指定された引数を <parameter>format</parameter> に基づいてバイナリ文 - 字列にパックします。データを含むバイナリ文字列を返します。 + 指定された引数を <parameter>format</parameter> に基づいて + バイナリ文字列にパックします。データを含むバイナリ文字列を返します。 </para> <para> - この関数のアイデアは、Perlからのものであり、フォーマット指定用のコー - ドは、Perlと全く同様に動作します。フォーマット文字列は、フォーマッ - トコードの後にオプションの反復指定用引数が続いている形式となってい - ます。反復指定用引数は、整数値または入力データの最後まで反復を指定 - する * のどちらかを指定することができます。 a, A, h, H の場合、反復 - 数はそのデータ引数が取得する文字の数を指定します。反復数が @ の場合、 - 次のデータを置く場所の絶対位置を表します。その他の場合、反復数はデー - タ引数が使われる数を指定し、結果のバイナリ文字列にパックされます。 + この関数のアイデアは Perl からのものであり、フォーマット指定用の + コードは Perl と全く同様に動作します。フォーマット文字列は、 + フォーマットコードの後にオプションの反復指定用引数が続く形式と + なっています。反復指定用引数として整数値、または入力データの最後まで + 反復を意味する * のどちらかを指定することができます。 a, A, h, H の場合、 + 反復数はそのデータ引数が取得する文字の数を指定します。反復数が @ の場合、 + 次のデータを置く場所の絶対位置を表します。その他の場合、反復数は + データ引数が使われる数を指定し、結果のバイナリ文字列にパックされます。 現在、実装されているものを以下に示します。 <itemizedlist> <listitem> @@ -135,29 +138,28 @@ </listitem> </itemizedlist> <example> - <title><function>pack</function>で文字列をフォーマットする</title> + <title><function>pack</function> で文字列をフォーマットする</title> <programlisting role="php"> <![CDATA[ $binarydata = pack ("nvc*", 0x1234, 0x5678, 65, 66); ]]> </programlisting> <para> - この結果のバイナリ文字列の長さは6バイト長で、バイト列 0x12, 0x34, + この結果のバイナリ文字列の長さは 6 バイト長で、バイト列 0x12, 0x34, 0x78, 0x56, 0x41, 0x42となります。 </para> </example> </para> <para> - 符号付及び符号無しの区別は関数 <function>unpack</function>にのみ - 影響を与え、関数<function>pack</function>は符号付及び符号無しの - フォーマットコードに関して同じ結果を与えるということに注意して下 - さい。 + 符号付及び符号無しの区別は関数 <function>unpack</function> にのみ + 影響を与え、関数 <function>pack</function> は符号付及び符号無しの + フォーマットコードに関して同じ結果を与えるということに注意して下さい。 </para> <para> PHP は内部的に値をマシン依存の大きさの符号付の - <type>integer</type>値として保持することにも注意してください。 + <type>integer</type> 値として保持することにも注意してください。 このように保持するには大きすぎる符号無しの値を与えた場合、 - <type>float</type>に変換する際にしばしば期待外れの結果となります。 + <type>float</type> に変換する際にしばしば期待外れの結果となります。 </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/ignore-user-abort.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/ignore-user-abort.xml diff -u phpdoc-ja/reference/misc/functions/ignore-user-abort.xml:1.4 phpdoc-ja/reference/misc/functions/ignore-user-abort.xml:1.5 --- phpdoc-ja/reference/misc/functions/ignore-user-abort.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/ignore-user-abort.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.2 --> <!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.ignore-user-abort"> <refnamediv> <refname>ignore_user_abort</refname> @@ -13,17 +15,19 @@ <title>説明</title> <methodsynopsis> <type>int</type><methodname>ignore_user_abort</methodname> - <methodparam><type>int</type><parameter> - <replaceable><optional>setting</optional></replaceable> - </parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>setting</parameter></methodparam> </methodsynopsis> <simpara> - この関数は、クライアントとの接続断がスクリプトの実行中断を引き起 - こすかどうかを設定します。この関数は前の設定を返し、現在の設定を - 変えずに現在の設定を返すためだけのために引数なしでコールすること - が可能です。PHPにおける接続処理の詳細な説明に関しては、機能の章の + この関数は、クライアントとの接続断がスクリプトの実行中断を引き起こすか + どうかを設定します。この関数は前の設定を返し、現在の設定を + 変えずに現在の設定を返すためだけのために引数なしでコールすることが + 可能です。PHP における接続処理の詳細な説明に関しては、機能の章の 接続処理の節を参照ください。 </simpara> + <para> + <function>connection_aborted</function> + および <function>connection_status</function> も参照ください。 + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/highlight-string.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/highlight-string.xml diff -u phpdoc-ja/reference/misc/functions/highlight-string.xml:1.4 phpdoc-ja/reference/misc/functions/highlight-string.xml:1.5 --- phpdoc-ja/reference/misc/functions/highlight-string.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/highlight-string.xml Sat Aug 13 03:06:04 2005 @@ -1,27 +1,74 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.10 --> -<!-- EN-Revision: 1.22 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.highlight-string"> <refnamediv> <refname>highlight_string</refname> - <refpurpose>文字列の構文ハイライト化</refpurpose> + <refpurpose>文字列の構文ハイライト表示</refpurpose> </refnamediv> <refsect1> <title>説明</title> <methodsynopsis> - <type>bool</type><methodname>highlight_string</methodname> + <type>mixed</type><methodname>highlight_string</methodname> <methodparam><type>string</type><parameter>str</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>return</parameter></methodparam> </methodsynopsis> <simpara> - <function>highlight_string</function> 関数は、PHP組込みの構文ハイ - ライタで定義されたカラーを使用して<parameter>str</parameter>を構 - 文ハイライト表示されたものを出力します。 - &return.success; + <function>highlight_string</function> 関数は、PHP 組込みの + 構文ハイライタで定義されたカラーを使用して <parameter>str</parameter> + を構文ハイライト表示したものを出力します。 </simpara> - &tip.ob-capture; <simpara> - <function>highlight_file</function>, - <function>show_source</function>も参照ください。 + 2 番目のパラメータ <parameter>return</parameter> が &true; の場合、 + ハイライト表示されたコードを画面に表示するかわりに、そのコード自体を + <function>highlight_string</function> 関数の返り値とします。 + 2 番目のパラメータが &true; ではない場合、<function>highlight_string</function> + の返り値は成功時に &true; 、失敗時に &false; となります。 + </simpara> + <para> + <example> + <title><function>highlight_string</function> の例</title> + <programlisting role="php"> +<![CDATA[ +<?php +highlight_string('<?php phpinfo(); ?>'); +?> +]]> + </programlisting> + <para> + 上の例の出力は(PHP 4 では)以下のようになります。 + </para> + <screen> +<![CDATA[ +<code><font color="#000000"> +<font color="#0000BB">&lt;?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?&gt;</font> +</font> +</code> +]]> + </screen> + <para> + 上の例の出力は(PHP 5 では)以下のようになります。 + </para> + <screen> +<![CDATA[ +<code><span style="color: #000000"> +<span style="color: #0000BB">&lt;?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?&gt;</span> +</span> +</code> +]]> + </screen> + </example> + </para> + <note> + <simpara> + <parameter>return</parameter> パラメータは PHP 4.2.0 以降で有効です。 + それ以前は、常にこのパラメータのデフォルト値である &false; と同じ動作でした。 + </simpara> + </note> + <simpara> + <function>highlight_file</function> も参照ください。 </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/highlight-file.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/highlight-file.xml diff -u phpdoc-ja/reference/misc/functions/highlight-file.xml:1.4 phpdoc-ja/reference/misc/functions/highlight-file.xml:1.5 --- phpdoc-ja/reference/misc/functions/highlight-file.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/highlight-file.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.10 --> -<!-- EN-Revision: 1.22 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.20 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.highlight-file"> <refnamediv> <refname>highlight_file</refname> @@ -9,96 +11,56 @@ <refsect1> <title>説明</title> <methodsynopsis> - <type>bool</type><methodname>highlight_file</methodname> + <type>mixed</type><methodname>highlight_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>return</parameter></methodparam> </methodsynopsis> <simpara> - 関数 <function>highlight_file</function>は、 - <parameter>filename</parameter>の中のコードをPHP組込の構文ハイラ - イタで定義されたカラーを使用して構文ハイライト表示したものを出力 - します。この関数は、成功時に&true;、その他の場合に&false;を返します。 - (PHP 4) + <function>highlight_file</function> 関数は、 + <parameter>filename</parameter> の中のコードを構文ハイライト表示して + 出力します。色は、PHP 組込の構文ハイライタで定義されているものを使用します。 + </simpara> + <simpara> + 2 番目のパラメータ <parameter>return</parameter> が &true; の場合、 + ハイライト表示されたコードを画面に表示するかわりに、そのコード自体を + <function>highlight_file</function> 関数の返り値とします。 + 2 番目のパラメータが &true; ではない場合、<function>highlight_file</function> + の返り値は成功時に &true; 、失敗時に &false; となります。 </simpara> <note> <simpara> - 関数 <function>show_source</function> および - <function>highlight_file</function>を使用する場合には、パスワー - ドや潜在的なセキュリティ上の危険を生む類の他の情報のような重要な - 情報を不注意で公開してしまわないように注意する必要があります。 + <parameter>return</parameter> パラメータは PHP 4.2.0 以降で有効です。 + それ以前は、常にこのパラメータのデフォルト値である &false; と同じ動作でした。 + </simpara> + </note> + <note> + <simpara> + PHP 4.2.1 以降、この関数は <link + linkend="ini.safe-mode">safe_mode</link> および <link + linkend="ini.open-basedir">open_basedir</link> の影響を受けます。 </simpara> </note> + <caution> + <simpara> + <function>highlight_file</function> 関数を使用する場合には、 + パスワードやその他潜在的なセキュリティ上の危険を生む類の重要な + 情報を不注意で公開してしまわないように注意する必要があります。 + </simpara> + </caution> <para> - <example> - <title>URLのソースハイライト表示の作成</title> - <simpara> - 引数として指定したスクリプトのコードをハイライト表示できるよう - なURLを設定する際には、適したURLパターンを生成するためにApache - の &quot;ForceType&quot; ディレクティブを使用し、見栄えの良いコー - ドリストを表示するために関数<function>highlight_file</function> - を使用します。 - </simpara> - <simpara> - httpd.confに次のような記述を追加します。 - </simpara> - <para> - <informalexample> - <programlisting> -<![CDATA[ -<Location /source> - ForceType application/x-httpd-php -</Location> -]]> - </programlisting> - </informalexample> - </para> - <simpara> - そして、"source"という名前のファイルを作成し、それをWebのルート - ディレクトリに置きます。 - </simpara> - <para> - <programlisting role="php"> + 多くのサーバでは、拡張子が <emphasis>phps</emphasis> のファイルは + 自動的に構文ハイライト表示されるように設定されています。例えば + <filename>example.phps</filename> のようなファイルは、構文ハイライト + したソースファイルとして表示されます。これを有効にするには、 + &httpd.conf; に以下のような行を追加します。 + </para> + <screen> <![CDATA[ -<HTML> -<HEAD> -<TITLE>Source Display</TITLE> -</HEAD> -<BODY BGCOLOR="white"> -<?php - $script = getenv ("PATH_TRANSLATED"); - if(!$script) { - echo "<BR><B>ERROR: Script Name needed</B><BR>"; - } else { - if (ereg("(\.php|\.inc)$",$script)) { - echo "<H1>Source of: $PATH_INFO</H1>\n<HR>\n"; - highlight_file($script); - } else { - echo "<H1>ERROR: Only PHP or include script names are allowed</H1>"; - } - } - echo "<HR>Processed: ".date("Y/M/d H:i:s",time()); -?> -</BODY> -</HTML> +AddType application/x-httpd-php-source .phps ]]> - </programlisting> - </para> - <simpara> - これにより、"/path/to/script.php"にあるスクリプトのカラー表示を - 表示するために以下のURLを使用することができるようになります。 - </simpara> - <para> - <informalexample> - <programlisting> -http://your.server.com/source/path/to/script.php - </programlisting> - </informalexample> - </para> - </example> - </para> - &tip.ob-capture; + </screen> <simpara> - <function>highlight_string</function>, - <function>show_source</function>も参照ください。 + <function>highlight_string</function> も参照ください。 </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/get-browser.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-ja/reference/misc/functions/get-browser.xml diff -u phpdoc-ja/reference/misc/functions/get-browser.xml:1.5 phpdoc-ja/reference/misc/functions/get-browser.xml:1.6 --- phpdoc-ja/reference/misc/functions/get-browser.xml:1.5 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/get-browser.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.get-browser"> <refnamediv> <refname>get_browser</refname> @@ -10,93 +12,111 @@ </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>get_browser</methodname> - <methodparam><type>string</type><parameter> - <replaceable><optional>user_agent</optional></replaceable> - </parameter></methodparam> - </methodsynopsis> - <simpara> - <function>get_browser</function> は、ユーザーのブラウザの機能を定 - 義します。これは、<filename>browscap.ini</filename>ファイルのブラ - ウザ情報を調べることにより行います。デフォルトでは、 - $HTTP_USER_AGENTの値が使用されます。しかし、オプションの - <parameter>user_agent</parameter> パラメータを + <methodsynopsis> + <type>mixed</type><methodname>get_browser</methodname> + <methodparam choice="opt"><type>string</type><parameter>user_agent</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>return_array</parameter></methodparam> + </methodsynopsis> + <para> + <function>get_browser</function> は、ユーザのブラウザの機能を + 定義します。これは、<filename>browscap.ini</filename> ファイルの + ブラウザ情報を調べることにより行います。 + </para> + <para> + デフォルトでは、$HTTP_USER_AGENT の値が使用されます。しかし、 + オプションの <parameter>user_agent</parameter> パラメータを <function>get_browser</function> に渡すことにより、これを変える (すなわち、他のブラウザの情報を調べる)ことが可能です。 - </simpara> + &null; を指定することで <parameter>user_agent</parameter> + パラメータを処理しないようにできます。 + </para> <simpara> - 返される情報はオブジェクトであり、例えば、ブラウザのメジャーおよ - びマイナーバージョン暗号やID文字列、といった様々なデータ要素を含 - んでいます。フレーム、JavaScript、クッキー等のような機能に関する - &true;/false の値、マイナーバージョン暗号やID文字列、といった様々な - データ要素を含んでいます。 + 返される情報はオブジェクト(<type>object</type>)であり、例えば + ブラウザのメジャーおよびマイナーバージョン番号や ID 文字列といった + 様々なデータ要素を含んでいます。また、フレーム、JavaScript、 + クッキーのような機能に関する &true;/&false; の値も含んでいます。 </simpara> <simpara> - <filename>browscap.ini</filename> は多くのブラウザに関する情報を - 有していますが、データベースを最新に保つのはユーザーによる更新 - に依存しています。 - ファイルのフォーマット自体を見ればおおよそのことがわかります。 + PHP 4.3.2 以降、オプションのパラメータ <parameter>return_array</parameter> + が &true; の場合には、この関数は <type>object</type> ではなく + <type>array</type> を返します。 </simpara> <para> - 次の例では、ユーザーのブラウザに関する全ての取得可能な情報 - の一覧を作成する手法に関するものです。 <example> - <title><function>get_browser</function>の例</title> + <title>ユーザのブラウザについてのすべての情報を表示する</title> <programlisting role="php"> <![CDATA[ <?php -function list_array ($array) { - while (list ($key, $value) = each ($array)) { - $str .= "<b>$key:</b> $value<br>\n"; - } - return $str; -} -echo "$HTTP_USER_AGENT<hr>\n"; -$browser = get_browser(); -echo list_array ((array) $browser); +echo $_SERVER['HTTP_USER_AGENT'] . "\n\n"; + +$browser = get_browser(null, true); +print_r($browser); ?> ]]> </programlisting> - </example> - </para> - <simpara> - 上のスクリプトの出力は、次のようになります。 - </simpara> - <programlisting> + &example.outputs.similar; + <screen> <![CDATA[ -Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)<hr> -<b>browser_name_pattern:</b> Mozilla/4\.5.*<br> -<b>parent:</b> Netscape 4.0<br> -<b>platform:</b> Unknown<br> -<b>majorver:</b> 4<br> -<b>minorver:</b> 5<br> -<b>browser:</b> Netscape<br> -<b>version:</b> 4<br> -<b>frames:</b> 1<br> -<b>tables:</b> 1<br> -<b>cookies:</b> 1<br> -<b>backgroundsounds:</b> <br> -<b>vbscript:</b> <br> -<b>javascript:</b> 1<br> -<b>javaapplets:</b> 1<br> -<b>activexcontrols:</b> <br> -<b>beta:</b> <br> -<b>crawler:</b> <br> -<b>authenticodeupdate:</b> <br> -<b>msn:</b> <br> +Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3 + +Array +( + [browser_name_regex] => ^mozilla/5\.0 (windows; .; windows nt 5\.1; .*rv:.*) gecko/.* firefox/0\.9.*$ + [browser_name_pattern] => Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/0.9* + [parent] => Firefox 0.9 + [platform] => WinXP + [browser] => Firefox + [version] => 0.9 + [majorver] => 0 + [minorver] => 9 + [css] => 2 + [frames] => 1 + [iframes] => 1 + [tables] => 1 + [cookies] => 1 + [backgroundsounds] => + [vbscript] => + [javascript] => 1 + [javaapplets] => 1 + [activexcontrols] => + [cdf] => + [aol] => + [beta] => 1 + [win16] => + [crawler] => + [stripper] => + [wap] => + [netclr] => +) ]]> - </programlisting> - <simpara> - これを動作させるためには、設定ファイルの - <link linkend="ini.browscap">browscap</link>を正しく - <filename>browscap.ini</filename> の場所に設定しておく必要があります。 - </simpara> - <simpara> - (<filename>browscap.ini</filename> ファイルを取得できる場所を含む) - より詳細な情報については、 - <ulink url="&url.php.faq;">&url.php.faq;</ulink>にあるPHP FAQを参照ください。 - </simpara> + </screen> + </example> + </para> + <para> + <literal>cookies</literal> の値は、単にそのブラウザがクッキーを扱う機能を + 有していることを示すだけであり、ユーザがクッキーを受け入れる設定に + しているかどうかを表すものではありません。それをチェックする唯一の方法は、 + いったん <function>setcookie</function> でクッキーを設定してからリロードし、 + その値を調べることです。 + </para> + <note> + <para> + この関数が正常に機能するためには、&php.ini; の <link linkend="ini.browscap">browscap</link> + 設定が、システム上の <filename>browscap.ini</filename> の正確な位置を + 指している必要があります。 + </para> + <para> + <filename>browscap.ini</filename> は PHP にはバンドルされていません。 + しかし、ここで <ulink url="&url.browscap.download;">最新の php_browscap.ini</ulink> + を入手することができます。 + </para> + <para> + <filename>browscap.ini</filename> は多くのブラウザに関する情報を + 有していますが、データベースを最新に保つのはユーザーによる更新に + 依存しています。 + ファイルのフォーマット自体を見ればおおよそのことがわかります。 + </para> + </note> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/exit.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/exit.xml diff -u phpdoc-ja/reference/misc/functions/exit.xml:1.4 phpdoc-ja/reference/misc/functions/exit.xml:1.5 --- phpdoc-ja/reference/misc/functions/exit.xml:1.4 Mon Nov 22 23:45:40 2004 +++ phpdoc-ja/reference/misc/functions/exit.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.6 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.10 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.exit"> <refnamediv> <refname>exit</refname> @@ -19,23 +20,24 @@ </note> <note> <simpara> - PHPバージョン &gt;= 4.2.0 では<parameter>status</parameter>が - <type>integer</type>の場合それを表示しません。 + PHP &gt;= 4.2.0 では<parameter>status</parameter> が + <type>integer</type> の場合それを表示しません。 </simpara> </note> <simpara> <function>exit</function> 関数は、スクリプトの実行を終了します。 - 終了直前に<parameter>status</parameter>を出力します。 + 終了直前に <parameter>status</parameter> を出力します。 </simpara> <simpara> - <parameter>status</parameter>が<type>integer</type>の場合、 + <parameter>status</parameter> が <type>integer</type> の場合、 その値も終了ステータスとして使用されます。 - 終了ステータスは1から254までの間の値であるべきであり、 - ステータス255はPHPによって予約されているので使用すべきではありません。 + 終了ステータスは 0 から 254 までの間の値であるべきであり、 + ステータス 255 はPHPによって予約されているので使用すべきではありません。 + ステータス 0 は、プログラムを正常に終了させる際に使用します。 </simpara> <para> <example> - <title><function>exit</function>の例</title> + <title><function>exit</function> の例</title> <programlisting role="php"> <![CDATA[ <?php @@ -47,17 +49,37 @@ ?> ]]> </programlisting> - <!-- TODO: example with integer exit-statis --> + </example> + </para> + <para> + <example> + <title><function>exit</function> ステータスの例</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// プログラムを正常に終了する +exit; +exit(); +exit(0); + +// エラーコードとともに終了する +exit(1); +exit(0376); // 8 進数 + +?> +]]> + </programlisting> </example> </para> <note> <simpara> - 関数<function>die</function>は、<function>exit</function>の + 関数 <function>die</function> は、<function>exit</function> の エイリアスです。 </simpara> </note> <para> - <function>register_shutdown_function</function>も参照してください。 + <function>register_shutdown_function</function> も参照ください。 </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/eval.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/eval.xml diff -u phpdoc-ja/reference/misc/functions/eval.xml:1.4 phpdoc-ja/reference/misc/functions/eval.xml:1.5 --- phpdoc-ja/reference/misc/functions/eval.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/eval.xml Sat Aug 13 03:06:04 2005 @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.2 --> -<!-- EN-Revision: 1.58 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.eval"> <refnamediv> <refname>eval</refname> - <refpurpose>文字列をPHPコードとして評価する</refpurpose> + <refpurpose>文字列を PHP コードとして評価する</refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -21,22 +23,26 @@ <simpara> <function>eval</function> を使用する際、注意するべき点が いくつかあります。 - パーサーが <function>eval</function>の処理中に落ちないように、 - 渡す文字列はセミコロンで文が終了するといった有効なPHPコード + パーサが <function>eval</function> の処理中に落ちないように、 + 渡す文字列はセミコロンで文が終了するといった有効な PHP コード である必要があります。また、<parameter>code_str</parameter> の 中の文字を適切にエスケープする必要があります。 - </simpara> + </simpara> <simpara> - <function>eval</function>の中で値を与えた変数は、 + <function>eval</function> の中で値を与えた変数は、 この後、メインスクリプトの中でもこれらの値を維持することも 覚えておいてください。 </simpara> <simpara> <literal>return</literal> 文は、文字列の評価をただちに終了します。 - PHP4では、<function>eval</function>関数は &false;を返します。さも - なくば、結果の値を返すために<literal>return</literal>を使用するこ - とが可能です。一方、PHP3では、<function>eval</function>の型は - <literal>void</literal>であり、値を何も返しません。 + PHP 4 では、評価されるコードの中で <literal>return</literal> が + コールされない限り、<function>eval</function> は &null; を返します。 + <literal>return</literal> がコールされた場合は、その値を返します。 + 評価されるコードの中でパースエラーが発生した場合は、 + <function>eval</function> は &false; を返します。 + 評価されるコードの中で致命的なエラーが発生した場合は、 + スクリプト全体が終了します。 + PHP 3 では、<function>eval</function> は値を返しません。 </simpara> <para> <example> @@ -48,25 +54,26 @@ <?php $string = 'cup'; $name = 'coffee'; -$str = 'This is a $string with my $name in it.<br>'; -echo $str; -eval ("\$str = \"$str\";"); -echo $str; +$str = 'This is a $string with my $name in it.'; +echo $str. "\n"; +eval("\$str = \"$str\";"); +echo $str. "\n"; ?> ]]> </programlisting> - <para> - 上の例は、以下を表示します。 - <screen> + &example.outputs; + <screen> <![CDATA[ This is a $string with my $name in it. This is a cup with my coffee in it. ]]> - </screen> - </para> + </screen> </example> </para> - &tip.ob-capture; + &tip.ob-capture; + <para> + <function>call_user_func</function> も参照ください。 + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/die.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ja/reference/misc/functions/die.xml diff -u phpdoc-ja/reference/misc/functions/die.xml:1.3 phpdoc-ja/reference/misc/functions/die.xml:1.4 --- phpdoc-ja/reference/misc/functions/die.xml:1.3 Mon Nov 22 23:45:40 2004 +++ phpdoc-ja/reference/misc/functions/die.xml Sat Aug 13 03:06:04 2005 @@ -1,15 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.2 --> -<!-- EN-Revision: 1.57 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.die"> <refnamediv> <refname>die</refname> - <refpurpose><function>exit</function>のエイリアス</refpurpose> + <refpurpose><function>exit</function> と同等</refpurpose> </refnamediv> <refsect1> <title>説明</title> <para> - この関数は<function>exit</function>のエイリアスです。 + この関数は<function>exit</function> と同等です。 </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/defined.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/defined.xml diff -u phpdoc-ja/reference/misc/functions/defined.xml:1.4 phpdoc-ja/reference/misc/functions/defined.xml:1.5 --- phpdoc-ja/reference/misc/functions/defined.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/defined.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.defined"> <refnamediv> <refname>defined</refname> @@ -16,23 +18,38 @@ </methodsynopsis> <para> <parameter>name</parameter> で指定した名前の定数が定義されている - 場合に&true;、その他の場合に&false;を返します。 + 場合に &true;、その他の場合に&false;を返します。 + </para> + <para> <example> <title>定数のチェック</title> <programlisting role="php"> <![CDATA[ <?php -if (defined("CONSTANT")){ // 引用符で括られている必要があります - echo CONSTANT; // - } +/* 引用符の使い方に注意してください。これは重要です。この例では + * 文字列 'CONSTANT' が、定数 CONSTANT の名前かどうかを調べています。*/ +if (defined('CONSTANT')) { + echo CONSTANT; +} ?> ]]> </programlisting> </example> </para> + <note> + <para> + 変数が存在するかどうかを知りたければ、<function>isset</function> + を利用してください。<function>defined</function> は + <link linkend="language.constants">定数</link>にしか適用できません。 + 関数が存在するかどうかを知りたければ、 + <function>function_exists</function> を利用してください。 + </para> + </note> <para> <function>define</function>, - <function>constant</function> および + <function>constant</function>, + <function>get_defined_constants</function>, + <function>function_exists</function> および <link linkend="language.constants">定数</link> の節も参照ください。 </para> </refsect1> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/define.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/define.xml diff -u phpdoc-ja/reference/misc/functions/define.xml:1.4 phpdoc-ja/reference/misc/functions/define.xml:1.5 --- phpdoc-ja/reference/misc/functions/define.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/define.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.define"> <refnamediv> <refname>define</refname> @@ -13,8 +15,7 @@ <methodparam><type>string</type><parameter>name</parameter></methodparam> <methodparam><type>mixed</type><parameter>value</parameter></methodparam> <methodparam><type>bool</type><parameter> - <replaceable><optional>case_insensitive</optional></replaceable> - </parameter></methodparam> + <replaceable><optional>case_insensitive</optional></replaceable></parameter></methodparam> </methodsynopsis> <para> 名前を指定して定数を定義します。詳細は、 @@ -25,8 +26,8 @@ 値は <parameter>value</parameter> により指定されます。 </para> <para> - オプションの第3のパラメータ - <parameter>case_insensitive</parameter>も使用可能です。値 + オプションの第 3 のパラメータ + <parameter>case_insensitive</parameter> も使用可能です。値 <constant>TRUE</constant> が指定された場合、定数は大文字小文字を 区別しなくなります。デフォルトの動作は、大文字小文字を区別します。 例えば、CONSTANT と Constant は異なった値を表します。 @@ -37,11 +38,11 @@ <programlisting role="php"> <![CDATA[ <?php -define ("CONSTANT", "Hello world."); +define("CONSTANT", "Hello world."); echo CONSTANT; // "Hello world."を出力します。 echo Constant; // "Constant"を出力し、警告が発生します。 -define ("GREETING", "Hello you.",TRUE); +define("GREETING", "Hello you.", true); echo GREETING; // "Hello you."を出力 echo Greeting; // "Hello you."を出力 @@ -51,8 +52,7 @@ </example> </para> <para> - <function>define</function> は成功時に&true;、エラー発生時に - &false;を返します。 + &return.success; </para> <para> <function>defined</function>, http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/constant.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/constant.xml diff -u phpdoc-ja/reference/misc/functions/constant.xml:1.4 phpdoc-ja/reference/misc/functions/constant.xml:1.5 --- phpdoc-ja/reference/misc/functions/constant.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/constant.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.16 --> -<!-- EN-Revision: 1.38 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.constant"> <refnamediv> <refname>constant</refname> @@ -13,13 +15,13 @@ <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <simpara> - <function>constant</function> は、<parameter>name</parameter>で指 - 定した定数の値を返します。 + <function>constant</function> は、<parameter>name</parameter> で + 指定した定数の値を返します。 </simpara> <simpara> - <function>constant</function> はある定数の値を取得する必要がある - が、その名前が不明な場合に有用です。これは、定数が変数に保存され - ているか、関数により返されるかの場合です。 + <function>constant</function> はある定数の値を取得する必要があるが、 + その名前が不明な場合に有用です。これは、定数が変数に保存されているか、 + 関数により返されるかの場合です。 </simpara> <para> <example> @@ -28,7 +30,7 @@ <![CDATA[ <?php -define ("MAXSIZE", 100); +define("MAXSIZE", 100); echo MAXSIZE; echo constant("MAXSIZE"); // 前の行と動作は同じ @@ -40,9 +42,8 @@ </para> <para> <function>define</function>, - <function>defined</function>, - <function>constant</function> および <link - linkend="language.constants">定数</link> の節を参照ください。 + <function>defined</function> および <link + linkend="language.constants">定数</link> の節も参照ください。 </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/connection-timeout.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/connection-timeout.xml diff -u phpdoc-ja/reference/misc/functions/connection-timeout.xml:1.4 phpdoc-ja/reference/misc/functions/connection-timeout.xml:1.5 --- phpdoc-ja/reference/misc/functions/connection-timeout.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/connection-timeout.xml Sat Aug 13 03:06:04 2005 @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.connection-timeout"> <refnamediv> <refname>connection_timeout</refname> - <refpurpose>スクリプトがタイムアウトした場合に&true;を返す</refpurpose> + <refpurpose>スクリプトがタイムアウトした場合に &true; を返す</refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -18,14 +20,17 @@ <warning> <title>過去の関数</title> <simpara> - この関数は、過去のものであり、4.0.5以降には存在しません。 + この関数は、過去のものであり、4.0.5 以降には存在しません。 </simpara> </warning> <simpara> - 詳細な説明に関しては、<link linkend="features">機能 </link>に関す - る章の<link linkend="features.connection-handling">接続処理 + 詳細な説明に関しては、<link linkend="features">機能 </link>に + 関する章の<link linkend="features.connection-handling">接続処理 </link>に関する記述を参照ください。 </simpara> + <para> + <function>connection_status</function> も参照ください。 + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/connection-status.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/misc/functions/connection-status.xml diff -u phpdoc-ja/reference/misc/functions/connection-status.xml:1.4 phpdoc-ja/reference/misc/functions/connection-status.xml:1.5 --- phpdoc-ja/reference/misc/functions/connection-status.xml:1.4 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/connection-status.xml Sat Aug 13 03:06:04 2005 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.connection-status"> <refnamediv> <refname>connection_status</refname> @@ -14,10 +16,14 @@ </methodsynopsis> <simpara> 接続ステータスのビットフィールドを返します。 - 詳細な説明に関しては、<link linkend="features">機能 </link>に関す - る章の<link linkend="features.connection-handling">接続処理 + 詳細な説明に関しては、<link linkend="features">機能 </link>に + 関する章の<link linkend="features.connection-handling">接続処理 </link>に関する記述を参照ください。 </simpara> + <para> + <function>connection_aborted</function> + および <function>ignore_user_abort</function> も参照ください。 + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/functions/connection-aborted.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-ja/reference/misc/functions/connection-aborted.xml diff -u phpdoc-ja/reference/misc/functions/connection-aborted.xml:1.5 phpdoc-ja/reference/misc/functions/connection-aborted.xml:1.6 --- phpdoc-ja/reference/misc/functions/connection-aborted.xml:1.5 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/functions/connection-aborted.xml Sat Aug 13 03:06:04 2005 @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./ja/functions/misc.xml, last change in rev 1.1 --> -<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <refentry id="function.connection-aborted"> <refnamediv> <refname>connection_aborted</refname> <refpurpose> - クライアントとの接続が切断された場合に&true;を返す + クライアントとの接続が切断された場合に &true; を返す </refpurpose> </refnamediv> <refsect1> @@ -15,11 +17,15 @@ <void/> </methodsynopsis> <simpara> - クライアントとの接続が切断された場合に&true;を返します。 + クライアントとの接続が切断された場合に &true; を返します。 詳細な説明に関しては、<link linkend="features">機能</link> に関する章の <link linkend="features.connection-handling">接続処理</link> に関する記述を参照ください。 </simpara> + <para> + <function>connection_status</function> + および <function>ignore_user_abort</function> も参照ください。 + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/reference.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ja/reference/misc/reference.xml diff -u phpdoc-ja/reference/misc/reference.xml:1.3 phpdoc-ja/reference/misc/reference.xml:1.4 --- phpdoc-ja/reference/misc/reference.xml:1.3 Fri Dec 13 20:38:53 2002 +++ phpdoc-ja/reference/misc/reference.xml Sat Aug 13 03:06:04 2005 @@ -1,7 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <reference id="ref.misc"> - <title>その他の関数(Misc)</title> + <title>その他の関数(Misc)</title> <titleabbrev>その他</titleabbrev> <partintro> @@ -30,11 +32,8 @@ &no.resource; </section> - <section id="misc.constants"> - &reftitle.constants; - &no.constants; - </section> - + &reference.misc.constants; + </partintro> &reference.misc.functions; http://cvs.php.net/diff.php/phpdoc-ja/reference/misc/ini.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-ja/reference/misc/ini.xml diff -u phpdoc-ja/reference/misc/ini.xml:1.2 phpdoc-ja/reference/misc/ini.xml:1.3 --- phpdoc-ja/reference/misc/ini.xml:1.2 Sun Jan 2 02:23:37 2005 +++ phpdoc-ja/reference/misc/ini.xml Sat Aug 13 03:06:04 2005 @@ -1,17 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: takagi --> <section id="misc.configuration"> &reftitle.runtime; &extension.runtime; <para> <table> - <title>Misc.の設定オプション</title> - <tgroup cols="3"> + <title>Misc の設定オプション</title> + <tgroup cols="4"> <thead> <row> <entry>名前</entry> <entry>デフォルト</entry> <entry>変更の可否</entry> + <entry>変更履歴</entry> </row> </thead> <tbody> @@ -19,50 +22,59 @@ <entry>ignore_user_abort</entry> <entry>"0"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>highlight.string</entry> - <entry>#CC0000</entry> + <entry>"#DD0000"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>highlight.comment</entry> - <entry>#FF9900</entry> + <entry>"#FF8000"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>highlight.keyword</entry> - <entry>#006600</entry> + <entry>"#007700"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>highlight.bg</entry> - <entry>#FFFFFF</entry> + <entry>"#FFFFFF"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>highlight.default</entry> - <entry>#0000CC</entry> + <entry>"#0000BB"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>highlight.html</entry> - <entry>#000000</entry> + <entry>"#000000"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>browscap</entry> <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> </tbody> </tgroup> </table> - PHP_INI_* 定数の詳細と定義については、 - <function>ini_set</function>を参照してください。 + &ini.php.constants; </para> + + &ini.descriptions.title; + <para> - 以下に設定ディレクティブの簡単な説明を示します。 <variablelist> <varlistentry id="ini.ignore-user-abort"> @@ -72,25 +84,45 @@ </term> <listitem> <para> - デフォルトで&true;。&false;に変更した場合、スクリプトは、 + デフォルトは &true; 。&false; に変更した場合、スクリプトは、 クライアントが接続を破棄した後に何かを出力しようとした際に直ちに 終了します。 </para> <para> - <function>ignore_user_abort</function>も参照してください。 + <function>ignore_user_abort</function> も参照ください。 </para> </listitem> </varlistentry> <varlistentry id="ini.syntax-highlighting"> - <term> - <parameter>highlight.xxx</parameter> - <type>string</type> - </term> + <term> + <parameter>highlight.bg</parameter> + <type>string</type> + </term> + <term> + <parameter>highlight.comment</parameter> + <type>string</type> + </term> + <term> + <parameter>highlight.default</parameter> + <type>string</type> + </term> + <term> + <parameter>highlight.html</parameter> + <type>string</type> + </term> + <term> + <parameter>highlight.keyword</parameter> + <type>string</type> + </term> + <term> + <parameter>highlight.string</parameter> + <type>string</type> + </term> <listitem> <para> 構文ハイライト表示モードの色。 - &lt;font color="??????"&gt;形式のものは全て動作します。 + &lt;font color="??????"&gt; 形式のものは全て動作します。 </para> </listitem> </varlistentry> @@ -102,9 +134,9 @@ </term> <listitem> <para> - browser capabilities file(ブラウザ機能ファイル)の - 名前(例: <filename>browscap.ini</filename>)と場所。 - <function>get_browser</function>も参照してください。 + browser capabilities file (ブラウザ機能ファイル) の + 名前 (例: <filename>browscap.ini</filename>) と場所。 + <function>get_browser</function> も参照ください。 </para> </listitem> </varlistentry>
« previous php.doc.ja (#1119) next »