cvs: peardoc /ja/chapters faq.xml support.xml /ja/core pear.xml /ja/core/pear pear-error.xml pear-errorstack.xml pear-exception.xml
/ja/core/pear/pear-errorstack intro.xml staticpop.xml staticpush.xml /ja/core/pear/pear-exception intro.xml /ja/guide/developers packagedef.xml
/ja/package/structures structures-datagrid.xml /ja/package/structures/structures-datagrid/structures-datagrid-datasource excel.xml

From: Date: Sat, 14 Oct 2006 22:58:50 +0000
Subject: cvs: peardoc /ja/chapters faq.xml support.xml /ja/core pear.xml /ja/core/pear pear-error.xml pear-errorstack.xml pear-exception.xml
/ja/core/pear/pear-errorstack intro.xml staticpop.xml staticpush.xml /ja/core/pear/pear-exception intro.xml /ja/guide/developers packagedef.xml
/ja/package/structures structures-datagrid.xml /ja/package/structures/structures-datagrid/structures-datagrid-datasource excel.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8614@lists.php.net to get a copy of this message
takagi Sat Oct 14 22:58:50 2006 UTC Added files: /peardoc/ja/package/structures/structures-datagrid/structures-datagrid-datasource excel.xml /peardoc/ja/core/pear/pear-exception intro.xml /peardoc/ja/core/pear/pear-errorstack staticpop.xml /peardoc/ja/core/pear pear-exception.xml Modified files: /peardoc/ja/package/structures structures-datagrid.xml /peardoc/ja/guide/developers packagedef.xml /peardoc/ja/core/pear/pear-errorstack staticpush.xml intro.xml /peardoc/ja/core/pear pear-errorstack.xml pear-error.xml /peardoc/ja/core pear.xml /peardoc/ja/chapters support.xml faq.xml Log: sync with en.

http://cvs.php.net/viewvc.cgi/peardoc/ja/package/structures/structures-datagrid.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/ja/package/structures/structures-datagrid.xml diff -u peardoc/ja/package/structures/structures-datagrid.xml:1.1 peardoc/ja/package/structures/structures-datagrid.xml:1.2 --- peardoc/ja/package/structures/structures-datagrid.xml:1.1 Sun Oct 1 05:59:19 2006 +++ peardoc/ja/package/structures/structures-datagrid.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.37 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.38 Maintainer: takagi Status: ready --> <sect1 id="package.structures.structures-datagrid"> <title>Structures_DataGrid</title> <!-- @@ -129,6 +129,7 @@ &package.structures.structures-datagrid.structures-datagrid-datasource.db; &package.structures.structures-datagrid.structures-datagrid-datasource.dbquery; &package.structures.structures-datagrid.structures-datagrid-datasource.dbtable; +&package.structures.structures-datagrid.structures-datagrid-datasource.excel; &package.structures.structures-datagrid.structures-datagrid-datasource.mdb2; &package.structures.structures-datagrid.structures-datagrid-datasource.rss; &package.structures.structures-datagrid.structures-datagrid-datasource.xml; http://cvs.php.net/viewvc.cgi/peardoc/ja/guide/developers/packagedef.xml?r1=1.12&r2=1.13&diff_format=u Index: peardoc/ja/guide/developers/packagedef.xml diff -u peardoc/ja/guide/developers/packagedef.xml:1.12 peardoc/ja/guide/developers/packagedef.xml:1.13 --- peardoc/ja/guide/developers/packagedef.xml:1.12 Thu May 18 12:13:53 2006 +++ peardoc/ja/guide/developers/packagedef.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.12 $ --> -<!-- EN-Revision: 1.33 Maintainer: haruki Status: ready --> +<!-- $Revision: 1.13 $ --> +<!-- EN-Revision: 1.34 Maintainer: haruki Status: ready --> <!-- WORK IN PROGRESS, THERE IS PROBABLY LITTLE POINT IN TRANSLATING THIS DOCUMENT YET. @@ -13,6 +13,15 @@ <title>パッケージ定義ファイル <filename>package.xml</filename> の解説</title> <titleabbrev>解説</titleabbrev> + <warning> + <title>package.xml バージョン 1.0 は非推奨です</title> + <para> + package.xml 1.0 は非推奨です。package.xml バージョン 2.0 を使用してください。 + ドキュメントは <link linkend="guide.developers.package2">package.xml 2.0 ドキュメント</link> + にあります。 + </para> + </warning> + <simpara> パッケージ定義ファイル <filename>package.xml</filename> は、 その名が示す通り、ある PEAR パッケージについての情報が記載された @@ -288,7 +297,7 @@ </notes> <filelist> <dir name="/" baseinstalldir="Money"> - <file role="php">Fast.php</file> + <file role="php" name="Fast.php" /> </dir> </filelist> </release> @@ -320,18 +329,18 @@ </notes> <filelist> <dir name="/" baseinstalldir="Money"> - <file role="php">Fast.php</file> - <dir name="Calculator" role="php"> - <file>Calculator.php</file> - <file>Currency.php</file> - <file>Stocks.php</file> + <file role="php" name="Fast.php" /> + <dir name="Calculator"> + <file name="Calculator.php" role="php" /> + <file name="Currency.php" role="php" /> + <file name="Stocks.php" role="php" /> </dir> - <dir name="docs" role="doc"> - <file>README.txt</file> - <file>tutorial.txt</file> - <dir name="examples" role="doc"> - <file role="php">NASDAQ.php</file> - <file role="php">DAX.php</file> + <dir name="docs"> + <file name="README.txt" role="doc" /> + <file name="tutorial.txt" role="doc" /> + <dir name="examples"> + <file name="NASDAQ.php" role="php" /> + <file name="DAX.php" role="php" /> </dir> </dir> </dir> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-errorstack/staticpush.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/ja/core/pear/pear-errorstack/staticpush.xml diff -u peardoc/ja/core/pear/pear-errorstack/staticpush.xml:1.1 peardoc/ja/core/pear/pear-errorstack/staticpush.xml:1.2 --- peardoc/ja/core/pear/pear-errorstack/staticpush.xml:1.1 Wed Aug 10 10:14:31 2005 +++ peardoc/ja/core/pear/pear-errorstack/staticpush.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: takagi Status: ready --> <refentry id="core.pear.pear-errorstack.staticpush"> <refnamediv> <refname> @@ -19,7 +19,7 @@ </funcsynopsisinfo> <funcprototype> <funcdef> - <replaceable>PEAR_Error|null|Exception</replaceable> + <replaceable>PEAR_Error|array</replaceable> <function>PEAR_ErrorStack::staticPush</function> </funcdef> <paramdef> @@ -165,13 +165,6 @@ &title.returns; <para> 互換性モードが on の場合には PEAR_Error もスローされます。 - - 例外クラスが存在する場合、以下のようなコードで利用できる形式で返されます: - <programlisting role="php-highlighted"> -&lt;?php -1 throw ($stack-&gt;<link linkend="core.pear.pear-errorstack.push">push</link>(MY_ERROR_CODE, &apos;error&apos;, array(&apos;username&apos; =&gt; &apos;grob&apos;))); -?&gt; - </programlisting> </para> </refsect1> <refsect1 id="core.pear.pear-errorstack.staticpush.throws"> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-errorstack/intro.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/ja/core/pear/pear-errorstack/intro.xml diff -u peardoc/ja/core/pear/pear-errorstack/intro.xml:1.3 peardoc/ja/core/pear/pear-errorstack/intro.xml:1.4 --- peardoc/ja/core/pear/pear-errorstack/intro.xml:1.3 Sat Dec 31 04:34:04 2005 +++ peardoc/ja/core/pear/pear-errorstack/intro.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.14 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.16 Maintainer: takagi Status: ready --> <refentry id="core.pear.pear-errorstack.intro"> <refnamediv> <refname> @@ -20,6 +20,8 @@ <copyright> <year>2003</year> <year>2004</year> + <year>2005</year> + <year>2006</year> <holder>Gregory Beaver</holder> </copyright> <releaseinfo>PEAR_ErrorStack 1.3.2 (beta)</releaseinfo> @@ -683,7 +685,7 @@ </refsect1> <refsect1 id = "core.pear.pear-errorstack.intro.merging"> <title> - PEAR_Error との後方互換性、PHP 5 の例外との前方互換性 + PEAR_Error との後方互換性、PHP 5 の例外および PEAR_Exception との前方互換性 </title> <para> <classname>PEAR_ErrorStack</classname> は、 @@ -700,16 +702,9 @@ ?>]]> </programlisting> </para> - <warning> - <title>後方互換性のための警告</title> - <para> - PEAR 1.3.2 では、PEAR_ErrorStack-&gt;push() は例外クラスを返しません。 - - この挙動に依存しているコードはうまく動作しません。 - </para> - </warning> <para> - PEAR_ErrorStack は、PHP 5 では自動的に例外を返します。 + PEAR_ErrorStack は新しい PEAR_Exception クラスとともに使用することが可能です。 + このようなコードで、例外を変換します。 以下のコードで、返される例外クラス名を設定することができます。 </para> @@ -717,7 +712,10 @@ <programlisting role = "php"><![CDATA[ <?php require_once 'PEAR/ErrorStack.php'; -$stack = &PEAR_ErrorStack::singleton('mypackage', false, null, 'PEAR_ErrorStack', false, 'MyException'); +require_once 'PEAR/Exception.php'; +$stack = &PEAR_ErrorStack::singleton('mypackage'); +$stack->push(1, 'test error'); +throw new PEAR_Exception('did not work', $stack->pop()); ?>]]> </programlisting> </para> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-errorstack.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/ja/core/pear/pear-errorstack.xml diff -u peardoc/ja/core/pear/pear-errorstack.xml:1.1 peardoc/ja/core/pear/pear-errorstack.xml:1.2 --- peardoc/ja/core/pear/pear-errorstack.xml:1.1 Wed Aug 10 10:14:30 2005 +++ peardoc/ja/core/pear/pear-errorstack.xml Sat Oct 14 22:58:50 2006 @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: takagi Status: ready --> <sect1 id="core.pear.pear-errorstack"> - <title>PEAR_ErrorStack を用いた高度なエラー処理</title> + <title>PEAR_ErrorStack</title> <titleabbrev>PEAR_ErrorStack</titleabbrev> <para> PEAR_ErrorStack は、PEAR でエラーの生成と処理を行う実験的な実装です。 安定した時点で PEAR_Error を置き換えることを念頭に設計されています。 - PEAR_ErrorStack は、PEAR_Error との後方互換性・PHP 5 の例外クラスとの - 前方互換性の両方を保っています。それ以外にも多くの機能を持っており、 + PEAR_ErrorStack は、PEAR_Error との後方互換性・PHP 5 の PEAR_Exception + クラスとの前方互換性の両方を保っています。それ以外にも多くの機能を持っており、 それらの機能については次のセクションで説明します。 </para> <para>利用方法 @@ -42,6 +42,7 @@ &core.pear.pear-errorstack.singleton; &core.pear.pear-errorstack.staticgeterrors; &core.pear.pear-errorstack.statichaserrors; +&core.pear.pear-errorstack.staticpop; &core.pear.pear-errorstack.staticpopcallback; &core.pear.pear-errorstack.staticpush; &core.pear.pear-errorstack.staticpushcallback; http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-error.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/ja/core/pear/pear-error.xml diff -u peardoc/ja/core/pear/pear-error.xml:1.2 peardoc/ja/core/pear/pear-error.xml:1.3 --- peardoc/ja/core/pear/pear-error.xml:1.2 Thu May 6 07:13:50 2004 +++ peardoc/ja/core/pear/pear-error.xml Sat Oct 14 22:58:50 2006 @@ -1,9 +1,9 @@ <?xml encoding="utf-8"?> -<!-- $Id: pear-error.xml,v 1.2 2004/05/06 07:13:50 haruki Exp $ --> -<!-- EN-Revision: 1.4 Maintainer: Status: ready --> +<!-- $Id: pear-error.xml,v 1.3 2006/10/14 22:58:50 takagi Exp $ --> +<!-- EN-Revision: 1.5 Maintainer: Status: ready --> <!-- CREDITS: hirokawa, haruki --> <sect1 id="core.pear.pear-error"> - <title>PEAR_Error</title> + <title>PEAR_Error [非推奨]</title> <titleabbrev>PEAR Errorオブジェクト</titleabbrev> <para> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/ja/core/pear.xml diff -u peardoc/ja/core/pear.xml:1.3 peardoc/ja/core/pear.xml:1.4 --- peardoc/ja/core/pear.xml:1.3 Thu May 6 06:29:34 2004 +++ peardoc/ja/core/pear.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.5 Maintainer: Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.6 Maintainer: Status: ready --> <!-- CREDITS: hirokawa, haruki --> <chapter id="core.pear"> @@ -11,8 +11,9 @@ </para> &core.pear.pear; - &core.pear.pear-error; + &core.pear.pear-exception; &core.pear.pear-errorstack; + &core.pear.pear-error; &core.pear.system; </chapter> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/peardoc/ja/chapters/support.xml?r1=1.6&r2=1.7&diff_format=u Index: peardoc/ja/chapters/support.xml diff -u peardoc/ja/chapters/support.xml:1.6 peardoc/ja/chapters/support.xml:1.7 --- peardoc/ja/chapters/support.xml:1.6 Sun Aug 6 08:02:56 2006 +++ peardoc/ja/chapters/support.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.8 Maintainer: Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.9 Maintainer: Status: ready --> <!-- CREDITS: --> <chapter id="support"> <title>サポート</title> @@ -16,7 +16,7 @@ <para> 他の多くのオープンソースプロジェクトと同様に、サポートは メーリングリストを通じて行われます。 - 現在、PEAR 関連しては、以下に示すメーリングリストがあります(いずれも英語)。 + 現在 PEAR に関しては、以下の 7 つのメーリングリストがあります(いずれも英語)。 <itemizedlist> <listitem> <para> http://cvs.php.net/viewvc.cgi/peardoc/ja/chapters/faq.xml?r1=1.11&r2=1.12&diff_format=u Index: peardoc/ja/chapters/faq.xml diff -u peardoc/ja/chapters/faq.xml:1.11 peardoc/ja/chapters/faq.xml:1.12 --- peardoc/ja/chapters/faq.xml:1.11 Sun Aug 13 11:11:30 2006 +++ peardoc/ja/chapters/faq.xml Sat Oct 14 22:58:50 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.28 Maintainer: haruki Status: ready --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.29 Maintainer: haruki Status: ready --> <!-- [mj] The FAQ needs some heavy revision - don't translate it right now --> <chapter id="faq"> @@ -749,6 +749,35 @@ しか存在しないパッケージをインストールすることができます。 </para> </sect1> + <sect1 id="faq.read-only-folders-windows"> + <title> + Windows で、カスタマイズしたフォルダにインストールできない + </title> + <titleabbrev> + Windows のカスタマイズしたフォルダにおける「読み取り専用」 + は、実際に読み取り専用なわけではない + </titleabbrev> + <para> + そのフォルダの表示方法がカスタマイズされている + (訳注: フォルダの右クリック->「プロパティ」->「カスタマイズ」タブで変更されている) + かどうか調べるために、 + Windows はフォルダの &quot;読み取り専用&quot; 属性を使用します。 + この属性は、書き込み権限を管理する際には使用されません。 + &quot;読み取り専用&quot; のフォルダにもファイルを作成することができます。詳細は + <ulink url="http://support.microsoft.com/default.aspx?scid=kb;ja-jp;326549"> + http://support.microsoft.com/default.aspx?scid=kb;ja-jp;326549</ulink> + を参照ください。 + </para> + <para> + PEAR インストーラは、この読み取り専用属性を検出するとインストールを中止します。 + 悲しいことに、カスタマイズしたフォルダと本当に読み取り専用のフォルダを + Windows では区別できないのです。 + </para> + <para> + 対策としては、PEAR パッケージをインストールするフォルダを + カスタマイズしないようにしてください。 + </para> + </sect1> </chapter> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/ja/package/structures/structures-datagrid/structures-datagrid-datasource/excel.xml?view=markup&rev=1.1 Index: peardoc/ja/package/structures/structures-datagrid/structures-datagrid-datasource/excel.xml +++ peardoc/ja/package/structures/structures-datagrid/structures-datagrid-datasource/excel.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <refentry id="package.structures.structures-datagrid.structures-datagrid-datasource.excel"> <refnamediv> <refname>Structures_DataGrid_DataSource_Excel</refname> <refpurpose>Excel スプレッドシート データソースドライバ</refpurpose> </refnamediv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-datasource.excel.desc"> <title>説明</title> <para> このクラスは、Excel スプレッドシート用のデータソースドライバです。 </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-datasource.excel.options"> <title>オプション</title> <para> このドライバは、以下のオプションを受け付けます。 </para> <table> <title>このドライバのオプション</title> <tgroup cols="4"> <thead> <row> <entry>オプション</entry> <entry>型</entry> <entry>説明</entry> <entry>デフォルト値</entry> </row> </thead> <tbody> <row> <entry>fields</entry> <entry>array</entry> <entry> データソースからどのフィールドを取得するか。空の配列を指定すると、 すべてのフィールドを取得します。 array(field1, field2, ...) 形式となります。 </entry> <entry>array()</entry> </row> <row> <entry>generate_columns</entry> <entry>bool</entry> <entry> ラベルつきの Structures_DataGrid_Column オブジェクトを作成します。 'labels' オプションを参照ください。 </entry> <entry>false</entry> </row> <row> <entry>header</entry> <entry>bool</entry> <entry>Excel ファイルに見出し行を含めるかどうかを指定します。</entry> <entry>false</entry> </row> <row> <entry>labels</entry> <entry>array</entry> <entry> データフィールドとラベルの対応。 'generate_columns' が true の場合にのみ使用します。 array(field =&gt; label, ...) 形式となります。 </entry> <entry>array()</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-datasource.excel.notes"> <title>全般的な注意</title> <para> このクラスは、reader.php というファイルが Spreadsheet/Excel/ ディレクトリに存在するものとして作成されています。 </para> <para> 注意してほしいのは、Spreadsheet_Excel_Reader の現在のバージョン (2i) では、read() メソッドの中で die() 文が用いられているということです。 die() 文は、reader.php の 171 行目にあります。そのせいで、 &quot;file not found&quot; エラーを PEAR で処理することができなくなっています。 </para> <para> そこで、この die() 文を例えば次のように書き換えることを推奨します。 <programlisting> return PEAR::raiseError('The filename ' . $sFileName . ' is not readable'); </programlisting> このクラスは、このように書き換えたコードにあわせて作成されており (とは言え、もちろん die() を用いたままのコードでも動作します)、 それによって正当なエラー処理ができるようになっています。 </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-exception/intro.xml?view=markup&rev=1.1 Index: peardoc/ja/core/pear/pear-exception/intro.xml +++ peardoc/ja/core/pear/pear-exception/intro.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: takagi Status: ready --> <refentry id="core.pear.pear-exception.intro"> <refnamediv> <refname> PEAR_Exception を使用した、PHP 5+ における高度なエラー処理 </refname> <refpurpose> PEAR_Exception の使用法 </refpurpose> </refnamediv> <refsynopsisdiv> <refsynopsisdivinfo> <author> <firstname>Gregory</firstname> <surname>Beaver</surname> <authorblurb><para>cellog@php.net</para></authorblurb> </author> <copyright> <year>2006</year> <holder>Gregory Beaver</holder> </copyright> <releaseinfo>PEAR_Exception PEAR 1.5.0a1</releaseinfo> </refsynopsisdivinfo> <simpara>PEAR_Exception の使用法の概要</simpara> </refsynopsisdiv> <refsect1 id="core.pear.pear-exception.intro.intro"> <title>導入</title> <para> このクラスは <ulink url="&url.pear.package;pear">PEAR パッケージ</ulink> の一部であり、以下のような機能があります。 <itemizedlist> <listitem> <para> 例外を入れ子状にできる (<programlisting role="php"><![CDATA[ <?php throw new PEAR_Exception($msg, $prev_exception); ?>]]></programlisting>)。 </para> </listitem> <listitem> <para> Subject/Observer パターン。これは例外のインスタンスが作成された際に発動します。 </para> </listitem> <listitem> <para> すっきりしており、詳しくて見栄えがいいエラーメッセージ。 </para> </listitem> <listitem> <para> 組み込みの例外クラスに比べて、より多くの情報を使用可能。 例えば、例外が発生した原因 (PEAR_Error/PEAR_ErrorStack/その他の例外) など。 </para> </listitem> <listitem> <para> 例外の原因としては、PEAR_Error オブジェクトあるいは PEAR_Exception オブジェクト、そして PEAR_Exceptions/PEAR_ErrorStack などの配列が設定できます。 </para> </listitem> <listitem> <para> 指定した例外クラスおよびその子クラスに対するコールバック。 </para> </listitem> </itemizedlist> </para> <para> 使用例です。 <programlisting role="php"> <![CDATA[ <?php require_once 'PEAR/Exception.php'; class Test { function foo() { throw new PEAR_Exception('エラーメッセージ', ERROR_CODE); } } function myLogger($pear_exception) { echo $pear_exception->getMessage(); } // 例外がスローされるたびに 'myLogger' がコールされます // (これを使用するかどうかは任意です) PEAR_Exception::addObserver('myLogger'); $test = new Test; try { $test->foo(); } catch (PEAR_Exception $e) { print $e; } ?> ]]> </programlisting> </para> <para> API ドキュメントは、phpDocumentor で作成した PEAR パッケージのドキュメントに含まれます。このクラスは非常にシンプルなので、 PEAR パッケージのソースを読めばよりよい使用法を見つけられるでしょう。 </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-errorstack/staticpop.xml?view=markup&rev=1.1 Index: peardoc/ja/core/pear/pear-errorstack/staticpop.xml +++ peardoc/ja/core/pear/pear-errorstack/staticpop.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <refentry id="core.pear.pear-errorstack.staticpop"> <refnamediv> <refname> <function>PEAR_ErrorStack::staticPop</function> </refname> <refpurpose> <link linkend="core.pear.pear-errorstack.pop"> <function>pop</function> </link> の静的バージョン </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;PEAR/ErrorStack.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef> <replaceable>false|array</replaceable> <function>PEAR_ErrorStack::staticPop</function> </funcdef> <paramdef> &type.string; <parameter>$package</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.pear-errorstack.staticpop.desc"> &title.desc; <para>エラースタックからエラーを取り出します。静的メソッドです。</para> </refsect1> <refsect1 id="core.pear.pear-errorstack.staticpop.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$package</parameter> </term> <listitem> <para> エラーメッセージを取得するパッケージ名。 </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.pear.pear-errorstack.staticpop.returns"> &title.returns; <para> 互換性モードが on の場合には PEAR_Error もスローされます。 </para> </refsect1> <refsect1 id="core.pear.pear-errorstack.staticpop.since"> &title.note; <para> PEAR 1.5.0a1 以降で使用可能です。 </para> </refsect1> <refsect1 id="core.pear.pear-errorstack.staticpop.throws"> &title.throws; &noexceptions; </refsect1> <refsect1 id="core.pear.pear-errorstack.staticpop.note"> &title.note; &note.shouldstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/ja/core/pear/pear-exception.xml?view=markup&rev=1.1 Index: peardoc/ja/core/pear/pear-exception.xml +++ peardoc/ja/core/pear/pear-exception.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect1 id="core.pear.pear-exception"> <title>PEAR_Exception - PHP 5+</title> <titleabbrev>PEAR_Exception</titleabbrev> <para> PEAR_Exception は、PHP 5 対応の PEAR パッケージで推奨されるエラー処理方法です。 PEAR_Exception は、PHP 5 に組み込まれている <classname>Exception</classname> クラスの軽量なラッパーです。エラーの原因を指定したり オブザーバを登録したり、その他多くの機能を持っています。 </para> <para>使用例 (使用法を示すためだけのもので、推奨される方法ではありません) <programlisting role="php"> <![CDATA[ <?php require_once 'PEAR/Exception.php'; class MyPackage_Exception extends PEAR_Exception {} try { throw new PEAR_Exception('exception 1'); } catch (MyPackage_Exception $e) { echo 'これは実行されません'; } catch (PEAR_Exception $e) { echo 'こちらが実行されます'; } try { throw new MyPackage_Exception('exception 2'); } catch (MyPackage_Exception $e) { echo 'これが実行されます'; } catch (PEAR_Exception $e) { echo 'こちらは実行されません'; } ?> ]]> </programlisting> </para> <para> 一般に、例外は例外的な場合にのみ使用するものです。 例えば、実行を停止しなければならないようなエラーです。 PEAR_Exception の主な使用目的はエラーの情報を既存のパッケージの外部に提供することで、 一般的なフロー制御は行いません。<ulink url="&url.php.manual;ja/language.control-structures.php"> 制御構造</ulink> を使用して例外の処理をしてください。 </para> &core.pear.pear-exception.intro; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#8614) next »