cvs: peardoc /ja/core/pear/pear -pear.xml constants.xml expecterror.xml getstaticproperty.xml intro.xml iserror.xml loadextension.xml pear.xml
popexpect.xml raiseerror.xml registershutdownfunction.xml seterrorhandling.xml

From: Date: Thu, 06 May 2004 06:31:29 +0000
Subject: cvs: peardoc /ja/core/pear/pear -pear.xml constants.xml expecterror.xml getstaticproperty.xml intro.xml iserror.xml loadextension.xml pear.xml
popexpect.xml raiseerror.xml registershutdownfunction.xml seterrorhandling.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-3906@lists.php.net to get a copy of this message
haruki Thu May 6 02:31:29 2004 EDT Modified files: /peardoc/ja/core/pear/pear -pear.xml constants.xml expecterror.xml getstaticproperty.xml intro.xml iserror.xml loadextension.xml pear.xml popexpect.xml raiseerror.xml registershutdownfunction.xml seterrorhandling.xml Log: add and change translations.

http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/-pear.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/-pear.xml diff -u peardoc/ja/core/pear/pear/-pear.xml:1.1 peardoc/ja/core/pear/pear/-pear.xml:1.2 --- peardoc/ja/core/pear/pear/-pear.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/-pear.xml Thu May 6 02:31:29 2004 @@ -1,6 +1,7 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.2 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.-pear"> <refnamediv> <refname>PEAR::_PEAR()</refname> http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/constants.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/constants.xml diff -u peardoc/ja/core/pear/pear/constants.xml:1.1 peardoc/ja/core/pear/pear/constants.xml:1.2 --- peardoc/ja/core/pear/pear/constants.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/constants.xml Thu May 6 02:31:29 2004 @@ -1,6 +1,7 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.2 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.7 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.constants"> <refnamediv> <refname>定数</refname> @@ -9,59 +10,59 @@ <refsect1 id="core.pear.pear.constants.pear-error-callback"> <title><constant>PEAR_ERROR_CALLBACK</constant></title> <simpara> - PEARエラー処理に関連します。 + PEAR エラー処理に関連します。 </simpara> <para> &class.pear-error;, <link linkend="core.pear.pear.seterrorhandling"><function> - setErrorHandling</function></link>を参照下さい。 + setErrorHandling</function></link> を参照してください。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.constants.pear-error-die"> <title><constant>PEAR_ERROR_DIE</constant></title> <simpara> - PEARエラー処理に関連します。 + PEAR エラー処理に関連します。 </simpara> <para> &class.pear-error;, <link linkend="core.pear.pear.seterrorhandling"><function> - setErrorHandling</function></link>を参照下さい。 + setErrorHandling</function></link> を参照してください。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.constants.pear-error-print"> <title><constant>PEAR_ERROR_PRINT</constant></title> <simpara> - PEARエラー処理に関連します。 + PEAR エラー処理に関連します。 </simpara> <para> &class.pear-error;, <link linkend="core.pear.pear.seterrorhandling"><function> - setErrorHandling</function></link>を参照下さい。 + setErrorHandling</function></link> を参照してください。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.constants.pear-error-return"> <title><constant>PEAR_ERROR_RETURN</constant></title> <simpara> - PEARエラー処理に関連します。 + PEAR エラー処理に関連します。 </simpara> <para> &class.pear-error;, <link linkend="core.pear.pear.seterrorhandling"><function> - setErrorHandling</function></link>を参照下さい。 + setErrorHandling</function></link> を参照してください。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.constants.pear-error-trigger"> <title><constant>PEAR_ERROR_TRIGGER</constant></title> <simpara> - PEARエラー処理に関連します。 + PEAR エラー処理に関連します。 </simpara> <para> &class.pear-error;, <link linkend="core.pear.pear.seterrorhandling"><function> - setErrorHandling</function></link>を参照下さい。 + setErrorHandling</function></link> を参照してください。 </para> - </refsect1> -</refentry> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/expecterror.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/expecterror.xml diff -u peardoc/ja/core/pear/pear/expecterror.xml:1.1 peardoc/ja/core/pear/pear/expecterror.xml:1.2 --- peardoc/ja/core/pear/pear/expecterror.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/expecterror.xml Thu May 6 02:31:29 2004 @@ -1,11 +1,12 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.2 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.expecterror"> <refnamediv> <refname>PEAR::expectError()</refname> <refpurpose> - 一時的にエラー処理の無効を解除するためにエラーコードを追加 + 一時的なエラー処理の通常化を行うエラーコードを指定する </refpurpose> </refnamediv> <refsynopsisdiv> @@ -24,13 +25,14 @@ <refsect1 id="core.pear.pear.expecterror.desc"> &title.desc; <para> - このメソッドは、取得を期待するエラーを示すために使用されます。 - 期待されるエラーは、エラーモード - <constant>PEAR_ERROR_RETURN</constant>を指定した際に常に - 返されます。この期待されるエラーコードはスタック内に保存され、この - メソッドは、その中に新規エレメントを追加(プッシュ)します。期待され - るエラーのリストは、<function>popExpect</function>メソッドでスタッ - クから除かない限り使用可能です。 + このメソッドは、(コール元で)取得したいエラー(の一覧)の指定に使用します。 + 指定したエラーは、エラーモードが + <constant>PEAR_ERROR_RETURN</constant> となり、 + 常に返されるようになります。 + 取得したいエラーコード一覧はスタックに保持されており、 + このメソッドにより、(エラーコード一覧は)そこに新しい要素として追加されます。 + <function>popExpect</function> メソッドでスタックから取り除くまで、 + その追加したエラー一覧が有効となります。 </para> </refsect1> <refsect1 id="core.pear.pear.expecterror.parameter"> @@ -40,10 +42,10 @@ <listitem> <para> <parameter>mixed $errorCode</parameter> - - 期待される - <classname>PEAR_Error</classname> エラーコードまたは - エラーコードの配列。<parameter>'*'</parameter>が指定された場合、 - 全てのエラーが期待されます。 + 取得したい <classname>PEAR_Error</classname> のエラーコード、 + または、その配列。 + <parameter>'*'</parameter> を指定すると、 + すべてのエラーを取得できます。 </para> </listitem> </itemizedlist> @@ -52,7 +54,7 @@ <refsect1 id="core.pear.pear.expecterror.return"> &title.returns; <para> - <parameter>integer</parameter> - エラーコードスタックの大きさ。 + <parameter>integer</parameter> - エラーコードのスタックの要素の数。 </para> </refsect1> <refsect1 id="core.pear.pear.expecterror.note"> http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/getstaticproperty.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/getstaticproperty.xml diff -u peardoc/ja/core/pear/pear/getstaticproperty.xml:1.1 peardoc/ja/core/pear/pear/getstaticproperty.xml:1.2 --- peardoc/ja/core/pear/pear/getstaticproperty.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/getstaticproperty.xml Thu May 6 02:31:29 2004 @@ -1,10 +1,11 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.2 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.getstaticproperty"> <refnamediv> <refname>PEAR::getStaticProperty()</refname> - <refpurpose>staticプロパティ&pdevrel;を処理</refpurpose> + <refpurpose>スタティックプロパティを扱う &pdevrel;</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> @@ -25,16 +26,17 @@ <refsect1 id="core.pear.pear.getstaticproperty.desc"> &title.desc; <para> - ほぼまたは完全にスタティックなクラスがあり、スタティックプロパティ - が必要な場合、これを模擬するためにこのメソッドを使用することができ - ます。例えば、メソッドの中で以下のようにします。 + ほぼ、または完全にスタティックなクラスがあり、 + スタティックプロパティが必要な場合、 + それを模擬するためにこのメソッドを使用することができます。 + 例えば、メソッドの中で以下のようにします。 <programlisting role="php"> <![CDATA[ $myVar = &PEAR::getStaticProperty('myVar'); ]]> </programlisting> - リファレンスを使用する必要があることに注意して下さい。さもないと、 - 持続性は確保されません! + リファレンスを使用する必要があることに注意して下さい。 + さもないと、プロパティ値は永続しません! </para> </refsect1> <refsect1 id="core.pear.pear.getstaticproperty.parameter"> @@ -44,7 +46,7 @@ <listitem> <para> <parameter>string $class</parameter> - - <function>getStaticProperty</function>をコールする際の、クラス名。 + <function>getStaticProperty</function> のコール元のクラス名 </para> </listitem> <listitem> @@ -59,14 +61,14 @@ &title.returns; <para> <parameter>mixed</parameter> - - 変数へのリファレンス。設定しない場合、自動的に &null; に初期化され - ます。 + 変数へのリファレンス。変数がセットされていない場合、 + 自動的に &null; に初期化されます。 </para> </refsect1> <refsect1 id="core.pear.pear.getstaticproperty.example"> &title.example; <example> - <title>Using <function>getStaticProperty</function></title> + <title><function>getStaticProperty</function> の使用</title> <programlisting role="php"> <![CDATA[ <?php http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/intro.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/intro.xml diff -u peardoc/ja/core/pear/pear/intro.xml:1.1 peardoc/ja/core/pear/pear/intro.xml:1.2 --- peardoc/ja/core/pear/pear/intro.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/intro.xml Thu May 6 02:31:29 2004 @@ -1,11 +1,12 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.4 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.intro"> <refnamediv> <refname>はじめに</refname> <refpurpose> - PEAR基底クラス(デストラクタ、エラー処理)の処理方法 + PEAR 基底クラス(デストラクタ、エラー処理)の取り扱い方法 </refpurpose> </refnamediv> <refsynopsisdiv> @@ -15,12 +16,13 @@ <refsect1> <title>説明</title> <simpara> - PEAR基底クラスは、多くのPEARクラスで使用される標準的な機能を提供し - ます。通常、PEARクラスのインスタンスを直接作成することはなく、 + PEAR 基底クラスは、ほとんどの PEAR クラスで使用される + 標準的な機能を提供します。 + 通常、PEAR クラスのインスタンスを直接生成することはなく、 サブクラス化して使用します。 </simpara> <para> - この主な機能を以下に示します: + その主な機能を以下に示します。 <itemizedlist> <listitem> <simpara> @@ -36,72 +38,78 @@ <refsect1 id="destructors"> <title>PEAR "デストラクタ"</title> <simpara> - <replaceable>ClassName</replaceable>というクラスで - <classname>PEAR</classname>を継承した場合、 - _<replaceable>ClassName</replaceable>(クラス名の前にアンダースコア - を付けたもの)というメソッドを定義できます。 + <replaceable>ClassName</replaceable> というクラス名で + <classname>PEAR</classname> を継承した場合、 + _<replaceable>ClassName</replaceable> + (クラス名の前にアンダースコアを付けたもの)というメソッドを定義できます。 このメソッドは、リクエストが完了した時点でコールされます。 - これは、オブジェクトを"削除"できるという意味ではデストラクタではあ - りませんが、PHPが実行を完了した時点で、PHPによりオブジェクトのコー - ルバック関数としてコールされるという意味でデストラクタと呼ぶことが - できます。以下の <link - linkend="example.destructors">例</link>を参照して下さい。 + これは、オブジェクトを "削除" できるという意味ではデストラクタでは + ありませんが、PHP が実行を完了した時点で、 + PHP によりオブジェクトのコールバック関数としてコールされるという意味で + デストラクタと呼ぶことができます。以下の <link + linkend="example.destructors">例</link>を参照してください。 </simpara> <para> <warning id="destructors.warning"> <title>重要!</title> <para> - デストラクタが正しく動作するためには、クラスのインスタンス作成を + デストラクタを正しく動作させるためには、クラスのインスタンス生成を 以下のように "=&amp; new" 演算子で行う必要があります。 <programlisting role="php"> $obj =&amp; new MyClass(); </programlisting> </para> <simpara> - "= new"を使用した場合、PEARのシャットダウンリストに登録されたオブ - ジェクトは、コンストラクタがコールされた時点でのオブジェクトの - コピーとなります。この場合、このコピーの"デストラクタ"がシャッ - トダウン要求時にコールされることになります。 + "= new" を使用した場合、PEAR のシャットダウンリストに登録された + オブジェクトは、コンストラクタがコールされた時点でのオブジェクトの + コピーとなります。 + この場合、このコピーの "デストラクタ" がシャットダウン要求時に + コールされることになります。 </simpara> </warning> </para> </refsect1> <refsect1 id="error-handling"> - <title>PEARエラー処理</title> + <title>PEAR エラー処理</title> <simpara> - PEARの基底クラスは、true/false値または数値コードよりも複雑なエラー - を渡す手段を提供します。PEARエラーはオブジェクトであり、クラス - <classname>PEAR_Error</classname>のインスタンスまたは - <classname>PEAR_Error</classname>を継承したクラスのどちらかです。 + PEAR 基底クラスは、true/false 値や数値コードといったものに比べ、 + より複雑にエラーを渡す手段を提供します。 + PEAR エラーはオブジェクトであり、 + <classname>PEAR_Error</classname> クラス、または、 + <classname>PEAR_Error</classname> を継承したクラスのインスタンスです。 </simpara> <simpara> - PEARのエラーの設計指針の1つとして、ユーザに特定の型の出力を強制する - べきではなく、場合によっては出力を全く行わないエラー処理を可能とす - るべき、というものがあります。これにより、出力形式がHTML以外(例えば - WMLまたは他のXML形式)の場合にも、高度なエラー処理が可能となります。 + PEAR エラーの設計指針に、ユーザには特定の形式の出力を強制するべきではなく、 + 場合によっては出力をまったく行わずにエラー処理を可能とするべき、 + というものがあります。 + これにより、出力形式が HTML 以外(たとえば WML や他の XML 形式)の場合にも、 + 高度なエラー処理が可能となります。 </simpara> <simpara> - エラーオブジェクトは、エラーメッセージを出力する、メッセージを出 - 力して終了する、PHPの<function>trigger_error</function>関数でエラー - を発生する、コールバックを起動する、または、これらを何もしない、 - といった多くのことを作成時に設定することが可能です。これは、通常、 - <classname>PEAR_Error</classname>のコンストラクタで指定されますが、 - 全てのパラメータはオプションで、<classname>PEAR</classname>クラス - に基づく各オブジェクトから生成されたエラーのデフォルトを設定する - ことが可能です。使用法については<link - linkend="example.error1">PEARエラーの例</link>、詳細については、 - <classname>PEAR_Error</classname>リファレンスを参照下さい。 + エラーオブジェクトは、生成時に様々な動作をさせるよう設定することができます。。 + たとえば、エラーメッセージを出力する、メッセージを出力して終了する、 + PHP の <function>trigger_error</function> 関数でエラーを発生する、 + コールバックを起動する、または、これら何もしない、などです。 + これは、通常、<classname>PEAR_Error</classname> の + コンストラクタで指定されます。ただし、すべてのパラメータは任意です。 + また、<classname>PEAR</classname> クラス + を基底とする各オブジェクトから生成されるエラーの + デフォルト動作を設定することもできます。 + エラーオブジェクトの使用法については<link + linkend="example.error1">PEAR エラーの例</link>を、詳細については、 + <classname>PEAR_Error</classname> リファレンスを参照してください。 </simpara> </refsect1> <refsect1> <title>例</title> <para> - 以下の例は、ファイルの中身を保持する簡単なクラスを実装する際の - PEARの"poor man's kinda emulated destructors"の使用法を示すもので - す。このオブジェクトにデータを追加し、リクエスト終了時にファイル - にデータを戻します。 + 以下の例は、 + PEAR の "貧乏人のデストラクタもどき" の使用法を示すものです。 + ファイルの中身を保持する簡単なクラスで、 + オブジェクトにデータを追加すると、 + リクエスト終了時にファイルにデータを書き戻すというものを実装します。 <example id="example.destructors"> - <title>PEAR: デストラクタのエミュレーション</title> + <title>PEAR 擬似デストラクタ</title> <programlisting role="php"> require_once "PEAR.php"; @@ -130,7 +138,7 @@ $this->modified++; } - // "デストラクタ"にはコンストラクタの同じ名前が付いていますが、 + // "デストラクタ" はコンストラクタと似た名前でが、 // 前にアンダースコアが付いています。 function _FileContainer() { @@ -149,33 +157,33 @@ $fileobj->append("this ends up at the end of the file\n"); // リクエストが完了し、PHPがシャットダウンする時、$fileobjの -// "デストラクタ"がコールされ、ディスク上のファイルが更新されます。 +// "デストラクタ" がコールされ、ディスク上のファイルが更新されます。 - </programlisting> +</programlisting> </example> <note> <simpara> - PEAR "デストタクタ"は、PHPのシャットダウン用コールバック - (<function>register_shutdown_function</function>)を使用します。 - そして、PHP &lt; 4.1では、PHPがWebサーバで実行されている場合に - これらのコールバックから何も出力できません。PHPがコマンドライン - のモードで使用される場合を除き、"デストラクタ"からの出力は全て - 失われます。PHP 4.1以降では、デストラクタでも出力を行うことが可 - 能です。 + PEAR "デストタクタ" は、PHP のシャットダウン時のコールバック + (<function>register_shutdown_function</function>) を使用します。 + ですから、PHP &lt; 4.1 では、PHP が Webサーバで実行されている場合は + デストタクタから何も出力できません。 + PHP がコマンドラインモードで使用される場合を除き、 + デストラクタからの出力は全て失われます。 + PHP 4.1 以降では、デストラクタにおいても出力を行うことが可能です。 </simpara> <simpara> - また、デストラクタを使用したい場合は、オブジェクトのインスタン - ス作成に関する<link linkend="destructors.warning">警告</link>を - 参照下さい。 + また、デストラクタを使用する場合は、オブジェクトのインスタン + ス生成に関する<link linkend="destructors.warning">警告</link> + も参照してください。 </simpara> </note> </para> <simpara> - 次の例は、PEARのエラー処理機構の別の使用方法を説明するものです。 + 次の例は、PEAR のエラー処理機構の別の使用方法を説明するものです。 </simpara> <para> <example id="example.error1"> - <title>PEARエラーの例 (1)</title> + <title>PEAR エラーの例 (1)</title> <programlisting role="php"> function mysockopen($host = "localhost", $port = 8090) { @@ -194,22 +202,23 @@ </example> </para> <simpara> - この例は、PEARエラーオブジェクトの中でfsockopenで返されたエラーコー - ド及びメッセージを受け渡す<function>fsockopen</function>のラッパー - を示しています。<function>PEAR::isError</function>は、PEARエラー - の値を検出するために使用されることに注意して下さい。 + この例は、<function>fsockopen</function> 関数のラッパです。 + fsockopen が返すエラーコードおよびメッセージを + PEAR エラーオブジェクトで返します。 + 返された値が PEAR エラーかどうか調べるには + <function>PEAR::isError</function> を使用するということに注目してください。 </simpara> <simpara> - この例でPEAR_Errorの実行モードは、エラーオブジェクトを返し、ユー - ザ(プログラマ)に処理を渡すだけです。これは、デフォルトのエラーモー - ドです。 + この例での PEAR_Error の実行モードは、エラーオブジェクトを返し、 + ユーザ(プログラマ)にその後の処理を託す、というものです。 + これは、デフォルトのエラーモードです。 </simpara> <simpara> - 次の例では、デフォルトのエラーモードを使用する方法を示しています。 + 次の例では、エラーモードのデフォルトを設定する方法を示します。 </simpara> <para> <example id="example.error2"> - <title>PEARエラーの例(2)</title> + <title>PEAR エラーの例 (2)</title> <programlisting role="php"> class TCP_Socket extends PEAR { @@ -237,20 +246,22 @@ </example> </para> <simpara> - この例では、デフォルトのエラーモードを - <constant>PEAR_ERROR_DIE</constant>に設定しています。(3番目のパ - ラメータとして)エラーモードをraiseErrorコールに設定しないため、 - raiseErrorはデフォルトのエラーモードを使用し、fsockopenが失敗した - 場合に終了します。 + この例では、エラーモードのデフォルトを + <constant>PEAR_ERROR_DIE</constant> に設定しています。 + raiseError のコールにあたって、 + (3番目のパラメータに)エラーモードを設定していないため、 + raiseError はデフォルトのエラーモードを使用し、 + fsockopen が失敗するとスクリプトの実行を終了します。 </simpara> </refsect1> <refsect1> <title>使用されるグローバル変数</title> <para> - PEARクラスは、グローバルデフォルトと"デストラクタ"で使用されるオ - ブジェクトのリストを登録するためにいくつかのグローバル変数を使用 - します。PEARクラスに関連する全てのグローバル変数は、接頭辞 - <literal>_PEAR_</literal>を有します。 + PEAR クラスは、グローバルなデフォルトと + "デストラクタ" で使用されるオブジェクトのリストを登録するために + いくつかのグローバル変数を使用します。 + PEAR クラスに関連するすべてのグローバル変数は、 + 接頭辞 <literal>_PEAR_</literal> を有します。 </para> <para> <variablelist> @@ -264,33 +275,33 @@ <constant>PEAR_ERROR_PRINT</constant>, <constant>PEAR_ERROR_TRIGGER</constant>, <constant>PEAR_ERROR_DIE</constant>, - <constant>PEAR_ERROR_CALLBACK</constant>のどれかとする必要が - あります。 + <constant>PEAR_ERROR_CALLBACK</constant> + のいずれかに設定できます。 </simpara> <para> - この変数を直接設定せず、以下のように静的なメソッドとして - <function>PEAR::setErrorHandling</function>をコールして下さい。 + この変数は、直接設定せずに、以下のようにスタティックメソッド + <function>PEAR::setErrorHandling</function> をコールして下さい。 <informalexample> <programlisting role="php"> PEAR::setErrorHandling(PEAR_ERROR_DIE); </programlisting> </informalexample> </para> - </listitem> + </listitem> </varlistentry> <varlistentry> <term>$_PEAR_default_error_options</term> <listitem> <simpara> エラーモードが、<constant>PEAR_ERROR_TRIGGER</constant>の場合、 - これはエラーレベル( + エラーレベル( <constant>E_USER_NOTICE</constant>, <constant>E_USER_WARNING</constant>, - <constant>E_USER_ERROR</constant>のどれか)です。 + <constant>E_USER_ERROR</constant>のどれか)となります。 </simpara> <para> - この変数を直接設定せず、以下のように静的メソッドとして - <function>PEAR::setErrorHandling</function>をコールして下さい。 + この変数は、直接設定せずに、以下のようにスタティックメソッド + <function>PEAR::setErrorHandling</function> をコールして下さい。 <informalexample> <programlisting role="php"> PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_ERROR); @@ -303,18 +314,18 @@ <term>$_PEAR_default_error_callback</term> <listitem> <simpara> - エラーが発生し、エラーモードが - <constant>PEAR_ERROR_CALLBACK</constant>の場合に、 - <replaceable>options</replaceable>パラメータが指定されない時、 - この変数の値がコールバックとして使用されます。これは、エラー - モードを一時的に変更し、コールバック関数を再度設定せずにコー - ルバックモードに戻ることが可能であることを意味します。 - 文字列の値は、関数を表し、添字0にオブジェクト、添字1にメソッ - ドを有する要素数2の配列です。 + エラーが発生した際に + <replaceable>options</replaceable> パラメータが指定されておらず + また、エラーモードが <constant>PEAR_ERROR_CALLBACK</constant>の場合、 + この変数の値がコールバックとして使用されます。 + これにより、エラーモードを一時的に変更しても、 + コールバック関数を再度設定せずにコールバックモードに戻ることができます。 + 関数を示す文字列、もしくは、添字0にオブジェクト、 + 添字1にメソッドを有する要素数2の配列になります。 </simpara> <para> - この場合も、この変数を直接を設定せずに、以下のように静的変数として - <function>PEAR::setErrorHandling</function>をコールして下さい。 + この場合も、この変数を直接設定せずに、以下のようにスタティックメソッド + <function>PEAR::setErrorHandling</function> をコールして下さい。 <informalexample> <programlisting role="php"> PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "my_error_handler"); @@ -322,8 +333,7 @@ </informalexample> </para> <para> - 下にコールバック関数を再度指定せずに切替える方法の例を示し - ます。 + コールバック関数を再度指定せずに切替える方法の例を示します。 <informalexample> <programlisting role="php"> PEAR::setErrorMode(PEAR_ERROR_CALLBACK, "my_function_handler"); @@ -331,7 +341,7 @@ PEAR::setErrorMode(PEAR_ERROR_DIE); do_some_critical_stuff(); PEAR::setErrorMode(PEAR_ERROR_CALLBACK); -// ここでmy_function_handlerを使用する状態に戻ります +// ここで my_function_handler を使用する状態に戻ります </programlisting> </informalexample> </para> http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/iserror.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/iserror.xml diff -u peardoc/ja/core/pear/pear/iserror.xml:1.1 peardoc/ja/core/pear/pear/iserror.xml:1.2 --- peardoc/ja/core/pear/pear/iserror.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/iserror.xml Thu May 6 02:31:29 2004 @@ -1,12 +1,12 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.4 --> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.iserror"> <refnamediv> <refname>PEAR::isError()</refname> <refpurpose> - <classname>PEAR_Error</classname>オブジェクトをチェックする + <classname>PEAR_Error</classname> オブジェクトかどうかチェックする </refpurpose> </refnamediv> <refsynopsisdiv> @@ -28,12 +28,12 @@ <refsect1 id="core.pear.pear.iserror.desc"> &title.desc; <para> - <function>isError</function>は、ある変数が - <classname>PEAR_Error</classname>オブジェクトであるかを調べ、 - オプションで、特定のエラーメッセージまたはエラーコードが含まれてい - るかどうかを調べます。 + <function>isError</function> は、ある変数が + <classname>PEAR_Error</classname> オブジェクトかどうかを調べます。 + オプションで、特定のエラーメッセージ + またはエラーコードが含まれているかどうかを調べます。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.iserror.parameter"> &title.param; <para> @@ -56,24 +56,25 @@ </term> <listitem> <para> - チェックするエラーメッセージまたはエラーコード(オプション) + チェックするエラーメッセージまたはエラーコード(オプション)。 </para> </listitem> - </varlistentry> + </varlistentry> </variablelist> </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.iserror.return"> &title.returns; <para> - <parameter>mixed</parameter> - 変数が - <classname>PEAR_Error</classname>の場合、そして、 - <parameter>$msgcode</parameter> が指定された場合に、 - 変数が<classname>PEAR_Error</classname> で、かつ、 - その内容を含む場合に&true;を返します。 + <parameter>mixed</parameter> - + 変数が、<classname>PEAR_Error</classname> の場合に + &true;を返します。 + 第2引数が設定された場合は、さらに + 所与された <parameter>$msgcode</parameter> を含む場合のみ + &true;を返します。 </para> - </refsect1> -</refentry> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/loadextension.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/loadextension.xml diff -u peardoc/ja/core/pear/pear/loadextension.xml:1.1 peardoc/ja/core/pear/pear/loadextension.xml:1.2 --- peardoc/ja/core/pear/pear/loadextension.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/loadextension.xml Thu May 6 02:31:29 2004 @@ -1,10 +1,11 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.3 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.3 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.loadextension"> <refnamediv> <refname>PEAR::loadExtension()</refname> - <refpurpose>OSに依存するPHP拡張モジュールのロード</refpurpose> + <refpurpose>OS に非依存で PHP 拡張モジュールをロードする</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> @@ -22,7 +23,7 @@ <refsect1 id="core.pear.pear.loadextension.desc"> &title.desc; <para> - 名前を指定して拡張モジュールをロードする + 名称を指定して拡張モジュールをロードする。 </para> </refsect1> <refsect1 id="core.pear.pear.loadextension.parameter"> @@ -36,9 +37,10 @@ </term> <listitem> <para> - <emphasis>大文字/小文字を区別して</emphasis>PHP拡張モジュールの - 名前をファイル名接頭辞または<filename>php_</filename>接頭辞を付 - けずに指定します。 + PHP拡張モジュールの名称。 + <emphasis>大文字/小文字は区別</emphasis> されます。 + ファイル名の接尾辞や <filename>php_</filename> 接頭辞を + 付けずに指定します。 </para> </listitem> </varlistentry> @@ -49,8 +51,8 @@ <refsect1 id="core.pear.pear.loadextension.return"> &title.returns; <para> - <parameter>boolean</parameter> - 拡張モジュールがロードできた場合に - &true; を返します。 + <parameter>boolean</parameter> - + 拡張モジュールがロードできた場合に &true; を返します。 </para> </refsect1> <refsect1 id="core.pear.pear.loadextension.note"> @@ -60,7 +62,7 @@ <refsect1 id="core.pear.pear.loadextension.exmaple"> &title.example; <example> - <title>domxml拡張モジュールのロード</title> + <title>domxml 拡張モジュールのロード</title> <programlisting role="php"> <![CDATA[ if(!PEAR::loadExtension("domxml")) { http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/pear.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/pear.xml diff -u peardoc/ja/core/pear/pear/pear.xml:1.1 peardoc/ja/core/pear/pear/pear.xml:1.2 --- peardoc/ja/core/pear/pear/pear.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/pear.xml Thu May 6 02:31:29 2004 @@ -1,6 +1,7 @@ <?xml encoding="utf-8"?> -<!-- sync: 1.2 --> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.pear"> <refnamediv> <refname>PEAR::PEAR()</refname> @@ -23,9 +24,9 @@ <refsect1 id="core.pear.pear.pear.desc"> &title.desc; <para> - PEARにより提供されるデストラクタ機能を使用したい場合、 - <emphasis>自分の</emphasis>クラスのコンストラクタの中で - <function>$this->PEAR</function>をコールする必要があります。 + PEAR が提供するデストラクタ機能を使う場合は、 + <emphasis>自分の</emphasis> クラスのコンストラクタ中で + <function>$this->PEAR</function> をコールする必要があります。 </para> </refsect1> <refsect1 id="core.pear.pear.pear.parameter"> @@ -34,9 +35,8 @@ <itemizedlist> <listitem> <para> - <parameter>string $errorClass</parameter> - 使用するエラークラス - の名前 - to use. + <parameter>string $errorClass</parameter> - + 使用するエラークラスの名前。 </para> </listitem> </itemizedlist> http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/popexpect.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/popexpect.xml diff -u peardoc/ja/core/pear/pear/popexpect.xml:1.1 peardoc/ja/core/pear/pear/popexpect.xml:1.2 --- peardoc/ja/core/pear/pear/popexpect.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/popexpect.xml Thu May 6 02:31:29 2004 @@ -1,53 +1,54 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.2 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.popexpect"> <refnamediv> <refname>PEAR::popExpect()</refname> <refpurpose> - 一時的なエラー処理の無効を解除するために直近のエラーコードを削除す - る + 直近に指定したエラーコードに対して、一時的なエラー処理の通常化を解除する </refpurpose> </refnamediv> <refsynopsisdiv> - <funcsynopsis> + <funcsynopsis> <funcsynopsisinfo> require_once 'PEAR.php'; - </funcsynopsisinfo> + </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>PEAR::popExpect</function></funcdef> <paramdef> </paramdef> - </funcprototype> + </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.pear.popexpect.desc"> &title.desc; <para> - このメソッドは、期待されるエラーコードスタックの上位から - 要素を1つ削除します。 + このメソッドは、(コール元で) + 取得したいエラーコード一覧を保持するスタックの末尾から + 要素を1つ取り除きます。 </para> </refsect1> <refsect1 id="core.pear.pear.popexpect.return"> - &title.returns; + &title.returns; <para> <parameter>mixed</parameter> - - 削除されたエラーコードまたはエラーコード配列 + 取り除かれたエラーコード、または、その配列です。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.popexpect.note"> - &title.note; + &title.note; &note.notstatic; </refsect1> <refsect1 id="core.pear.pear.popexpect.see"> - &title.see; + &title.see; <para> <link linkend="core.pear.pear.expecterror"> <function>expectError</function> </link> </para> - </refsect1> -</refentry> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/raiseerror.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/raiseerror.xml diff -u peardoc/ja/core/pear/pear/raiseerror.xml:1.1 peardoc/ja/core/pear/pear/raiseerror.xml:1.2 --- peardoc/ja/core/pear/pear/raiseerror.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/raiseerror.xml Thu May 6 02:31:29 2004 @@ -1,11 +1,12 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.3 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.3 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.raiseerror"> <refnamediv> <refname>PEAR::raiseError()</refname> - <refpurpose>新規に &class.pear-error; オブジェクトを生成し、オプショ - ンでエラー処理指定を行う</refpurpose> + <refpurpose>新規に &class.pear-error; オブジェクトを生成し、 + オプションでエラー処理手順を指定する</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> @@ -41,9 +42,9 @@ <refsect1 id="core.pear.pear.raiseerror.desc"> &title.desc; <para> - <function>raiseError</function> + <function>raiseError</function> </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.raiseerror.parameter"> &title.param; <para> @@ -55,8 +56,8 @@ </term> <listitem> <para> - エラーメッセージ。空白のままとした場合のデフォルトのメッセージは、 - &quot;unknown error&quot;です。 + エラーメッセージ。空白のままとした場合、デフォルトのメッセージは、 + &quot;unknown error&quot; です。 </para> </listitem> </varlistentry> @@ -67,11 +68,11 @@ </term> <listitem> <para> - エラーコード。エラー処理を簡単にするため、最も簡単なエラーの場 - 合でもエラーコードを使用することが推奨されます。 + エラーコード。エラー処理を簡単にするため、 + 最も簡単なエラーに対してもエラーコードを使用することが推奨されます。 </para> </listitem> - </varlistentry> + </varlistentry> <varlistentry> <term> &type.int; @@ -84,14 +85,14 @@ <constant>PEAR_ERROR_TRIGGER</constant>, <constant>PEAR_ERROR_DIE</constant>, <constant>PEAR_ERROR_CALLBACK</constant>, - <constant>PEAR_ERROR_EXCEPTION</constant>のどれかです。 + <constant>PEAR_ERROR_EXCEPTION</constant>のいずれかとします。 詳細な情報とこれらの定数の意味の例については、 <link linkend="core.pear.pear.seterrorhandling"><function>setErrorHandling</function></link> - を参照して下さい。 + を参照してください。 </para> </listitem> - </varlistentry> + </varlistentry> <varlistentry> <term> &type.mixed; @@ -99,12 +100,12 @@ </term> <listitem> <para> - エラーオプション。これは、<parameter>$mode</parameter>の値に依 - 存し、この値は<link - linkend="core.pear.pear.seterrorhandling"><function>setErrorHandling</function></link>に記述されています。 + エラーオプション。これは、<parameter>$mode</parameter> の値に依存します。 + これについては、<link linkend="core.pear.pear.seterrorhandling"> + <function>setErrorHandling</function></link> に記述されています。 </para> </listitem> - </varlistentry> + </varlistentry> <varlistentry> <term> &type.mixed; @@ -112,12 +113,12 @@ </term> <listitem> <para> - ユーザ情報(オプション)。 - 特定のエラーに固有の情報を保存するために使用することができ、任 - 意のフォーマットを使用できます。 + ユーザ情報(オプション)。 + 特定のエラーに固有の情報を保存するために使用し、 + 任意のフォーマットを使用できます。 </para> </listitem> - </varlistentry> + </varlistentry> <varlistentry> <term> &type.string; @@ -126,8 +127,8 @@ <listitem> <para> エラーオブジェクトとして使用するエラークラスの名前。デフォルト - のエラークラスは &class.pear-error;です。 - &class.pear-error;を拡張したカスタムクラスのような + のエラークラスは &class.pear-error; です。 + &class.pear-error; を拡張したカスタムクラスのような 他のクラスを使用する場合にはこのパラメータを使用して下さい。 </para> </listitem> @@ -141,23 +142,24 @@ <para> コンストラクタの中でエラーメッセージを受け付けないカスタムクラ スを使用する場合にはこのパラメータを使用して下さい。 - <parameter>$error_class</parameter>パラメータを使用しない場合に + <parameter>$error_class</parameter> パラメータを使用しない場合に このパラメータを使用しないで下さい。その場合には動作しません。 </para> </listitem> - </varlistentry> + </varlistentry> </variablelist> </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.raiseerror.return"> &title.returns; <para> - PEAR_ERROR_DIEが実行を終了するか、 - PEAR_ERROR_EXCEPTIONがハンドルされない場合を除き、 &class.pear-error; オブジェクトが返されます。 + ただし、 + <constant>PEAR_ERROR_DIE</constant> が実行を終了するか、 + <constant>PEAR_ERROR_EXCEPTION</constant> がハンドルされない場合を除きます。 </para> - </refsect1> -</refentry> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/registershutdownfunction.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/registershutdownfunction.xml diff -u peardoc/ja/core/pear/pear/registershutdownfunction.xml:1.1 peardoc/ja/core/pear/pear/registershutdownfunction.xml:1.2 --- peardoc/ja/core/pear/pear/registershutdownfunction.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/registershutdownfunction.xml Thu May 6 02:31:29 2004 @@ -1,11 +1,12 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.2 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.registershutdownfunc"> <refnamediv> <refname>PEAR::registerShutdownFunc()</refname> <refpurpose> - スタティッククラスのシャットダウン関数を設定 &pdevrel; + スタティッククラスのシャットダウン関数を設定する &pdevrel; </refpurpose> </refnamediv> <refsynopsisdiv> @@ -20,41 +21,39 @@ </paramdef> <paramdef> array <parameter><optional>$var = array()</optional></parameter> - </paramdef> + </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.pear.registershutdownfunc.desc"> &title.desc; <para> - The indicated function is called, before the PHP interpreter will - be finished. + PHP インタプリタが終了する前に、指定された関数がコールされます。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.registershutdownfunc.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> - <parameter>array $func</parameter> - the name of the class and of the - function to ccore. + <parameter>array $func</parameter> - + クラス名とコールする関数 </para> </listitem> <listitem> <para> - <parameter>array $var</parameter> - possible required function - parameters. The parameters are handed over to the function in accordance with their - succession of the array. + <parameter>array $var</parameter> - + 関数に必要なパラメータ。配列の並びのとおりに関数に渡されます。 </para> - </listitem> + </listitem> </itemizedlist> </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.registershutdownfunc.example"> &title.example; <example> - <title>Using <function>registerShutdownFunc</function></title> + <title><function>registerShutdownFunc</function> の使用</title> <programlisting role="php"> <![CDATA[ <?php @@ -63,9 +62,9 @@ class myClass { -function myClass() +function myClass() { - PEAR::registerShutdownFunc(array('myClass', 'shutdown'), + PEAR::registerShutdownFunc(array('myClass', 'shutdown'), array('param1', 'param2')); } @@ -76,12 +75,12 @@ } -?> +?> ]]> </programlisting> </example> - </refsect1> - </refentry> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/peardoc/ja/core/pear/pear/seterrorhandling.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/ja/core/pear/pear/seterrorhandling.xml diff -u peardoc/ja/core/pear/pear/seterrorhandling.xml:1.1 peardoc/ja/core/pear/pear/seterrorhandling.xml:1.2 --- peardoc/ja/core/pear/pear/seterrorhandling.xml:1.1 Thu Oct 16 19:42:23 2003 +++ peardoc/ja/core/pear/pear/seterrorhandling.xml Thu May 6 02:31:29 2004 @@ -1,11 +1,12 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- sync: 1.8 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.8 Maintainer: Status: ready --> +<!-- CREDITS: hirokawa, haruki --> <refentry id="core.pear.pear.seterrorhandling"> <refnamediv> <refname>PEAR::setErrorHandling()</refname> <refpurpose> - PEARパッケージ全体で生成されるエラーの処理方法を指定 + PEAR パッケージにより生成されるエラーの処理方法を指定する </refpurpose> </refnamediv> <refsynopsisdiv> @@ -20,138 +21,151 @@ </paramdef> <paramdef> mixed <parameter><optional>$options = &null;</optional></parameter> - </paramdef> + </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.pear.seterrorhandling.desc"> &title.desc; <para> - <function>setErrorHandling</function> can be invoked as both a standard - object method ($obj->setErrorHandling) and as a static method - (PEAR::setErrorHandling). If called - statically, <function>PEAR::setErrorHandling</function> sets the default - error handling behaviour for all - PEAR objects (global error handling behaviour). If called as an object method, - <function>$obj->setErrorHandling</function> sets - the default error handling for only that object (local error handling behaviour). + <function>setErrorHandling</function> は、普通のオブジェクトメソッド + ($obj->setErrorHandling) としても、スタティックメソッド + (PEAR::setErrorHandling) としてもコールできます。 + スタティックにコールされた場合、すべての PEAR オブジェクトに対する + デフォルトのエラー処理動作を設定します + (グローバルなエラー処理動作)。 + オブジェクトメソッドとしてコールされた場合、 + <function>$obj->setErrorHandling</function> は、そのオブジェクトだけに対して + デフォルトのエラー処理動作を設定します + (ローカルなエラー処理動作)。 </para> - </refsect1> + </refsect1> <refsect1 id="core.pear.pear.seterrorhandling.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> - <parameter>integer $mode</parameter> - one of the following constants - <itemizedlist> - <listitem> - <para> - <constant>PEAR_ERROR_RETURN</constant> If an error occurs, a - &class.pear-error; is returned from the error-generation - method (normally <link linkend="core.pear.pear.raiseerror"><function>raiseError</function></link>.) - </para> - </listitem> - <listitem> - <para> - <constant>PEAR_ERROR_PRINT</constant> Like <constant> - PEAR_ERROR_RETURN</constant>, but an error message will be - printed additionally. - </para> - </listitem> - <listitem> - <para> - <constant>PEAR_ERROR_TRIGGER</constant> Like <constant> - PEAR_ERROR_RETURN</constant>, but the PHP builtin-function - <function>trigger_error</function> will be called in PEAR_Error's - constructor with the error message. - </para> - </listitem> - <listitem> - <para> - <constant>PEAR_ERROR_DIE</constant> The script will terminate and - an error message will be printed on instantiation of a PEAR_Error. - </para> - </listitem> - <listitem> - <para> - <constant>PEAR_ERROR_CALLBACK</constant> If a error occurs, the - callback passed to <parameter>$options</parameter> is called. - </para> - </listitem> - <listitem> - <para> - <constant>PEAR_ERROR_EXCEPTION</constant> If Zend Engine 2 is present, - then an exception will be thrown using the &class.pear-error; object. - </para> - </listitem> - </itemizedlist> + <parameter>integer $mode</parameter> - + 以下の定数の1つ + <itemizedlist> + <listitem> + <para> + <constant>PEAR_ERROR_RETURN</constant> 。 + エラーが発生した場合、エラー生成メソッド(通常は + <link linkend="core.pear.pear.raiseerror"> + <function>raiseError</function></link>) + から、&class.pear-error; が返されます。 + </para> + </listitem> + <listitem> + <para> + <constant>PEAR_ERROR_PRINT</constant> 。 + <constant>PEAR_ERROR_RETURN</constant> と同様の動作に加え、 + エラーメッセージが出力されます。 + </para> + </listitem> + <listitem> + <para> + <constant>PEAR_ERROR_TRIGGER</constant> 。 + <constant>PEAR_ERROR_RETURN</constant> と同様の動作に加え、 + PEAR_Error のコンストラクタで、 + PHP 組み込み関数 <function>trigger_error</function> が + エラーメッセージを添えてコールされます。 + </para> + </listitem> + <listitem> + <para> + <constant>PEAR_ERROR_DIE</constant> 。 + PEAR_Error の生成時に、エラーメッセージが出力され、 + スクリプトが終了します。 + </para> + </listitem> + <listitem> + <para> + <constant>PEAR_ERROR_CALLBACK</constant> + エラーが発生した場合、 + <parameter>$options</parameter> に指定されたコールバックが + コールされます。 + </para> + </listitem> + <listitem> + <para> + <constant>PEAR_ERROR_EXCEPTION</constant> 。 + Zend Engine 2 が存在する場合、 + &class.pear-error; オブジェクトを使って例外がスローされます。 + </para> + </listitem> + </itemizedlist> </para> </listitem> <listitem> <para> - <parameter>mixed $options</parameter> - the value for <parameter>$options</parameter> - depends on <parameter>$mode</parameter> + <parameter>mixed $options</parameter> - + <parameter>$options</parameter> の値は + <parameter>$mode</parameter> に依る <itemizedlist> <listitem> - <para> - <constant>PEAR_ERROR_PRINT</constant> and - <constant>PEAR_ERROR_DIE</constant> support - an optional <function>printf</function> format string used - when printing the error message. This format string should contain - a single %s, which will be used to insert the error message into the - string. Use the string to enclose the error message with other - useful information not included in the error message prefix or - error message. - </para> + <para> + <constant>PEAR_ERROR_PRINT</constant> および + <constant>PEAR_ERROR_DIE</constant> は、 + エラーメッセージを出力する際に使われる + 任意の <function>printf</function> 形式の文字列をサポートします。 + この整形文字列は、1つの %s を含み、 + そこにエラーメッセージが挿入されます。 + エラーメッセージやそのプレフィックスに示されていない有用な + 情報をエラーメッセージに付加するために使用します。 + </para> </listitem> <listitem> - <para> - <constant>PEAR_ERROR_TRIGGER</constant> requires an user error - level constant used by <function>trigger_error</function> (possible constants: <constant>E_USER_NOTICE</constant>, - <constant>E_USER_WARNING</constant> or - <constant>E_USER_ERROR</constant>). Note that if the error constant - is not one of these valid error constants, a PHP warning will be - triggered. - </para> - </listitem> + <para> + <constant>PEAR_ERROR_TRIGGER</constant> には、 + <function>trigger_error</function> が使用するエラーレベル定数が + 必要です( <constant>E_USER_NOTICE</constant>, + <constant>E_USER_WARNING</constant> もしくは + <constant>E_USER_ERROR</constant>が使用可能)。 + 指定されたエラーレベル定数が有効なものでなければ、 + PHP の警告 (Warning) が生成されます。 + </para> + </listitem> <listitem> - <para> - <constant>PEAR_ERROR_CALLBACK</constant> The callback must be a function - name in the format described in the <ulink url="&url.php.callback;">Pseudo-Type</ulink> - section of the PHP manual (either a string, or an array). The callback must accept a single - parameter, the &class.pear-error; object generated by an error condition. - Note that if the callback is not a valid callback, a PHP warning will - be triggered. - </para> - </listitem> - </itemizedlist> + <para> + <constant>PEAR_ERROR_CALLBACK</constant>。 + コールバックは、PHP マニュアルの + <ulink url="&url.php.callback;">擬似的な型</ulink> + についてのセクションに記述の形式による関数名とします。 + コールバックは、生成された &class.pear-error; を引数に取ります。 + 指定されたコールバックが有効で無い場合、 + PHP の警告 (Warning) が生成されます。 + </para> + </listitem> + </itemizedlist> </para> - </listitem> + </listitem> </itemizedlist> </para> <para> - Here's an example of a few ways to use setErrorHandling: + setErrorHandling の使用方法の例を示します。 <programlisting role="php"> <![CDATA[ <?php require_once 'PEAR.php'; -// dummy error constant for this example +// ダミーのエラー定数 define('MYCLASS_ERROR_CODE', 1); -// demonstration of default global error handling -// in this case, all PEAR Errors will trigger a PHP warning +// デフォルトのグローバルなエラー処理いついての実例 +// この場合、すべての PEAR エラーはPHP の警告 (Warning) を生成します。 PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING); -// Note that the file and line number will be in the constructor of PEAR_Error -// in PEAR.php +// ファイルと行番号が PEAR.php の PEAR_Error のコンストラクタで +// 処理されます。 PEAR::raiseError('test warning', MYCLASS_ERROR_CODE); -// this error specifies a mode, and overrides the default global error handling +// このエラーにはモードが設定されており、グローバルなエラー処理を上書きします。 $e = PEAR::raiseError('return only', MYCLASS_ERROR_CODE, PEAR_ERROR_RETURN); PEAR::setErrorHandling(PEAR_ERROR_PRINT, "Gronk error: %s<br />\n"); -// prints "Gronk error: test warning<br />\n" +// "Gronk error: test warning<br />\n" を出力します。 PEAR::raiseError('test warning', MYCLASS_ERROR_CODE); /** @@ -160,25 +174,25 @@ */ class myClass extends PEAR { /** - * Demonstration of default local error handling + * ローカルなエラー処理のデフォルトの実例 */ function myClass() { - // object method callback + // オブジェクトメソッドのコールバック $this->setErrorHandling(PEAR_ERROR_CALLBACK, array(&$this, 'handleErr')); - // prints "custom handler...is working" + // "custom handler...is working" を出力 PEAR::raiseError('custom handler', MYCLASS_ERROR_CODE); - // static class method callback + // スタティッククラスメソッドのコールバック $this->setErrorHandling(PEAR_ERROR_CALLBACK, array('myClass', 'handleErrStatic')); PEAR::raiseError('custom handler', MYCLASS_ERROR_CODE); - // function callback + // 関数のコールバック $this->setErrorHandling(PEAR_ERROR_CALLBACK, 'standardCallback'); PEAR::raiseError('custom handler', MYCLASS_ERROR_CODE); } - + /** - * Callback set by the constructor + * コンストラクタにより指定されるコールバック * @param PEAR_Error The error object */ function handleErr($error) @@ -186,9 +200,9 @@ $this->lastError = $error->getMessage(); print $error->getMessage() . "...is working\n"; } - + /** - * Static callback set by the constructor + * コンストラクタにより指定されるスタティックなコールバック * * Note that in PHP 5, $this is not set if the method is declared with * the "static" access modifier. In PHP 4, $this is set, but is not @@ -209,21 +223,22 @@ { print 'normal function callback: ' . $error->getMessage(); } -// This causes the printing of three messages through error callbacks: + +// エラー用コールバックを通じて以下の3つのメッセージが出力されます。 // "custom handler...is working" // "static custom handler... is working" // "normal function callback: custom handler" $mine = new myClass; PEAR::setErrorHandling(PEAR_ERROR_DIE); -// terminates the script with the error message "oops" +// "oops" というエラーメッセージを出力し、スクリプトを終了させます。 PEAR::raiseError('oops', MYCLASS_ERROR_CODE); ?> ]]> </programlisting> </para> - </refsect1> - </refentry> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml
« previous php.pear.doc (#3906) next »