cvs: phpdoc /ja/functions datetime.xml dba.xml dbase.xml dbm.xml dbplus.xml dbx.xml dir.xml domxml.xml errorfunc.xml exec.xml fbsql.xml filepro.xml
filesystem.xml ftp.xml

From: Date: Sat, 19 Jan 2002 14:58:32 +0000
Subject: cvs: phpdoc /ja/functions datetime.xml dba.xml dbase.xml dbm.xml dbplus.xml dbx.xml dir.xml domxml.xml errorfunc.xml exec.xml fbsql.xml filepro.xml
filesystem.xml ftp.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969341429@lists.php.net to get a copy of this message
hirokawa Sat Jan 19 09:58:32 2002 EDT Modified files: /phpdoc/ja/functions datetime.xml dba.xml dbase.xml dbm.xml dbplus.xml dbx.xml dir.xml domxml.xml errorfunc.xml exec.xml fbsql.xml filepro.xml filesystem.xml ftp.xml Log: translation updated.

Index: phpdoc/ja/functions/datetime.xml diff -u phpdoc/ja/functions/datetime.xml:1.29 phpdoc/ja/functions/datetime.xml:1.30 --- phpdoc/ja/functions/datetime.xml:1.29 Wed Dec 12 15:52:49 2001 +++ phpdoc/ja/functions/datetime.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.30 $ --> <reference id="ref.datetime"> <title>日付・時刻関数</title> <titleabbrev>日付/時刻</titleabbrev> @@ -42,6 +43,10 @@ </listitem> </itemizedlist> </para> + <para> + <function>mktime</function>及び<function>strtotime</function>も参 + 照下さい。 + </para> </refsect1> </refentry> @@ -64,9 +69,25 @@ </funcprototype> </funcsynopsis> <para> - 与えられた引数 <parameter>timestamp</parameter> を、与えられた + 指定された引数 <parameter>timestamp</parameter> を、与えられた フォーマット文字列によりフォーマットし、日付文字列を返します。 - タイムスタンプが与えられない場合は、現在のローカル時刻が使われます。 + タイムスタンプが与えられない場合は、現在のローカル時刻が使われま + す。 + <note> + <para> + 有効なタイムスタンプの範囲は通常 Fri, 13 Dec 1901 + 20:45:54 GMTからTue, 19 Jan 2038 03:14:07 GMTまでです。 + (これらの日付は、32ビット符号付き整数の最小および最大値に対応し + ます。) + </para> + <para> + 日付の文字列表現からタイムスタンプを生成するには、 + <function>strtotime</function>を使用できる可能性があります。加 + えて、いくつかのデータベースは、(MySQLのUNIX_TIMESTAMP関数のよ + うな)日付フォーマットからタイムスタンプに変換する関数を有してい + ます。 + </para> + </note> </para> <para> フォーマット文字列では、以下の文字が認識されます。 @@ -191,6 +212,12 @@ </listitem> <listitem> <simpara> + W - ISO-8601 月曜日に始まる年単位の週番号 (PHP 4.1.0で追加) + (Saturday) + </simpara> + </listitem> + <listitem> + <simpara> Y - 年。4 桁の数字。すなわち"1999"。 </simpara> </listitem> @@ -206,34 +233,60 @@ </listitem> <listitem> <simpara> - Z - タイムゾーンのオフセット秒数。(すなわち、"-43200"から"43200") + Z - タイムゾーンのオフセット秒数。(すなわち、"-43200"から + "43200")UTCの西側のタイムゾーン用のオフセットは常に負です。そ + して、UTCの東側のオフセットは常に正です。 </simpara> </listitem> </itemizedlist> フォーマット文字列中の認識されない文字は、そのまま表示されます。 - <function>gmdate()</function>で使用した場合、"Z"フォーマットは常に"0"を + <function>gmdate</function>で使用した場合、"Z"フォーマットは常に"0"を 返します。 <example> <title><function>date</function> の例</title> <programlisting role="php"> -print (date ("l dS of F Y h:i:s A")); -print ("July 1, 2000 is on a " . date ("l", mktime(0,0,0,7,1,2000))); +<![CDATA[ +echo date ("l dS of F Y h:i:s A"); +echo "July 1, 2000 is on a " . date ("l", mktime(0,0,0,7,1,2000)); +]]> </programlisting> </example> </para> <para> + 前にバックスラッシュを付けてエスケープすることにより、フォーマッ + ト文字列として認識される文字が展開されることを防止することができ + ます。バックスラッシュ付きの文字は既に特別なシーケンスであり、バッ + クスラッシュもエスケープすることが必要となる可能性があります。 + <example> + <title><function>date</function>の文字をエスケープする</title> + <programlisting role="php"> +<![CDATA[ +echo date("l \\t\h\e jS"); // 'Saturday the 8th'のように出力 +]]> + </programlisting> + </example> + </para> + <para> <function>date</function> と <function>mktime</function> の 両方を用いて未来または過去の日付を知ることができます。 <example> <title> <function>date</function>と<function>mktime</function>の例 </title> - <programlisting> + <programlisting role="php"> +<![CDATA[ $tomorrow = mktime (0,0,0,date("m") ,date("d")+1,date("Y")); $lastmonth = mktime (0,0,0,date("m")-1,date("d"), date("Y")); $nextyear = mktime (0,0,0,date("m"), date("d"), date("Y")+1); +]]> </programlisting> </example> + <note> + <para> + サマータイムがあるため日付や月の秒数を単純にタイムスタンプに可 + 減算するよりもより信頼性があります。 + </para> + </note> </para> <para> <function>date</function> フォーマットのいくつかの例を示します。 @@ -247,6 +300,7 @@ <function>date</function> によるフォーマット </title> <programlisting role="php"> +<![CDATA[ /* 今日は、March 10th, 2001, 5:16:18 pm です。 */ $today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm $today = date("m.d.y"); // 03.10.01 @@ -257,6 +311,7 @@ $today = date("D M j G:i:s T Y"); // Sat Mar 10 15:16:08 MST 2001 $today = date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:17 m is month $today = date("H:i:s"); // 17:16:17 +]]> </programlisting> </example> </para> @@ -266,8 +321,9 @@ 関数を使用する必要があります。 </para> <para> - <function>gmdate</function>, <function>mktime</function>も参照下 - さい。 + <function>getlastmod</function>, <function>gmdate</function>, + <function>mktime</function>, <function>strftime</function>, + <function>time</function>も参照下さい。 </para> </refsect1> </refentry> @@ -347,12 +403,14 @@ </itemizedlist> <example> <title><function>getdate</function> の例</title> - <programlisting> + <programlisting role="php"> +<![CDATA[ $today = getdate(); $month = $today['month']; $mday = $today['mday']; $year = $today['year']; echo "$month $mday, $year"; +]]> </programlisting> </example> </para> @@ -429,14 +487,17 @@ <example> <title><function>gmdate</function>の例</title> <programlisting role="php"> +<![CDATA[ echo date ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); +]]> </programlisting> </example> </para> <para> <function>date</function>,<function>mktime</function>, - <function>gmmktime</function>も参照下さい。 + <function>gmmktime</function>, <function>strftime</function>も参 + 照下さい。 </para> </refsect1> </refentry> @@ -499,9 +560,11 @@ <example> <title><function>gmstrftime</function> の例</title> <programlisting role="php"> -setlocale ('LC_TIME','en_US'); +<![CDATA[ +setlocale ('LC_TIME', 'en_US'); echo strftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n"; echo gmstrftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n"; +]]> </programlisting> </example> </para> @@ -622,6 +685,7 @@ <example> <title><function>microtime</function> の例</title> <programlisting role="php"> +<![CDATA[ function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$sec + (float)$usec); @@ -629,7 +693,7 @@ $time_start = getmicrotime(); -for ($i=0; $i &lt; 1000; $i++){ +for ($i=0; $i < 1000; $i++){ // 何もしない。1000 回ループ } @@ -637,6 +701,7 @@ $time = $time_end - $time_start; echo "$time 秒間何もしませんでした。"; +]]> </programlisting> </example> </para> @@ -702,11 +767,13 @@ 例えば、以下の各行はいずれも文字列 "Jan-01-1998"を出力します。 <example> <title><function>mktime</function>の例</title> - <programlisting> + <programlisting role="php"> +<![CDATA[ echo date ("M-d-Y", mktime (0,0,0,12,32,1997)); echo date ("M-d-Y", mktime (0,0,0,13,1,1997)); echo date ("M-d-Y", mktime (0,0,0,1,1,1998)); echo date ("M-d-Y", mktime (0,0,0,1,1,98)); +]]> </programlisting> </example> <parameter>year</parameter> は2桁または4桁の値を指定可能で、 @@ -721,11 +788,13 @@ <example> <title>次の月の最後の日</title> <programlisting role="php"> +<![CDATA[ $lastday = mktime (0,0,0,3,0,2000); echo strftime ("Last day in Feb 2000 is: %d", $lastday); $lastday = mktime (0,0,0,4,-31,2000); echo strftime ("Last day in Feb 2000 is: %d", $lastday); +]]> </programlisting> </example> </para> @@ -954,14 +1023,16 @@ <example> <title><function>strftime</function>の例</title> <programlisting role="php"> +<![CDATA[ setlocale ("LC_TIME", "C"); -print(strftime("%A in Finnish is ")); +print (strftime ("%A in Finnish is ")); setlocale ("LC_TIME", "fi_FI"); -print(strftime("%A, in French ")); -setlocale ("LC_TIME", "fr_CA"); -print(strftime("%A and in German ")); +print (strftime ("%A, in French ")); +setlocale ("LC_TIME", "fr_FR"); +print (strftime ("%A and in German ")); setlocale ("LC_TIME", "de_DE"); -print(strftime("%A.\n")); +print (strftime ("%A.\n")); +]]> </programlisting> </example> この例は、各ロケールがシステムにインストールされている場合に動作します。 @@ -1023,14 +1094,40 @@ <example> <title><function>strtotime</function>の例</title> <programlisting role="php"> -echo strtotime ("now") . "\n"; -echo strtotime ("10 September 2000") . "\n"; -echo strtotime ("+1 day") . "\n"; -echo strtotime ("+1 week") . "\n"; -echo strtotime ("+1 week 2 days 4 hours 2 seconds") . "\n"; +<![CDATA[ +echo strtotime ("now"), "\n"; +echo strtotime ("10 September 2000"), "\n"; +echo strtotime ("+1 day"), "\n"; +echo strtotime ("+1 week"), "\n"; +echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n"; +echo strtotime ("next Thursday"), "\n"; +echo strtotime ("last Monday"), "\n"; +]]> </programlisting> </example> </para> + <para> + <example> + <title>失敗のチェック</title> + <programlisting role="php"> +<![CDATA[ +$str = 'Not Good'; +if (($timestamp = strtotime($str)) === -1) { + echo "The string ($str) is bogus"; +} else { + echo "$str == ". date('l dS of F Y h:i:s A',$timestamp); +} +]]> + </programlisting> + </example> + </para> + <note> + <para> + タイムスタンプの有効な範囲は、通常、Fri, 13 Dec 1901 20:45:54 + GMTからTue, 19 Jan 2038 03:14:07 GMTまでです。(これらは、32ビッ + ト符号付整数の最大及び最小に一致します。) + </para> + </note> </refsect1> </refentry> Index: phpdoc/ja/functions/dba.xml diff -u phpdoc/ja/functions/dba.xml:1.9 phpdoc/ja/functions/dba.xml:1.10 --- phpdoc/ja/functions/dba.xml:1.9 Wed Dec 12 15:52:50 2001 +++ phpdoc/ja/functions/dba.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.dba"> <title>(dbm型の)データベース・アブストラクション レイヤー関数</title> <titleabbrev>dba</titleabbrev> @@ -23,61 +24,89 @@ 用の機能は実行しません。 </para> <para> - 以下のハンドラのサポートを追加するには、PHPの configure にて指定さ - れた --with configure スイッチを追加します。 - <itemizedlist> - <listitem> - <simpara> - dbm は最も古い(元祖の)Berkeley DB 型データベースです。 - 可能ならば使用しない方が良いでしょう。DB2 および gdbm に組み込まれている - 互換性を保つための関数は、サポートされません。 - これは、実装されているのがソースレベルの互換性のみであり、 - 元の dbm フォーマットを処理することができないためです。(--with-dbm) - </simpara> - </listitem> - <listitem> - <simpara> - ndbm は、より新型であり、dbmよりも柔軟です。 - dbm 固有の制約の多くをまだ有しています。(そのため、不人気です。) - (--with-ndbm) - </simpara> - </listitem> - <listitem> - <simpara> - gdbmは、<ulink url="&url.gdbm;">GNUデータベースマネージャ</ulink> - です。(--with-gdbm) - </simpara> - </listitem> - <listitem> - <simpara> - db2 は、<ulink url="&url.sleepycat;">Sleepycat Software's DB2</ulink> - です。これは、「スタンドアローンおよびクライアント/サーバー - アプリケーションの両方で高性能な組込みデータベースサポートを提供する - プログラム用ツールキット」として記述されています。(--with-db2) - </simpara> - </listitem> - <listitem> - <simpara> - DB3 は、<ulink url="&url.sleepycat;">Sleepycat Softwareの - DB3</ulink>です。(--with-db3) - </simpara> - </listitem> - <listitem> - <simpara> - cdbは、固定データベースの作成・読込み用の高速で高信頼性の軽量型 - パッケージです。 - これは、qmailの作者によるものであり、<ulink url="&url.cdb;">ここ</ulink> - にあります。固定であるため、読込み操作のみがサポートされます。 - (--with-cdb) - </simpara> - </listitem> - </itemizedlist> + <function>dba_open</function>または<function>dba_popen</function> + 関数を実行する際、以下のハンドラの1つを引数として指定する必要があ + ります。実際に利用可能茄ハンドラのリストは、 + <function>phpinfo</function>を実行した際に表示されます。(PHPの作成 + 時に以下のハンドラのどれかのサポートを追加するには、PHPのconfigure + にスイッチ<literal>--with-XXXX</literal> の指定を追加して下さい。 + <table> + <title>DBAハンドラのリスト</title> + <tgroup cols="2"> + <thead> + <row> + <entry>ハンドラ</entry> + <entry>注意</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>dbm</literal></entry> + <entry> + dbm は最も古い(元祖の)Berkeley DB 型データベースです。可能なら + ば使用しない方が良いでしょう。DB2およびgdbmに組み込まれている互 + 換性を保つための関数は、サポートされません。これは、実装されて + いるのがソースレベルの互換性のみであり、元のdbmフォーマットを処 + 理することができないためです。(<literal>--with-dbm</literal>) + </entry> + </row> + + <row> + <entry><literal>ndbm</literal></entry> + <entry> + ndbm は、より新型であり、dbmよりも柔軟です。 + dbm固有の制約の多くをまだ有しています。(そのため、古い実装です。) + (<literal>--with-ndbm</literal>) + </entry> + </row> + + <row> + <entry><literal>gdbm</literal></entry> + <entry> + gdbmは、<ulink url="&url.gdbm;">GNUデータベースマネージャ + </ulink>です。(<literal>--with-gdbm</literal>) + </entry> + </row> + + <row> + <entry><literal>db2</literal></entry> + <entry> + DB2 は、<ulink url="&url.sleepycat;">Sleepycat Software's DB2</ulink> + です。これは、「スタンドアローンおよびクライアント/サーバー + アプリケーションの両方で高性能な組込みデータベースサポートを提供する + プログラム用ツールキット」として記述されています。 + (<literal>--with-db2</literal>) + </entry> + </row> + + <row> + <entry><literal>db3</literal></entry> + <entry> + DB3 は、<ulink url="&url.sleepycat;">Sleepycat Softwareの + DB3</ulink>です。(<literal>--with-db3</literal>) + </entry> + </row> + + <row> + <entry><literal>cdb</literal></entry> + <entry> + cdbは、固定データベースの作成・読込み用の高速で高信頼性の軽量型 + パッケージです。これは、qmailの作者によるものであり、<ulink + url="&url.cdb;">ここ</ulink>にあります。固定であるため、読込 + み操作のみがサポートされます。(<literal>--with-cdb</literal>) + </entry> + </row> + + </tbody> + </tgroup> + </table> </para> <para> <example> <title>DBAの例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $id = dba_open ("/tmp/test.db", "n", "db2"); @@ -94,7 +123,8 @@ } dba_close ($id); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -116,9 +146,10 @@ </para> <para> <example> - <title>データベースに連続アクセス</title> + <title>データベースへの連続アクセス</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php # ...データベースをオープンする... @@ -131,10 +162,11 @@ $key = dba_nextkey ($id); } -for ($i = 0; $i &lt; count($handle_later); $i++) +for ($i = 0; $i < count($handle_later); $i++) dba_delete ($handle_later[$i], $id); -?&gt; +?> +]]> </programlisting> </example> </para> Index: phpdoc/ja/functions/dbase.xml diff -u phpdoc/ja/functions/dbase.xml:1.7 phpdoc/ja/functions/dbase.xml:1.8 --- phpdoc/ja/functions/dbase.xml:1.7 Wed Dec 12 15:52:51 2001 +++ phpdoc/ja/functions/dbase.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.8 $ --> <reference id="ref.dbase"> <title>dBase 関数</title> <titleabbrev>dBase</titleabbrev> @@ -99,8 +100,9 @@ データベースの作成に成功した場合、dbase ID が返されます。失敗した 場合は、&false; が返されます。 <example> - <title>dBase データベースファイルを作成する</title> + <title>dBaseデータベースファイルを作成する</title> <programlisting role="php"> +<![CDATA[ // データベース名 $dbname = "/tmp/test.dbf"; @@ -116,8 +118,8 @@ // 作成 if (!dbase_create($dbname, $def)) - print "&lt;strong>Error!&lt;/strong>"; - + print "<strong>Error!</strong>"; +]]> </programlisting> </example> </para> @@ -286,8 +288,20 @@ い。) </para> <para> - 各フィールドは、適当な PHP 型に変換されます。(日付は、文字列に変 - 換されます。) + 各フィールドは、適当な PHP 型に変換されます。 + <itemizedlist> + <listitem> + <simpara> + 日付は、文字列のままとなります。 + </simpara> + </listitem> + <listitem> + <simpara> + 整数は、オーバーフロー(>32ビット)を起こす可能性がある整数が文 + 字列として返します。 + </simpara> + </listitem> + </itemizedlist> </para> </refsect1> </refentry> @@ -315,8 +329,20 @@ (<function>dbase_delete_record</function>を参照下さい。) </para> <para> - 各フィールドは、適当な PHP 型に変換されます。(日付は、文字列に変 - 換されます。) + 各フィールドは以下の例外を除き表示適当なPHP型に変換されます。 + <itemizedlist> + <listitem> + <simpara> + 日付は文字列のままとなります。 + </simpara> + </listitem> + <listitem> + <simpara> + オーバーフローを発生するような整数(>32ビット)は、文字列として + 返されます。 + </simpara> + </listitem> + </itemizedlist> </para> </refsect1> </refentry> @@ -343,11 +369,13 @@ <example> <title><function>dbase_numfields</function> の使用法</title> <programlisting> +<![CDATA[ $rec = dbase_get_record($db, $recno); $nf = dbase_numfields($db); -for ($i=0; $i &lt; $nf; $i++) { - print $rec[$i]."&lt;br>\n"; +for ($i=0; $i < $nf; $i++) { + print $rec[$i]."<br>\n"; } +]]> </programlisting> </example> </para> Index: phpdoc/ja/functions/dbm.xml diff -u phpdoc/ja/functions/dbm.xml:1.8 phpdoc/ja/functions/dbm.xml:1.9 --- phpdoc/ja/functions/dbm.xml:1.8 Wed Dec 12 15:52:51 2001 +++ phpdoc/ja/functions/dbm.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.9 $ --> <reference id="ref.dbm"> <title>DBM関数</title> <titleabbrev>DBM</titleabbrev> @@ -7,7 +8,7 @@ <simpara> これらの関数により、レコードを dbm 形式 のデータベースに格納 できるようになります。この形式のデータベース(組み込みのフラット - ファイル・ライブラリと同様に、Berkeley db, gdbm その他のシステム・ + ファイル・ライブラリと同様に、Berkeley DB, GDBMその他のシステム・ ライブラリによりサポートされています)は、(リレーショナル・データ ベースによりサポートされる事細かなレコード形式ではなく、) キーと値の組み合わせを格納します。 @@ -16,6 +17,7 @@ <example> <title>dbm の例</title> <programlisting role="php"> +<![CDATA[ $dbm = dbmopen ("lastseen", "w"); if (dbmexists ($dbm, $userid)) { $last_seen = dbmfetch ($dbm, $userid); @@ -25,6 +27,7 @@ do_stuff(); dbmreplace ($dbm, $userid, time()); dbmclose ($dbm); +]]> </programlisting> </example> </para> @@ -45,21 +48,21 @@ </funcprototype> </funcsynopsis> <para> - 第1引数はオープンされるdbmファイルのフルパス名で、第2引数は + 第1引数はオープンされるDBMファイルのフルパス名で、第2引数は ファイルオープンモードです。これは "r", "n", "c", "w" のうちのいずれかで、 順に読み込み用、新規ファイル(読み書き可能。既に存在する同名のファイルを 上書きする可能性があります。)、作成(読み書き可能。既に存在する同名の ファイルを上書きしません)および読み書き用を示します。 </para> <para> - 成功すると他のdbm関数に渡すIDを返し、失敗すると&false;を返します。 + 成功すると他のDBM関数に渡すIDを返し、失敗すると&false;を返します。 </para> <para> - ndbm サポートが有効な場合、実際に ndbm が filename.dir と - filename.pag ファイルを作成します。gdbm は、 + NDBMサポートが有効な場合、実際にNDBMが filename.dir と + filename.pag ファイルを作成します。GDBMは、 PHP 組込のフラット・ファイル機能と同様に 1 つのファイルしか 使いません。Berkeley db は、filename.db ファイルを作成します。 - PHP では、dbm ライブラリ自体が行うファイルロックに加えて、 + PHP では、DBMライブラリ自体が行うファイルロックに加えて、 自分自身でもファイルロックを行うということに注意して下さい。 PHP では自分で生成した .lck ファイルを削除しません。 PHP では単純にこれらの @@ -149,7 +152,8 @@ </funcprototype> </funcsynopsis> <para> - データベースに、指定したキー(key)に対応する値を追加します。</para> + データベースに、指定したキー(key)に対応する値を追加します。 + </para> <para> データベースがリードオンリーでオープンされていた場合は -1 を返し、 挿入が成功すれば 0 を返します。指定されたキーが存在する場合は 1 を @@ -253,11 +257,13 @@ ある dbm データベース上のすべてのキー/値の組み合わせを取り出します。 </title> <programlisting role="php"> +<![CDATA[ $key = dbmfirstkey ($dbm_id); while ($key) { echo "$key = " . dbmfetch ($dbm_id, $key) . "\n"; $key = dbmnextkey ($dbm_id, $key); } +]]> </programlisting> </example> </para> @@ -267,14 +273,14 @@ <refentry id="function.dblist"> <refnamediv> <refname>dblist</refname> - <refpurpose>使用されている dbm 互換ライブラリの一覧を返します</refpurpose> + <refpurpose>使用されているDBM互換ライブラリの一覧を返す</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dblist</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> </refsect1> Index: phpdoc/ja/functions/dbplus.xml diff -u phpdoc/ja/functions/dbplus.xml:1.3 phpdoc/ja/functions/dbplus.xml:1.4 --- phpdoc/ja/functions/dbplus.xml:1.3 Wed Dec 12 15:52:51 2001 +++ phpdoc/ja/functions/dbplus.xml Sat Jan 19 09:58:31 2002 @@ -1,26 +1,38 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <reference id="ref.dbplus"> <title>DB++ 関数</title> <titleabbrev></titleabbrev> <partintro> - &warn.experimental; + &warn.experimental; <section id="dbplus.intro"> - <title>db++ データベースの実験的なサポート</title> + <title>DB++データベース関数</title> <para> - 本節は、PHPが、db++のクライアント/サーバー "C" ライブラリインター - フェイスにより全ての検索および更新メソッドdb++に関連するファイルに - アクセスすることを可能にし、db++クエリの出力を読み込んで処理するこ - とを可能にするdb++拡張モジュールについて説明します。 + db++は、ドイツの企業<ulink url="&url.dbplus.company;">Concept + asa</ulink>により作成された高性能でかつメモリ使用量とディスク使用 + 量が小さいことを特徴とするリレーショナルデータベースシステムです。 + db++では、SQLは補助的なインターフェイス原語として提供されており、 + 元来のSQLデータベースであるわけではありませんが、SQLよりも関係代 + 数にはるかに強く影響された固有のAQLクエリ言語が提供されています。 + </para> + <para> + Concept asaは、常にオープンソース言語のサポートに関心を持って来て + おり、db++はPerl、Tclコールのインターフェイスを何年も前から有し、 + Tclを内部的なストアドプロシージャ言語として使用しています。 </para> </section> <section id="dbplus.requirenments"> <title>必要なもの</title> <para> - ??? Download where + db++インストール用アーカイブに含まれている開発ライブラリとヘッダ + ファイルが必要です。その他に<ulink + url="&url.dbplus.company;">Concept asa</ulink>が、<ulink + url="&url.dbplus.documentation;">ドキュメント</ulink>とLinux及び + 他のいくつかのUNIX版とWindows95/NT用にdb++の<ulink + url="&url.dbplus.download;">デモ版</ulink>を提供しています。 </para> </section> @@ -35,57 +47,304 @@ </para> <para> <command>configure</command> は、クライアントライブラリおよび - ヘッダファイルをデフォルトのパス<filename>/usr/dbplus/</filename> - 以下で探します。db++を違う場所にインストールしている場合には、 - <command>configure</command>のオプションに - <option>--with-dbplus=/your/installation/path</option>のように - インストールしたパスを追加する必要があります。 + ヘッダファイルをデフォルトのパス<filename>/usr/dbplus/</filename>、 + <filename>/usr/local/dbplus</filename>および + <filename>/opt/dblus</filename>以下で探します。db++を違う場所にイ + ンストールしている場合には、<command>configure</command>のオプショ + ンに<option>--with-dbplus=/your/installation/path</option>のよう + にインストールしたパスを追加する必要があります。 + </para> + </section> + <section id="dbplus.errorcodes"> + <title>db++ error codes</title> + <para> + <table> + <title>DB++エラーコード</title> + <tgroup cols="3"> + <thead> + <row> + <entry>PHP定数</entry> + <entry>db++定数</entry> + <entry>意味</entry> + </row> + </thead> + <tbody> + <row> + <entry>DBPLUS_ERR_NOERR</entry> + <entry>ERR_NOERR</entry> + <entry>Nullエラー条件</entry> + </row> + <row> + <entry>DBPLUS_ERR_DUPLICATE</entry> + <entry>ERR_DUPLICATE</entry> + <entry>冗長なタプルを挿入した</entry> + </row> + <row> + <entry>DBPLUS_ERR_EOSCAN</entry> + <entry>ERR_EOSCAN</entry> + <entry>rget()からスキャン終了</entry> + </row> + <row> + <entry>DBPLUS_ERR_EMPTY</entry> + <entry>ERR_EMPTY</entry> + <entry>関係が空(サーバ)</entry> + </row> + <row> + <entry>DBPLUS_ERR_CLOSE</entry> + <entry>ERR_CLOSE</entry> + <entry>サーバをクローズできない</entry> + </row> + <row> + <entry>DBPLUS_ERR_WLOCKED</entry> + <entry>ERR_WLOCKED</entry> + <entry>レコードは書き込みロックされている</entry> + </row> + <row> + <entry>DBPLUS_ERR_LOCKED</entry> + <entry>ERR_LOCKED</entry> + <entry>関係は既にロックされている</entry> + </row> + <row> + <entry>DBPLUS_ERR_NOLOCK</entry> + <entry>ERR_NOLOCK</entry> + <entry>関係をロックできない</entry> + </row> + <row> + <entry>DBPLUS_ERR_READ</entry> + <entry>ERR_READ</entry> + <entry>関係の読み込みエラー</entry> + </row> + <row> + <entry>DBPLUS_ERR_WRITE</entry> + <entry>ERR_WRITE</entry> + <entry>関係の書き込みエラー</entry> + </row> + <row> + <entry>DBPLUS_ERR_CREATE</entry> + <entry>ERR_CREATE</entry> + <entry>create()システムコールが失敗</entry> + </row> + <row> + <entry>DBPLUS_ERR_LSEEK</entry> + <entry>ERR_LSEEK</entry> + <entry>lseek()システムコールが失敗</entry> + </row> + <row> + <entry>DBPLUS_ERR_LENGTH</entry> + <entry>ERR_LENGTH</entry> + <entry>最大長を越えるタプル</entry> + </row> + <row> + <entry>DBPLUS_ERR_OPEN</entry> + <entry>ERR_OPEN</entry> + <entry>open()システムコールが失敗</entry> + </row> + <row> + <entry>DBPLUS_ERR_WOPEN</entry> + <entry>ERR_WOPEN</entry> + <entry>関係は既に書き込みオープンされている</entry> + </row> + <row> + <entry>DBPLUS_ERR_MAGIC</entry> + <entry>ERR_MAGIC</entry> + <entry>ファイルは関係でない</entry> + </row> + <row> + <entry>DBPLUS_ERR_VERSION</entry> + <entry>ERR_VERSION</entry> + <entry>ファイルは非常に古い関係である</entry> + </row> + <row> + <entry>DBPLUS_ERR_PGSIZE</entry> + <entry>ERR_PGSIZE</entry> + <entry>関係は異なったページサイズを使用している</entry> + </row> + <row> + <entry>DBPLUS_ERR_CRC</entry> + <entry>ERR_CRC</entry> + <entry>不正なCRCがスーパーページにある</entry> + </row> + <row> + <entry>DBPLUS_ERR_PIPE</entry> + <entry>ERR_PIPE</entry> + <entry>パイプ上の関係はlseek()を要求している</entry> + </row> + <row> + <entry>DBPLUS_ERR_NIDX</entry> + <entry>ERR_NIDX</entry> + <entry>セカンダリインデックスが多すぎる</entry> + </row> + <row> + <entry>DBPLUS_ERR_MALLOC</entry> + <entry>ERR_MALLOC</entry> + <entry>malloc()コールが失敗した</entry> + </row> + <row> + <entry>DBPLUS_ERR_NUSERS</entry> + <entry>ERR_NUSERS</entry> + <entry>最大ユーザ数エラー</entry> + </row> + <row> + <entry>DBPLUS_ERR_PREEXIT</entry> + <entry>ERR_PREEXIT</entry> + <entry>無効な使用法により発生</entry> + </row> + <row> + <entry>DBPLUS_ERR_ONTRAP</entry> + <entry>ERR_ONTRAP</entry> + <entry>シグナルにより発生</entry> + </row> + <row> + <entry>DBPLUS_ERR_PREPROC</entry> + <entry>ERR_PREPROC</entry> + <entry>プリプロセッサにおけるエラー</entry> + </row> + <row> + <entry>DBPLUS_ERR_DBPARSE</entry> + <entry>ERR_DBPARSE</entry> + <entry>パーサ上のエラー</entry> + </row> + <row> + <entry>DBPLUS_ERR_DBRUNERR</entry> + <entry>ERR_DBRUNERR</entry> + <entry>dbにおける実行エラー</entry> + </row> + <row> + <entry>DBPLUS_ERR_DBPREEXIT</entry> + <entry>ERR_DBPREEXIT</entry> + <entry>prexit()*プロシージャにより発生した終了条件</entry> + </row> + <row> + <entry>DBPLUS_ERR_WAIT</entry> + <entry>ERR_WAIT</entry> + <entry>少し待つ(simpleのみ)</entry> + </row> + <row> + <entry>DBPLUS_ERR_CORRUPT_TUPLE</entry> + <entry>ERR_CORRUPT_TUPLE</entry> + <entry>クライアントが壊れたタプルを送信した</entry> + </row> + <row> + <entry>DBPLUS_ERR_WARNING0</entry> + <entry>ERR_WARNING0</entry> + <entry> + simpleルーチンが、修正済みの致命的でないエラーを発見した + </entry> + </row> + <row> + <entry>DBPLUS_ERR_PANIC</entry> + <entry>ERR_PANIC</entry> + <entry> + サーバは実際に実行中断していないが、全てのクライアントに + ERR_PANICを送信が送信された + </entry> + </row> + <row> + <entry>DBPLUS_ERR_FIFO</entry> + <entry>ERR_FIFO</entry> + <entry>fifoを作成できない</entry> + </row> + <row> + <entry>DBPLUS_ERR_PERM</entry> + <entry>ERR_PERM</entry> + <entry>不許可</entry> + </row> + <row> + <entry>DBPLUS_ERR_TCL</entry> + <entry>ERR_TCL</entry> + <entry>TCL_error</entry> + </row> + <row> + <entry>DBPLUS_ERR_RESTRICTED</entry> + <entry>ERR_RESTRICTED</entry> + <entry>ユーザ二人のみ</entry> + </row> + <row> + <entry>DBPLUS_ERR_USER</entry> + <entry>ERR_USER</entry> + <entry> + アプリケーションプログラマによるライブラリの使用エラー + </entry> + </row> + <row> + <entry>DBPLUS_ERR_UNKNOWN</entry> + <entry>ERR_UNKNOWN</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> </para> </section> - </partintro> - + <refentry id="function.dbplus-add"> <refnamediv> <refname>dbplus_add</refname> - <refpurpose>Add a tuple to a relation</refpurpose> + <refpurpose>関係にタプルを追加する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_add</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + この関数は、関係にタプルを追加します。 + <parameter>tuple</parameter>データは、属性/値の組の配列であり、 + 指定した<parameter>relation</parameter>に挿入されます。実行に成功 + する、<parameter>tuple</parameter>配列には新規に生成されたタプル + の完全なデータが含まれ、そこにはシーケンスのような暗黙の内に設定 + される全てのドメインが含まれます。 + </para> <para> + この関数は成功時に(すなわちDBPLUS_ERR_NOERR)ゼロ、失敗時にdb++エ + ラーコードを返します。db++エラーコードに関するより詳細な情報につ + いては、<function>dbplus_errcode</function>または本章の導入部を参 + 照下さい。 </para> </refsect1> </refentry> - + <refentry id="function.dbplus-aql"> <refnamediv> <refname>dbplus_aql</refname> - <refpurpose>Perform AQL query</refpurpose> + <refpurpose>AQLクエリを実行する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_aql</function></funcdef> - <paramdef>string <parameter>query</parameter></paramdef> - <paramdef>string - <parameter><optional>server</optional></parameter> - </paramdef> - <paramdef>string - <parameter><optional>dbpath</optional></parameter> - </paramdef> + <funcdef>resource <function>dbplus_aql</function></funcdef> + <paramdef>string <parameter>query</parameter></paramdef> + <paramdef>string + <parameter><optional>server</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>dbpath</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_aql</function>は、 + AQL<parameter>query</parameter>を指定した + <parameter>server</parameter>および + <parameter>dbpath</parameter>で実行します。 + </para> + <para> + 成功時に関係ハンドルを返します。結果データは、 + <function>dbplus_next</function>及び + <function>dbplus_current</function>をコールすることにより、この関 + 係から取得可能です。他の関係アクセス関数は結果関係で動作しません。 + </para> <para> + AQL A... Query Languageに関するより詳細な情報については、オリジナ + ルのdb++マニュアルで提供されています。 </para> </refsect1> </refentry> @@ -93,20 +352,27 @@ <refentry id="function.dbplus-chdir"> <refnamediv> <refname>dbplus_chdir</refname> - <refpurpose>Get/Set database virtual current directory</refpurpose> + <refpurpose>データベース仮想カレントディレクトリを設定/取得</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dbplus_chdir</function></funcdef> - <paramdef>string - <parameter><optional>newdir</optional></parameter> - </paramdef> + <paramdef>string + <parameter><optional>newdir</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; - <para> + &warn.experimental.func; + <para> + <function>dbplus_chdir</function> は、 + <function>dbplus_open</function>により関係ファイルが探す仮想カレ + ントディレクトリを変更します。 + <function>dbplus_chdir</function>は、カレントディレクトリの絶対パ + スを返します。<parameter>newdir</parameter>を指定せずに + <function>dbplus_chdir</function>をコールすると、カレントのワーキ + ングディレクトリで検索が行われます。 </para> </refsect1> </refentry> @@ -114,18 +380,21 @@ <refentry id="function.dbplus-close"> <refnamediv> <refname>dbplus_close</refname> - <refpurpose>Close a relation</refpurpose> + <refpurpose>関係を閉じる</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_close</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_close</function>をコールすると + <function>dbplus_open</function>でオープンされた関係がクロー + ズされます。 </para> </refsect1> </refentry> @@ -133,885 +402,1150 @@ <refentry id="function.dbplus-curr"> <refnamediv> <refname>dbplus_curr</refname> - <refpurpose>Get current tuple from relation</refpurpose> + <refpurpose>関係からカレントのタプルを取得</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_curr</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>tuple</parameter></paramdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_curr</function>は、指定した + <parameter>relation</parameter>に関してカレントのタプルに関するデー + タを読み込み、連想配列<parameter>tuple</parameter>として返します。 + </para> <para> + この関数は、成功時にゼロ(すなわちDBPLUS_ERR_NOERR)、失敗時にdb++ + エラーコードを返します。db++エラーコードに関する詳細については、 + <function>dbplus_errcode</function>または本章の導入を参照下さい。 + </para> + <para> + <function>dbplus_first</function>, + <function>dbplus_prev</function>, + <function>dbplus_next</function>, + <function>dbplus_last</function>も参照下さい。 </para> </refsect1> </refentry> <refentry id="function.dbplus-errcode"> <refnamediv> - <refname>dbplus_errcode</refname> - <refpurpose>Get error string for given errorcode or last error</refpurpose> + <refname>dbplus_errcode</refname> + <refpurpose> + 指定したエラーコードまたは直近のエラーに関するエラー文字列を取得 + する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dbplus_errcode</function></funcdef> - <paramdef>int <parameter>err</parameter></paramdef> + <paramdef>int <parameter>errno</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_errcode</function>は、 + <parameter>errno</parameter>で指定したエラーコードに関するエラー + 文字列を返します。パラメータが指定されない場合、直近のdb++処理の + 結果コードとなります。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-first"> + <refentry id="function.dbplus-errno"> <refnamediv> - <refname>dbplus_first</refname> - <refpurpose>Get first tuple from relation</refpurpose> + <refname>dbplus_errno</refname> + <refpurpose>直近の操作に関するエラーコードを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_first</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>tuple</parameter></paramdef> + <funcdef>int <function>dbplus_errno</function></funcdef> + <void/> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_errno</function>は、直近のdb++処理で返されたエラー + コードを返します。 </para> + <para> + <function>dbplus_errcode</function>も参照下さい。 + </para> </refsect1> </refentry> - <refentry id="function.dbplus-flush"> + <refentry id="function.dbplus-find"> <refnamediv> - <refname>dbplus_flush</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_find</refname> + <refpurpose>関係に拘束を設定する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_flush</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_find</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>constraints</parameter></paramdef> + <paramdef>mixed <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_find</function>は、指定した関係に拘束を設定しま + す。この後、<function>dbplus_curr</function>または + <function>dbplus_next</function>のような関数をコールすると、指定 + した拘束にマッチするタプルのみが取得されます。 + </para> + <para> + 拘束は、ドメイン名、比較演算子、比較値を含む復号文字列です。 + パラメータ配列<parameter>constraints</parameter>は、文字列の配列で、 + この各要素は、ドメイン、演算子、値を含むか、複数の3要素を有する文 + 字列の配列です。 + </para> <para> + 比較演算子は、以下の文字列のどれかとなります。 + 正規表現による検索には、'==', '&gt;', '&gt;=', '&lt;', '&lt;=', + '!=', '~'、ビット演算には'BAND'または'BOR'を使用します。 + </para> + <para> + <function>dbplus_unselect</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-freealllocks"> + <refentry id="function.dbplus-first"> <refnamediv> - <refname>dbplus_freealllocks</refname> - <refpurpose>Free all locks held by this client</refpurpose> + <refname>dbplus_first</refname> + <refpurpose>関係から最初のタプルを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_freealllocks</function></funcdef> - <void/> + <funcdef>int <function>dbplus_first</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_curr</function>は、指定した + <parameter>relation</parameter>の最初のタプルのデータを読み込み、 + カレントのタプルとします。そして、これを + <parameter>tuple</parameter>に連想配列として代入します。 + </para> <para> + この関数は、成功時にゼロ(つまり、DBPLUS_ERR_NOERR)、エラー時に + db++エラーコードを返します。db++のエラーコードに関する詳細につい + ては、<function>dbplus_errcode</function>または本章の導入を参照下 + さい。 + </para> + <para> + <function>dbplus_curr</function>, + <function>dbplus_prev</function>, + <function>dbplus_next</function>, + <function>dbplus_last</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-freerlocks"> + <refentry id="function.dbplus-flush"> <refnamediv> - <refname>dbplus_freerlocks</refname> - <refpurpose>Free all locks on given relation</refpurpose> + <refname>dbplus_flush</refname> + <refpurpose>関係に行った全ての変更をフラッシュする</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_freerlocks</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_flush</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_flush</function>は、直近にディスクをフラッシュし + てから<parameter>relation</parameter>に行った全ての変更を書き込み + ます。 + </para> <para> + この関数は、成功時にゼロ(つまり、DBPLUS_ERR_NOERR)、エラー時に + db++エラーコードを返します。db++のエラーコードに関する詳細につい + ては、<function>dbplus_errcode</function>または本章の導入を参照下 + さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-info"> + <refentry id="function.dbplus-freealllocks"> <refnamediv> - <refname>dbplus_info</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_freealllocks</refname> + <refpurpose> + このクライアントにより保持された全てのロックを解放する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_info</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>string <parameter>key</parameter></paramdef> - <paramdef>array <parameter></parameter></paramdef> + <funcdef>int <function>dbplus_freealllocks</function></funcdef> + <void/> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_freeaalllocks</function>は、このクライアントによ + りロックされたタプルを全て解放します。 + </para> <para> + <function>dbplus_getlock</function>, + <function>dbplus_freelock</function>, + <function>dbplus_freerlocks</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-last"> + <refentry id="function.dbplus-freelock"> <refnamediv> - <refname>dbplus_last</refname> - <refpurpose>Get last tuple from relation</refpurpose> + <refname>dbplus_freelock</refname> + <refpurpose>タプルの書き込みロックを解放する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_last</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>tuple</parameter></paramdef> + <funcdef>int <function>dbplus_freelock</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>string <parameter>tname</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_freelock</function>は、 + <function>dbplus_getlock</function>より以前に得た指定 + <parameter>tuple</parameter>の書き込みロックを解放します。 + </para> <para> + <function>dbplus_getlock</function>, + <function>dbplus_freerlocks</function>, + <function>dbplus_freealllocks</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-lockrel"> + <refentry id="function.dbplus-freerlocks"> <refnamediv> - <refname>dbplus_lockrel</refname> - <refpurpose>Request read-lock on relation</refpurpose> + <refname>dbplus_freerlocks</refname> + <refpurpose>指定した関係に関する全てのタプルロックを解放する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_lockrel</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_freerlocks</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_freerlocks</function>は、指定した + <parameter>relation</parameter>で保持されている全てのタプルロック + を解放します。 + </para> + <para> + <function>dbplus_getlock</function>, + <function>dbplus_freelock</function>, + <function>dbplus_freealllocks</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-next"> + <refentry id="function.dbplus-getlock"> <refnamediv> - <refname>dbplus_next</refname> - <refpurpose>Get next tuple from relation</refpurpose> + <refname>dbplus_getlock</refname> + <refpurpose>タプルの書き込みロックを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_next</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter></parameter></paramdef> + <funcdef>int <function>dbplus_getlock</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>string <parameter>tname</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_getlock</function>は、指定した + <parameter>tuple</parameter>へ書き込みロックを要求します。この関 + 数は、成功時のゼロ、または、ゼロでないコード、特に失敗時に + DBPLUS_ERR_WLOCKEDを返します。 + </para> + <para> + <function>dbplus_freelock</function>, + <function>dbplus_freerlocks</function>, + <function>dbplus_freealllocks</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-open"> + <refentry id="function.dbplus-getunique"> <refnamediv> - <refname>dbplus_open</refname> - <refpurpose>Open relation file</refpurpose> + <refname>dbplus_getunique</refname> + <refpurpose>あうる関係のユニークなID番号を取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_open</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> + <funcdef>int <function>dbplus_getunique</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>int <parameter>uniqueid</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - The relation file <parameter>name</parameter> will be opened. - <parameter>name</parameter> can be either a file name or a - relative or absolute path name. This will be mapped in any case - to an absolute relation file path on a specific host machine and - server. + <function>dbplus_getunique</function>は、指定した + <parameter>relation</parameter>に関してユニークであることが補償さ + れた数を取得します。この関数は、<parameter>uniqueid</parameter>で + 指定した変数にその数を代入します。 </para> <para> - On success a relation file handle (cursor) is returned which must be used in any subsequent - commanads referencing the relation. + この関数は、成功時にゼロ(つまり、DBPLUS_ERR_NOERR)、エラー時に + db++エラーコードを返します。db++のエラーコードに関する詳細につい + ては、<function>dbplus_errcode</function>または本章の導入を参照下 + さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-prev"> + <refentry id="function.dbplus-info"> <refnamediv> - <refname>dbplus_prev</refname> - <refpurpose>Get previous tuple from relation</refpurpose> + <refname>dbplus_info</refname> + <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_prev</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>tuple</parameter></paramdef> + <funcdef>int <function>dbplus_info</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>string <parameter>key</parameter></paramdef> + <paramdef>array <parameter></parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-restorepos"> + <refentry id="function.dbplus-last"> <refnamediv> - <refname>dbplus_restorepos</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_last</refname> + <refpurpose>関係から直近のタプルを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_restorepos</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>tuple</parameter></paramdef> + <funcdef>int <function>dbplus_last</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_curr</function>は、指定した + <parameter>relation</parameter>に関する直近のタプルに関するデータ + を読み込みます。これをカレントのタプルとし、 + <parameter>tuple</parameter>に連想配列として代入します。 + </para> + <para> + この関数は、成功時にゼロ(つまり、DBPLUS_ERR_NOERR)、エラー時に + db++エラーコードを返します。db++のエラーコードに関する詳細につい + ては、<function>dbplus_errcode</function>または本章の導入を参照下 + さい。 + </para> <para> + <function>dbplus_first</function>, + <function>dbplus_curr</function>, + <function>dbplus_prev</function>, + <function>dbplus_next</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-ropen"> + <refentry id="function.dbplus-lockrel"> <refnamediv> - <refname>dbplus_ropen</refname> - <refpurpose>Open relation file ... ???</refpurpose> + <refname>dbplus_lockrel</refname> + <refpurpose>関係に書き込みロックを要求する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_ropen</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> + <funcdef>int <function>dbplus_lockrel</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_lockrel</function>は、指定した関係について書き込 + みロックを要求します。他のクライアントは、この後も関係にクエリを + 実行可能ですが、ロックされている間は、改変することができません。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-runlink"> + <refentry id="function.dbplus-next"> <refnamediv> - <refname>dbplus_runlink</refname> - <refpurpose>Remove relation from filesystem</refpurpose> + <refname>dbplus_next</refname> + <refpurpose>関係から次のタプルを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_runlink</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_next</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter></parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_curr</function>は、指定した + <parameter>relation</parameter>の次のタプルからデータを読み込み、 + カレントのタプルとし、<parameter>tuple</parameter>に連想配列とし + て返します。 + </para> + <para> + この関数は、成功時にゼロ(つまり、DBPLUS_ERR_NOERR)、エラー時に + db++エラーコードを返します。db++のエラーコードに関する詳細につい + ては、<function>dbplus_errcode</function>または本章の導入を参照下 + さい。 + </para> + <para> + <function>dbplus_first</function>, + <function>dbplus_curr</function>, + <function>dbplus_prev</function>, + <function>dbplus_last</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-rzap"> + <refentry id="function.dbplus-open"> <refnamediv> - <refname>dbplus_rzap</refname> - <refpurpose>Remove all tuples from relation</refpurpose> + <refname>dbplus_open</refname> + <refpurpose>関係ファイルをオープンする</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rzap</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>int <parameter>truncate</parameter></paramdef> + <funcdef>resource <function>dbplus_open</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + 関係ファイル<parameter>name</parameter>がオープンされます。 + <parameter>name</parameter>は、ファイル名または関係、絶対パス名と + します。この関数は、指定したパス名及びサーバ上の絶対関係ファイル + パス名を常にマップします。 + </para> <para> + 成功時に関係ファイルリソース(カーソル)が返されます。これは、この + 関係を参照する以降の全てのコマンドで使用されます。失敗時には、ゼ + ロが返されます。実際のエラーコードは、 + <function>dbplus_errno</function>により取得可能です。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-savepos"> + <refentry id="function.dbplus-prev"> <refnamediv> - <refname>dbplus_savepos</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_prev</refname> + <refpurpose>関係から前のタプルを取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_savepos</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_prev</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_curr</function>は、指定した + <parameter>relation</parameter>から次のタプルのデータを読み込み、 + カレントのタプルとし、<parameter>tuple</parameter>に連想配列とし + て返します。 + </para> + <para> + この関数は、成功時にゼロ(つまり、DBPLUS_ERR_NOERR)、エラー時に + db++エラーコードを返します。db++のエラーコードに関する詳細につい + ては、<function>dbplus_errcode</function>または本章の導入を参照下 + さい。 + </para> <para> + <function>dbplus_first</function>, + <function>dbplus_curr</function>, + <function>dbplus_next</function>, + <function>dbplus_last</function>も参照下さい。 </para> </refsect1> </refentry> - - <refentry id="function.dbplus-setindex"> + + <refentry id="function.dbplus-rchperm"> <refnamediv> - <refname>dbplus_setindex</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_rchperm</refname> + <refpurpose>関係の許可属性を変更する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_setindex</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>string <parameter>idx_name</parameter></paramdef> + <funcdef>int <function>dbplus_rchperm</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>int <parameter>mask</parameter></paramdef> + <paramdef>string <parameter>user</parameter></paramdef> + <paramdef>string <parameter>group</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; - <para> + &warn.experimental.func; + <para> + <function>dbplus_rchperm</function>は、<parameter>mask</parameter>, + <parameter>user</parameter>,<parameter>group</parameter>で指定し + た許可属性に変更します。これらの値はオペレーティングシステムに依 + 存します。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-setindexbynumber"> + <refentry id="function.dbplus-rcreate"> <refnamediv> - <refname>dbplus_setindexbynumber</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_rcreate</refname> + <refpurpose>関係を新規に作成する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_setindexbynumber</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>int <parameter>idx_number</parameter></paramdef> - </funcprototype> - </funcsynopsis> - &warn.experimental.func; - <para> + <funcdef>resource <function>dbplus_rcreate</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + <paramdef>mixed <parameter>domlist</parameter></paramdef> + <paramdef>boolean + <parameter><optional>overwrite</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + &warn.experimental.func; + <para> + <function>dbplus_rcreate</function>は、 + <parameter>name</parameter>という名前の新規関係を作成します。同名 + の既存の関係は、その関係が現在使用されておらず、 + <parameter>overwrite</parameter>にTRUEが設定されている場合にのみ + 上書きされます。 + </para> + <para> + <parameter>domlist</parameter>にはドメインを示す文字列の配列で新 + 規関係のドメインを指定する必要があります。( + <function>dbplus_rcreate</function> は、ドメインを空白で区切った + 文字列も受けつけます。しかし、配列を使用することが推奨されます。) + ドメイン指定文字列は、この関係へのユニークなドメイン名、スラッシュ、 + 型指定文字からなります。利用可能な型指定子及びその意味については、 + db++のドキュメント、特にdbcreate(1)のマニュアルを参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-sql"> + <refentry id="function.dbplus-rcrtexact"> <refnamediv> - <refname>dbplus_sql</refname> - <refpurpose>Perform SQL query</refpurpose> + <refname>dbplus_rcrtexact</refname> + <refpurpose></refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_sql</function></funcdef> - <paramdef>string <parameter>query</parameter></paramdef> - <paramdef>string <parameter>server</parameter></paramdef> - <paramdef>string <parameter>dbpath</parameter></paramdef> + <funcdef>resource <function>dbplus_rcrtexact</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>boolean <parameter>overwrite</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_rcrtexact</function> will create an exact but + empty copy of the given <parameter>relation</parameter> under a + new <parameter>name</parameter>. An existing relation by the same + <parameter>name</parameter> will only be overwritten if + <parameter>overwrite</parameter> is TRUE and no other process is + currently using the relation. </para> </refsect1> </refentry> - <refentry id="function.dbplus-tremove"> + <refentry id="function.dbplus-rcrtlike"> <refnamediv> - <refname>dbplus_tremove</refname> - <refpurpose>Remove tuple and return new current tuple</refpurpose> + <refname>dbplus_rcrtlike</refname> + <refpurpose></refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_tremove</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>old</parameter></paramdef> - <paramdef>array - <parameter><optional>current</optional></parameter> - </paramdef> + <funcdef>resource <function>dbplus_rcrtlike</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>int <parameter>flag</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_rcrtexact</function> will create an empty copy + of the given <parameter>relation</parameter> under a new + <parameter>name</parameter>, but with default indices. An + existing relation by the same <parameter>name</parameter> will + only be overwritten if <parameter>overwrite</parameter> is TRUE + and no other process is currently using the relation. </para> </refsect1> </refentry> - <refentry id="function.dbplus-undo"> + <refentry id="function.dbplus-resolve"> <refnamediv> - <refname>dbplus_undo</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_resolve</refname> + <refpurpose>関係のホスト情報を取得する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_undo</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_resolve</function></funcdef> + <paramdef>string <parameter>relation_name</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_resolve</function> will try to resolve the given + <parameter>relation_name</parameter> and find out internal server + id, real hostname and the database path on this host. The + function will return an array containing these values under the + keys 'sid', 'host' and 'host_path' or &false; on error. + </para> <para> + See also <function>dbplus_tcl</function>. </para> </refsect1> </refentry> - <refentry id="function.dbplus-undoprepare"> + <refentry id="function.dbplus-rkeys"> <refnamediv> - <refname>dbplus_undoprepare</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_rkeys</refname> + <refpurpose>関係の主キーを新規に指定する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_undoprepare</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>resource <function>dbplus_rkeys</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>mixed <parameter>domlist</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; + <para> + <function>dbplus_rkeys</function> will replace the current + primary key for <parameter>relation</parameter> with the + combination of domains specified by <parameter>domlist</parameter>. + </para> <para> + <parameter>domlist</parameter> may be passed as a single domain name + string or as an array of domain names. </para> </refsect1> </refentry> - - <refentry id="function.dbplus-unlockrel"> + + <refentry id="function.dbplus-restorepos"> <refnamediv> - <refname>dbplus_unlockrel</refname> - <refpurpose>Give up read-lock on relation</refpurpose> + <refname>dbplus_restorepos</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_unlockrel</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_restorepos</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-unselect"> + <refentry id="function.dbplus-ropen"> <refnamediv> - <refname>dbplus_unselect</refname> - <refpurpose>???</refpurpose> + <refname>dbplus_ropen</refname> + <refpurpose>関係ファイルをローカルにオープンする</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_unselect</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>resource <function>dbplus_ropen</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_ropen</function> will open the relation + <parameter>file</parameter> locally for quick access without any + client/server overhead. Access is read only and only + <function>dbplus_current</function> and + <function>dbplus_next</function> may be applied to the returned + relation. </para> </refsect1> </refentry> - <refentry id="function.dbplus-update"> + <refentry id="function.dbplus-rquery"> <refnamediv> - <refname>dbplus_update</refname> - <refpurpose>Update specified tuple in relation</refpurpose> + <refname>dbplus_rquery</refname> + <refpurpose>ローカルに(raw) AQLクエリを実行する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_update</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> - <paramdef>array <parameter>old</parameter></paramdef> - <paramdef>array <parameter>new</parameter></paramdef> + <funcdef>int <function>dbplus_rquery</function></funcdef> + <paramdef>string <parameter>query</parameter></paramdef> + <paramdef>string <parameter>dbpath</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_rquery</function> performs a local (raw) AQL + query using an AQL interpreter embedded into the db++ client + library. <function>dbplus_rquery</function> is faster than + <function>dbplus_aql</function> but will work on local data only. </para> </refsect1> </refentry> - <refentry id="function.dbplus-xlockrel"> + <refentry id="function.dbplus-rrename"> <refnamediv> - <refname>dbplus_xlockrel</refname> - <refpurpose>Request exclusive write lock on relation</refpurpose> + <refname>dbplus_rrename</refname> + <refpurpose>関係の名前を変更する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_xlockrel</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>int <function>dbplus_rrename</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_rrename</function> will change the name of + <parameter>relation</parameter> to <parameter>name</parameter>. </para> </refsect1> </refentry> - <refentry id="function.dbplus-xunlockrel"> + <refentry id="function.dbplus-rsecindex"> <refnamediv> - <refname>dbplus_xunlockrel</refname> - <refpurpose>Free exclusive write lock on relation</refpurpose> + <refname>dbplus_rsecindex</refname> + <refpurpose> + 関係に新規セカンダリインデックスを作成する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_xunlockrel</function></funcdef> - <paramdef>int <parameter>relation</parameter></paramdef> + <funcdef>resource <function>dbplus_rsecindex</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>mixed <parameter>domlist</parameter></paramdef> + <paramdef>int <parameter>type</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_rsecindex</function> will create a new secondary + index for <parameter>relation</parameter> with consists of the + domains specified by <parameter>domlist</parameter> and is of + type <parameter>type</parameter> + </para> + <para> + <parameter>domlist</parameter> may be passed as a single domain name + string or as an array of domain names. </para> </refsect1> </refentry> - -<!-- unimplemented functions --> - - - <refentry id="function.dbplus-change"> + <refentry id="function.dbplus-runlink"> <refnamediv> - <refname>dbplus_change</refname> - <refpurpose></refpurpose> + <refname>dbplus_runlink</refname> + <refpurpose>ファイルシステムから関係を削除する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_change</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>domain</parameter></paramdef> + <funcdef>int <function>dbplus_runlink</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + <function>dbplus_unlink</function>は、 + <parameter>relation</parameter>を閉じ、削除します。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-find"> + <refentry id="function.dbplus-rzap"> <refnamediv> - <refname>dbplus_find</refname> - <refpurpose></refpurpose> + <refname>dbplus_rzap</refname> + <refpurpose>関係から全てのタプルを削除する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_find</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>constr</parameter></paramdef> - <paramdef>string <parameter>tname</parameter></paramdef> + <funcdef>int <function>dbplus_rzap</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + <function>dbplus_rzap</function>は、 + <parameter>relation</parameter>からタプルを全て削除します。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-freelock"> + <refentry id="function.dbplus-savepos"> <refnamediv> - <refname>dbplus_freelock</refname> - <refpurpose></refpurpose> + <refname>dbplus_savepos</refname> + <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_freelock</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>tname</parameter></paramdef> + <funcdef>int <function>dbplus_savepos</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-getlock"> + <refentry id="function.dbplus-setindex"> <refnamediv> - <refname>dbplus_getlock</refname> - <refpurpose></refpurpose> + <refname>dbplus_setindex</refname> + <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_getlock</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>tname</parameter></paramdef> + <funcdef>int <function>dbplus_setindex</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>string <parameter>idx_name</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-getunique"> + <refentry id="function.dbplus-setindexbynumber"> <refnamediv> - <refname>dbplus_getunique</refname> - <refpurpose></refpurpose> + <refname>dbplus_setindexbynumber</refname> + <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_getunique</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>varname</parameter></paramdef> - <paramdef>int <parameter>flush</parameter></paramdef> + <funcdef>int + <function>dbplus_setindexbynumber</function> + </funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>int <parameter>idx_number</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> - - <refentry id="function.dbplus-rchperm"> + + <refentry id="function.dbplus-sql"> <refnamediv> - <refname>dbplus_rchperm</refname> - <refpurpose></refpurpose> + <refname>dbplus_sql</refname> + <refpurpose>SQLクエリを実行する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rchperm</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>int <parameter>mask</parameter></paramdef> - <paramdef>string <parameter>user</parameter></paramdef> - <paramdef>string <parameter>group</parameter></paramdef> + <funcdef>resource <function>dbplus_sql</function></funcdef> + <paramdef>string <parameter>query</parameter></paramdef> + <paramdef>string <parameter>server</parameter></paramdef> + <paramdef>string <parameter>dbpath</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-rcreate"> + <refentry id="function.dbplus-tcl"> <refnamediv> - <refname>dbplus_rcreate</refname> - <refpurpose></refpurpose> + <refname>dbplus_tcl</refname> + <refpurpose>サーバ側でTCLコードを実行する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rcreate</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> - <paramdef>string <parameter>domlist</parameter></paramdef> - <paramdef>int <parameter>flag</parameter></paramdef> + <funcdef>int <function>dbplus_tcl</function></funcdef> + <paramdef>int <parameter>sid</parameter></paramdef> + <paramdef>string <parameter>script</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + db++サーバは、各クライアント接続についてTCLインタプリタを準備しま + す。このインタプリタは、ある種のストアドプロシージャとしてクライ + アントに指定されたTCLコードをサーバで実行するもので、 + クライアント/サーバ間のデータ伝送及びコンテキスト切替を回避し、 + データベース処理性能を改善するために使用されます。 + </para> + <para> + <function>dbplus_tcl</function>は、TCL + <parameter>script</parameter>コードが実行される、クライアント接続 + IDを必要とします。<function>dbplus_resolve</function>が、この接続 + IDを返します。この関数は、TCLコードの返り値またはTCLコードが失敗 + した場合には、TCLエラーメッセージを返します。 + </para> + <para> + <function>dbplus_resolve</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-rcrtexact"> + <refentry id="function.dbplus-tremove"> <refnamediv> - <refname>dbplus_rcrtexact</refname> - <refpurpose></refpurpose> + <refname>dbplus_tremove</refname> + <refpurpose>タプルを削除し、新規カレントタプルを返す</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rcrtexact</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>int <parameter>flag</parameter></paramdef> + <funcdef>int <function>dbplus_tremove</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>tuple</parameter></paramdef> + <paramdef>array + <parameter><optional>current</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + <function>dbplus_tremove</function>は、関係の中のタプルに完全に一 + 致する場合、<parameter>tuple</parameter>を削除します。 + <parameter>current</parameter>が指定された場合、 + <function>dbplus_tremove</function>をコールした後、新規のカレント + のタプルのデータが代入されます。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-rcrtlike"> + <refentry id="function.dbplus-undo"> <refnamediv> - <refname>dbplus_rcrtlike</refname> - <refpurpose></refpurpose> + <refname>dbplus_undo</refname> + <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rcrtlike</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>int <parameter>flag</parameter></paramdef> + <funcdef>int <function>dbplus_undo</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-resolve"> + <refentry id="function.dbplus-undoprepare"> <refnamediv> - <refname>dbplus_resolve</refname> - <refpurpose></refpurpose> + <refname>dbplus_undoprepare</refname> + <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_resolve</function></funcdef> - <paramdef>string <parameter>name</parameter></paramdef> - <paramdef>string <parameter>vname</parameter></paramdef> + <funcdef>int <function>dbplus_undoprepare</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> - <refentry id="function.dbplus-rkeys"> + <refentry id="function.dbplus-unlockrel"> <refnamediv> - <refname>dbplus_rkeys</refname> - <refpurpose></refpurpose> + <refname>dbplus_unlockrel</refname> + <refpurpose>関係の書き込みロックを中断する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rkeys</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>domlist</parameter></paramdef> + <funcdef>int <function>dbplus_unlockrel</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + <function>dbplus_unlockrel</function>は、以前 + <function>dbplus_lockrel</function>により得られた書き込みロックを + 解放します。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-rquery"> + <refentry id="function.dbplus-unselect"> <refnamediv> - <refname>dbplus_rquery</refname> - <refpurpose></refpurpose> + <refname>dbplus_unselect</refname> + <refpurpose>関係から制約を削除する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rquery</function></funcdef> - <void/> + <funcdef>int <function>dbplus_unselect</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> + <function>dbplus_unselect</function>をコールすると、 + <function>dbplus_find</function>により + <parameter>relation</parameter>に設定された制約が削除されます。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-rrename"> + <refentry id="function.dbplus-update"> <refnamediv> - <refname>dbplus_rrename</refname> - <refpurpose></refpurpose> + <refname>dbplus_update</refname> + <refpurpose>関係の指定したタプルを更新する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rrename</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>name</parameter></paramdef> - <paramdef>int <parameter>flag</parameter></paramdef> + <funcdef>int <function>dbplus_update</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> + <paramdef>array <parameter>old</parameter></paramdef> + <paramdef>array <parameter>new</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; - <para> - Not implemented yet. + &warn.experimental.func; + <para> + <function>dbplus_update</function>は、<parameter>old</parameter> + で指定したタプル<parameter>new</parameter>からのデータで置換ちま + す。置換が行われるのは、<parameter>old</parameter>が + <parameter>relation</parameter>の中のタプルに完全に一致する場合の + みです。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-rsecindex"> + <refentry id="function.dbplus-xlockrel"> <refnamediv> - <refname>dbplus_rsecindex</refname> - <refpurpose></refpurpose> + <refname>dbplus_xlockrel</refname> + <refpurpose>関係の排他的ロックを要求する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_rsecindex</function></funcdef> - <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>domlist</parameter></paramdef> - <paramdef>int <parameter>compact</parameter></paramdef> + <funcdef>int <function>dbplus_xlockrel</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + <function>dbplus_xlockrel</function>は、 + <parameter>relation</parameter>に他のクライアントからの読み込みア + クセスさえ拒否する排他的ロックを要求します。 + </para> + <para> + <function>dbplus_xunlockrel</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.dbplus-tcl"> + <refentry id="function.dbplus-xunlockrel"> <refnamediv> - <refname>dbplus_tcl</refname> - <refpurpose></refpurpose> + <refname>dbplus_xunlockrel</refname> + <refpurpose>関係の排他的ロックを解放する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbplus_tcl</function></funcdef> - <paramdef>int <parameter>sid</parameter></paramdef> - <paramdef>string <parameter>script</parameter></paramdef> + <funcdef>int <function>dbplus_xunlockrel</function></funcdef> + <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> - Not implemented yet. + <function>dbplus_xunlockrel</function>は、以前 + <function>dbplus_xlockrel</function>により取得された + <parameter>relation</parameter>の排他的ロックを解放します。 </para> </refsect1> </refentry> Index: phpdoc/ja/functions/dbx.xml diff -u phpdoc/ja/functions/dbx.xml:1.9 phpdoc/ja/functions/dbx.xml:1.10 --- phpdoc/ja/functions/dbx.xml:1.9 Wed Dec 12 15:52:52 2001 +++ phpdoc/ja/functions/dbx.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.dbx"> <title>dbx 関数</title> <titleabbrev>dbx</titleabbrev> @@ -43,20 +44,21 @@ </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental; + &warn.experimental; <para> - 成功時に&true;、エラーの際に - &false;を返します。 + 成功時に&true;、エラーの際に&false;を返します。 </para> <example> <title><function>dbx_close</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = dbx_connect ("mysql", "localhost", "db", "username", "password") or die ("Could not connect"); print("Connected successfully"); dbx_close($link); -?&gt; +?> +]]> </programlisting> </example> <note> @@ -90,7 +92,7 @@ </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental; + &warn.experimental; <para> 返り値: 成功時にdbx_link_object、エラー時に &false;。接続が確立されたが、データベースが選択 @@ -143,10 +145,12 @@ <para> <informalexample> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = dbx_connect ("mysql", "localhost", "db", "username", "password"); mysql_close ($link->handle); // dbx_close($link) の方が良いかもしれません -?&gt; +?> +]]> </programlisting> </informalexample> </para> @@ -158,12 +162,14 @@ <example> <title><function>dbx_connect</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = dbx_connect ("odbc", "", "db", "username", "password", DBX_PERSISTENT) - or die ("接続できません"); -print ("接続に成功しました"); + or die ("Could not connect"); +print ("Connected successfully"); dbx_close ($link); -?&gt; +?> +]]> </programlisting> </example> <note> @@ -195,7 +201,7 @@ </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental; + &warn.experimental; <para> モジュール(例えば mysql-module)の直近の関数コールからエラーメッセー ジを有する文字列を返します。同じモジュールに複数の接続がある場合、 @@ -207,15 +213,17 @@ <example> <title><function>dbx_error</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = dbx_connect ("mysql", "localhost", "db", "username", "password") - or die ("接続できません"); + or die ("Could not connect"); $result = dbx_query ($link, "select id from nonexistingtbl"); if ($result==0) { echo dbx_error ($link); } dbx_close ($link); -?&gt; +?> +]]> </programlisting> </example> <note> @@ -285,8 +293,10 @@ <para> <informalexample role="php"> <programlisting> +<![CDATA[ $result = dbx_query ($link, "SELECT id FROM tbl"); mysql_field_len ($result->handle, 0); +]]> </programlisting> </informalexample> </para> @@ -297,8 +307,10 @@ <para> <informalexample> <programlisting role="php"> +<![CDATA[ $result = dbx_query ($link, "SELECT id FROM tbl"); -echo "結果のサイズ: " . $result->rows . " x " . $result->cols . "&lt;br>\n"; +echo "result size: " . $result->rows . " x " . $result->cols . "<br>\n"; +]]> </programlisting> </informalexample> </para> @@ -311,9 +323,11 @@ <para> <informalexample> <programlisting role="php"> +<![CDATA[ $result = dbx_query ($link, "SELECT id FROM tbl"); -echo "カラム名: " . $result->info["name"][0] . "&lt;br>\n"; -echo "カラム型: " . $result->info["type"][0] . "&lt;br>\n"; +echo "column name: " . $result->info["name"][0] . "<br>\n"; +echo "column type: " . $result->info["type"][0] . "<br>\n"; +]]> </programlisting> </informalexample> </para> @@ -326,42 +340,44 @@ <example> <title><function>dbx_query</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = dbx_connect ("odbc", "", "db", "username", "password") - or die ("接続できません"); + or die ("Could not connect"); $result = dbx_query ($link, "SELECT id, parentid, description FROM tbl"); -if ($result==0) echo "クエリに失敗しました\n&lt;br>"; +if ($result==0) echo "Query failed\n<br>"; elseif ($result==1) { - echo "クエリの実行に成功しました\n&lt;br>"; + echo "Query executed successfully\n<br>"; } else { $rows=$result->rows; $cols=$result->cols; - echo "&lt;p>テーブル次元: {$result->rows} x {$result->cols}&lt;br>&lt;table border=1>\n"; - echo "&lt;tr>"; - for ($col=0; $col&lt;$cols; ++$col) { - echo "&lt;td>-{$result->info["name"][$col]}-&lt;br>-{$result->info["type"][$col]}-&lt;/td>"; + echo "<p>table dimension: {$result->rows} x {$result->cols}<br><table border=1>\n"; + echo "<tr>"; + for ($col=0; $col<$cols; ++$col) { + echo "<td>-{$result->info["name"][$col]}-<br>-{$result->info["type"][$col]}-</td>"; } - echo "&lt;/tr>\n"; - for ($row=0; $row&lt;$rows; ++$row){ - echo "&lt;tr>"; - for ($col=0; $col&lt;$cols; ++$col) { - echo "&lt;td>-{$result->data[$row][$col]}-&lt;/td>"; + echo "</tr>\n"; + for ($row=0; $row<$rows; ++$row){ + echo "<tr>"; + for ($col=0; $col<$cols; ++$col) { + echo "<td>-{$result->data[$row][$col]}-</td>"; } - echo "&lt;/tr>\n"; + echo "</tr>\n"; } - echo "&lt;/table>&lt;p>\n"; - echo "テーブル次元: {$result->rows} x id, parentid, description&lt;br>&lt;table border=1>\n"; - for ($row=0; $row&lt;$rows; ++$row) { - echo "&lt;tr>"; - echo "&lt;td>-{$result->data[$row]["id"]}-&lt;/td>"; - echo "&lt;td>-{$result->data[$row]["parentid"]}-&lt;/td>"; - echo "&lt;td>-{$result->data[$row]["description"]}-&lt;/td>"; - echo "&lt;/tr>\n"; + echo "</table><p>\n"; + echo "table dimension: {$result->rows} x id, parentid, description<br><table border=1>\n"; + for ($row=0; $row<$rows; ++$row) { + echo "<tr>"; + echo "<td>-{$result->data[$row]["id"]}-</td>"; + echo "<td>-{$result->data[$row]["parentid"]}-</td>"; + echo "<td>-{$result->data[$row]["description"]}-</td>"; + echo "</tr>\n"; } - echo "&lt;/table>&lt;p>\n"; + echo "</table><p>\n"; } dbx_close($link); -?&gt; +?> +]]> </programlisting> </example> <note> @@ -395,13 +411,13 @@ </funcsynopsis> &warn.experimental; <para> - 成功時に&true;、エラー時に - &false;を返します。 + 成功時に&true;、エラー時に&false;を返します。 </para> <example> <title><function>dbx_sort</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php function user_re_order ($a, $b) { $rv = dbx_cmp_desc ($a, $b, "parentid"); if (!$rv) $rv = dbx_cmp_asc ($a, $b, "id"); @@ -411,16 +427,16 @@ $link = dbx_connect ("odbc", "", "db", "username", "password") or die ("接続できません"); $result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id"); -echo "結果は、idでソートされています&lt;br>"; +echo "結果は、idでソートされています<br>"; dbx_sort ($result, "user_re_order"); -echo "結果はparentidで(降順に)ソートされ、続いて、idでソートされます&lt;br>"; +echo "結果はparentidで(降順に)ソートされ、続いて、idでソートされます<br>"; dbx_close ($link); -?&gt; +?> +]]> </programlisting> </example> <para> - <function>dbx_cmp_asc</function> および - <function>dbx_cmp_desc</function> も参照下さい。 + <function>dbx_compare</function>も参照下さい。 </para> </refsect1> </refentry> @@ -485,55 +501,68 @@ </refsect1> </refentry> - <refentry id="function.dbx-cmp-desc"> + <refentry id="function.dbx-compare"> <refnamediv> - <refname>dbx_cmp_desc</refname> + <refname>dbx_compare</refname> <refpurpose> - 降順にソートするために二つのレコードを比較する + ソートするために二つのレコードを比較する </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>dbx_cmp_desc</function></funcdef> + <funcdef>int <function>dbx_compare</function></funcdef> <paramdef>array <parameter>row_a</parameter></paramdef> <paramdef>array <parameter>row_b</parameter></paramdef> - <paramdef>string - <parameter>columnname_or_index</parameter> + <paramdef>string + <parameter>columnname_or_index</parameter></paramdef> + <paramdef>int + <parameter><optional>flags</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental; + &warn.experimental; <para> row_a[$columnname_or_index] が row_b[$columnname_or_index] に等し い場合に 0、より大きい場合に-1、より小さい場合に1を返します。 + (DBX_CMP_DESCフラグが指定されている場合には逆となります) + </para> + <para> + <parameter>flags</parameter>により比較の方向(昇順または降順のソー + トのどちらか)と比較の型(データ変換により強制的に文字列または数値 + として比較する)を設定することが可能です。比較用定数は、 + DBX_CMP_ASC及びDBX_CMP_DESCです。比較用定数は、DBX_CMP_NATIVE(比 + 較無し)、DBX_CMP_TEXT、DBX_CMP_NUMBERです。これらの定数は、論理和 + をとることができます。<parameter>flags</parameter>パラメータのデ + フォルト値は、DBX_CMP_ASC | DBX_CMP_NATIVEです。 </para> <example> - <title><function>dbx_cmp_desc</function>の例</title> + <title><function>dbx_compare</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php function user_re_order ($a, $b) { - $rv = dbx_cmp_asc ($a, $b, "parentid"); - if (!$rv) { - $rv = dbx_cmp_asc($a, $b, "id"); + $rv = dbx_compare ($a, $b, "parentid", DBX_CMP_DESC); + if (!$rv) { + $rv = dbx_compare ($a, $b, "id"); return $rv; } } $link = dbx_connect ("odbc", "", "db", "username", "password") - or die ("接続できません"); + or die ("Could not connect"); $result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id"); -echo "結果はidでソートされました&lt;br>"; -dbx_query ($result, "user_re_order"); -echo "結果はparentidそしてidでソートされました&lt;br>"; +echo "resulting data is now ordered by id<br>"; +dbx_sort ($result, "user_re_order"); +echo "resulting data is now ordered by parentid (descending), then by id<br>"; dbx_close ($link); -?&gt; +?> +]]> </programlisting> </example> <para> - <function>dbx_sort</function>および - <function>dbx_cmp_asc</function>も参照下さい。 + <function>dbx_sort</function>も参照下さい。 </para> </refsect1> </refentry> Index: phpdoc/ja/functions/dir.xml diff -u phpdoc/ja/functions/dir.xml:1.11 phpdoc/ja/functions/dir.xml:1.12 --- phpdoc/ja/functions/dir.xml:1.11 Wed Dec 12 15:52:52 2001 +++ phpdoc/ja/functions/dir.xml Sat Jan 19 09:58:31 2002 @@ -1,9 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> - +<!-- $Revision: 1.12 $ --> <reference id="ref.dir"> <title>ディレクトリ関数</title> <titleabbrev>ディレクトリ</titleabbrev> + <partintro> + <simpara> + <function>dirname</function>, <function>is_dir</function>, + <function>mkdir</function>, <function>rmdir</function>のような関係 + については、<link linkend="ref.filesystem">ファイルシステム</link> + の節を参照下さい。 + </simpara> + </partintro> + <refentry id="function.chroot"> <refnamediv> <refname>chroot</refname> @@ -42,19 +51,18 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>chdir</function></funcdef> + <funcdef>bool <function>chdir</function></funcdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - PHP のカレント・ディレクトリを <parameter>directory</parameter> - に変更します。ディレクトリを変更できなかった場合は &false; を - 返し、そうでなければ &true; を返します。 + PHPのカレント・ディレクトリを<parameter>directory</parameter>に変 + 更します。ディレクトリを変更できなかった場合は&false;を返し、そう + でなければ&true;を返します。 </para> </refsect1> </refentry> - <refentry id="class.dir"> <refnamediv> <refname>dir</refname> @@ -64,36 +72,44 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>new <function>dir</function></funcdef> + <funcdef>object <function>dir</function></funcdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - ディレクトリを読むための疑似オブジェクト指向の機構です。 - 指定した <parameter>directory</parameter> がオープンされます。 - いったんディレクトリがオープンされると、2 つのプロパティを使用 - できるようになります。handle プロパティは、<function>readdir - </function>, <function>rewinddir</function>, <function> - closedir</function> のような他のディレクトリ関数と組み合わせて - 使用可能です。path プロパティには、オープンするディレクトリのパス - をセットします。read, rewind, close の3種類のメソッドが - 使用できます。 - <example><title><function>dir</function> の例</title> -<programlisting role="php"> + ディレクトリを読むための疑似オブジェクト指向の機構です。 + 指定した <parameter>directory</parameter> がオープンされます。 + いったんディレクトリがオープンされると、2 つのプロパティを使用 + できるようになります。handle プロパティは、<function>readdir + </function>, <function>rewinddir</function>, <function> + closedir</function> のような他のディレクトリ関数と組み合わせて + 使用可能です。path プロパティには、オープンするディレクトリのパス + をセットします。read, rewind, close の3種類のメソッドが + 使用できます。 + <example> + <title><function>dir</function> の例</title> + <programlisting role="php"> +<![CDATA[ $d = dir("/etc"); -echo "Handle: ".$d->handle."&lt;br>\n"; -echo "Path: ".$d->path."&lt;br>\n"; -while($entry=$d->read()) { - echo $entry."&lt;br>\n"; +echo "Handle: ".$d->handle."<br>\n"; +echo "Path: ".$d->path."<br>\n"; +while (false !== ($entry = $d->read())) { + echo $entry."<br>\n"; } $d->close(); +]]> </programlisting> </example> </para> + <note> + <para> + 読み込みにより返されるディレクトリエントリの順番は、システムに依 + 存します。 + </para> + </note> </refsect1> </refentry> - <refentry id="function.closedir"> <refnamediv> <refname>closedir</refname> @@ -104,13 +120,14 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>closedir</function></funcdef> - <paramdef>int <parameter>dir_handle</parameter></paramdef> + <paramdef>resource <parameter>dir_handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <parameter>dir_handle</parameter> で指定したディレクトリの - ストリームをクローズします。このストリームは、<function>opendir - </function>により事前にオープンされていなければなりません。 + <parameter>dir_handle</parameter> で指定したディレクトリのストリー + ムをクローズします。このストリームは、 + <function>opendir</function>により事前にオープンされていなければ + なりません。 </para> </refsect1> </refentry> @@ -143,36 +160,38 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>opendir</function></funcdef> + <funcdef>resource <function>opendir</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - ディレクトリ・ハンドルをオープンします。この関数は、この後、 - <function>closedir</function>, <function>readdir</function>, - <function>rewinddir</function> 関数コールで使用されます。 + ディレクトリ・ハンドルをオープンします。この関数は、この後、 + <function>closedir</function>, <function>readdir</function>, + <function>rewinddir</function> 関数コールで使用されます。 </para> <para> <parameter>path</parameter> が有効なディレクトリでないかまたは権 限が制限されているかファイルシステムのエラーによりディレクトリが - オープンできない場合、<function>opendir</function> は &false; を返 - し、PHPエラーを生成します。<function>opendir</function>のこのエラー - 出力は、関数名の前に `@' を付けることにより抑制できます。 + オープンできない場合、<function>opendir</function>は&false;を返し、 + PHPエラーを生成します。<function>opendir</function>のこのエラー出 + 力は、関数名の前に `@' を付けることにより抑制できます。 </para> <para> <example> <title><function>opendir</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php if ($dir = @opendir("/tmp")) { - while($file = readdir($dir)) { + while (($file = readdir($dir)) !== false) { echo "$file\n"; } closedir($dir); } -?&gt; +?> +]]> </programlisting> </example> </para> @@ -189,24 +208,27 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>readdir</function></funcdef> - <paramdef>int <parameter>dir_handle</parameter></paramdef> + <paramdef>resource <parameter>dir_handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - ディレクトリから次のファイルのファイル名を返します。ファイル名は - 特定の順序で返されるわけではありません。 + ディレクトリから次のファイルのファイル名を返します。ファイル名は + 特定の順序で返されるわけではありません。 <example> <title>カレントディレクトリにある全ファイルのリスト</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +// Note that !== did not exist until 4.0.0-RC2 +<?php $handle=opendir('.'); echo "Directory handle: $handle\n"; echo "Files:\n"; -while (($file = readdir($handle))!==false) { +while (false !== ($file = readdir($handle))) { echo "$file\n"; } closedir($handle); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -218,22 +240,23 @@ 現在のディレクトリの . および .. を除いた全てのファイルの一覧を表示。 </title> <programlisting role="php"> -&lt;?php -$handle=opendir('.'); -while (false!==($file = readdir($handle))) { - if ($file != "." &amp;&amp; $file != "..") { +<![CDATA[ +<?php +$handle = opendir('.'); +while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { echo "$file\n"; } } closedir($handle); -?&gt; +?> +]]> </programlisting> </example> </para> </refsect1> </refentry> - <refentry id="function.rewinddir"> <refnamediv> <refname>rewinddir</refname> @@ -244,17 +267,16 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>rewinddir</function></funcdef> - <paramdef>int <parameter>dir_handle</parameter></paramdef> + <paramdef>resource <parameter>dir_handle</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> + <para> <parameter>dir_handle</parameter> で指定されたディレクトリの ストリームをディレクトリの先頭にリセットします。 - </para> + </para> </refsect1> </refentry> - </reference> <!-- Keep this comment at the end of the file @@ -273,4 +295,7 @@ 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 --> Index: phpdoc/ja/functions/domxml.xml diff -u phpdoc/ja/functions/domxml.xml:1.13 phpdoc/ja/functions/domxml.xml:1.14 --- phpdoc/ja/functions/domxml.xml:1.13 Wed Dec 12 15:52:53 2001 +++ phpdoc/ja/functions/domxml.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.14 $ --> <reference id="ref.domxml"> <title>DOM XML関数</title> <titleabbrev>DOM XML</titleabbrev> @@ -116,8 +117,7 @@ オブジェクト指向的な方法としては関数をオブジェクトのメソッドとして コールする方法があります。本ドキュメントは、オブジェクト指向的でな い関数を説明しますが、接頭辞 "domxml_" を省略することによりオブジェ - クト指向的メソッドを使用することが可能です。以下のテーブルに全ての - クラス、その属性とメソッドを示します。 + クト指向的メソッドを使用することが可能です。 </simpara> <simpara> 本モジュールは、以下のテーブルに示す &mdash;プロパティおよびメソッ @@ -423,6 +423,7 @@ <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> この関数は、<parameter>str</parameter>のXMLドキュメントを処理し、 クラス"Dom document"のオブジェクトを返します。このオブジェクトは @@ -447,6 +448,7 @@ <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> この関数は、<parameter>filename</parameter>という名前のXMLドキュ メントを解釈し、クラス"Dom document"のオブジェクトを返します。 @@ -475,6 +477,7 @@ <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> この関数は、<parameter>str</parameter>のXMLドキュメントをパースし、 パース済のドキュメントとしてPHPオブジェクトのツリーを返します。他 @@ -502,11 +505,11 @@ <paramdef>object <parameter>doc</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> <function>domxml_root</function> は引数としてクラスのオブジェクト - "Dom document"をとり、ルート要素ノードを返します。 - 現在、コメントのような他のノードは無視されます。 + "Dom document"をとり、ルート要素ノードを返します。現在、コメント + のような他のノードは無視されます。 </para> <para> 以下の例は、名前 CHAPTER で要素を有する要素だけを返し、これを出力 @@ -514,38 +517,40 @@ <example> <title>ルート要素を取得する</title> <programlisting role="php"> -&lt;?php -$xmlstr = "&lt;?xml version='1.0' standalone='yes'?&gt; -&lt;!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd' -[ &lt;!ENTITY sp \"spanish\"> +<![CDATA[ +<?php +$xmlstr = "<?xml version='1.0' standalone='yes'?> +<!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd' +[ <!ENTITY sp \"spanish\"> ]> -&lt;!-- lsfj --&gt; -&lt;chapter language='en'>&lt;title language='en'>Title&lt;/title> - &lt;para language='ge'> +<!-- lsfj --> +<chapter language='en'><title language='en'>Title</title> + <para language='ge'> &amp;sp; - &lt;!-- comment --&gt; - &lt;informaltable language='&amp;sp;'> - &lt;tgroup cols='3'> - &lt;tbody> - &lt;row>&lt;entry>a1&lt;/entry>&lt;entry -morerows='1'>b1&lt;/entry>&lt;entry>c1&lt;/entry>&lt;/row> -&lt;row>&lt;entry>a2&lt;/entry>&lt;entry>c2&lt;/entry>&lt;/row> - &lt;row>&lt;entry>a3&lt;/entry>&lt;entry>b3&lt;/entry>&lt;entry>c3&lt;/entry>&lt;/row> - &lt;/tbody> - &lt;/tgroup> - &lt;/informaltable> - &lt;/para> -&lt;/chapter>"; + <!-- comment --> + <informaltable language='&amp;sp;'> + <tgroup cols='3'> + <tbody> + <row><entry>a1</entry><entry +morerows='1'>b1</entry><entry>c1</entry></row> +<row><entry>a2</entry><entry>c2</entry></row> + <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> + </tbody> + </tgroup> + </informaltable> + </para> +</chapter>"; if(!$dom = xmldoc($xmlstr)) { echo "Error while parsing the document\n"; exit; } -$root = $dom-&gt;root(); -/* または $root = domxml_root($dom); */ +$root = $dom->root(); +/* or $root = domxml_root($dom); */ print_r($root); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -568,6 +573,7 @@ <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> DOMドキュメントにルート要素ノードを追加し、新規ノードを返します。 要素名は、2番目の引数として指定します。 @@ -576,13 +582,15 @@ <example> <title>簡単なHTMLドキュメントヘッダを作成する</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $doc = new_xmldoc("1.0"); $root = $doc->add_root("HTML"); $head = $root->new_child("HEAD", ""); $head->new_child("TITLE", "Hier der Titel"); echo $doc->dumpmem(); ?> +]]> </programlisting> </example> </para> @@ -604,6 +612,7 @@ <paramdef>resource <parameter>doc</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> DOM表現からXMLドキュメントを作成します。この関数は、通常、 <function>domxml_add_root</function> の例のように最初から新規に @@ -630,6 +639,7 @@ <paramdef>resource <parameter>node</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> "dom attribute"型のオブジェクトの配列としてノードの全ての属性を返 します。 @@ -648,12 +658,12 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>object - <function>domxml_get_attribute</function></funcdef> + <funcdef>object <function>domxml_get_attribute</function></funcdef> <paramdef>resource <parameter>node</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> この関数は、指定した名前<parameter>name</parameter>の値を返します。 </para> @@ -680,6 +690,7 @@ <paramdef>string <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> 指定したノードの名前 <parameter>name</parameter> を有する属性に値 を設定します。 @@ -691,14 +702,16 @@ <example> <title>要素に属性を追加する</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $doc = new_xmldoc("1.0"); -$root = $doc-&gt;add_root("HTML"); -$head = $root-&gt;new_child("HEAD", ""); -$head-&gt;new_child("TITLE", "Hier der Titel"); -$head-&gt;set_attribute("Language", "ge"); -echo $doc-&gt;dumpmem(); -?&gt; +$root = $doc->add_root("HTML"); +$head = $root->new_child("HEAD", ""); +$head->new_child("TITLE", "Hier der Titel"); +$head->set_attribute("Language", "ge"); +echo $doc->dumpmem(); +?> +]]> </programlisting> </example> </para> @@ -720,6 +733,7 @@ <paramdef>object <parameter>doc|node</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> ノードの配列としてノードの全ての子ノードを返します。 </para> @@ -730,14 +744,16 @@ <example> <title>要素に属性を追加する</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $doc = new_xmldoc("1.0"); -$root = $doc-&gt;add_root("HTML"); -$head = $root-&gt;new_child("HEAD", ""); -$head-&gt;new_child("TITLE", "Hier der Titel"); -$head-&gt;set_attribute("Language", "ge"); -$children = $head-&gt;children() -?&gt; +$root = $doc->add_root("HTML"); +$head = $root->new_child("HEAD", ""); +$head->new_child("TITLE", "Hier der Titel"); +$head->set_attribute("Language", "ge"); +$children = $head->children(); +?> +]]> </programlisting> </example> </para> @@ -760,6 +776,7 @@ <paramdef>string <parameter>content</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> ノードに新規に子ノードを追加し、返します。 </para> @@ -781,6 +798,7 @@ <paramdef>string <parameter>version</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> 最初から新規DOMドキュメントを作成し、返します。 </para> @@ -805,6 +823,7 @@ <paramdef>object <parameter>dom document</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> </para> <para> @@ -828,10 +847,160 @@ <paramdef>object <parameter>xpath context</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> </para> <para> See also <function></function> + </para> + </refsect1> + </refentry> + + <refentry id='function.domxml-node'> + <refnamediv> + <refname>domxml_node</refname> + <refpurpose>ノードを作成する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_node</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.domxml-node-set-content'> + <refnamediv> + <refname>domxml_node_set_content</refname> + <refpurpose>ノードの内容を設定する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>domxml_node_set_content</function></funcdef> + <paramdef>string <parameter>content</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.domxml-node-unlink-node'> + <refnamediv> + <refname>domxml_node_unlink_node</refname> + <refpurpose>ノードを削除する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_node_unlink_node</function></funcdef> + <void/> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id="function.xpath-eval-expression"> + <refnamediv> + <refname>xpath_eval_expression</refname> + <refpurpose> + 指定文字列のXPathロケーションパスを評価する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>xpath_eval</function></funcdef> + <paramdef>object <parameter>xpath_context</parameter></paramdef> + </funcprototype> + </funcsynopsis> + &warn.experimental.func; + <para> + </para> + <para> + See also <function></function> + </para> + </refsect1> + </refentry> + + <refentry id='function.domxml-version'> + <refnamediv> + <refname>domxml_version</refname> + <refpurpose> + XMLライブラリバージョンを取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>domxml_version</function></funcdef> + <void/> + </funcprototype> + </funcsynopsis> + <para> + この関数は、現在使用されるXMLライブラリのバージョンを返します。 + </para> + </refsect1> + </refentry> + + <refentry id='function.xptr-new-context'> + <refnamediv> + <refname>xptr_new_context</refname> + <refpurpose> + Create new XPath Context + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>xptr_new_context</function></funcdef> + <paramdef>object + <parameter><optional>doc_handle</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.xptr-eval'> + <refnamediv> + <refname>xptr_eval</refname> + <refpurpose> + 指定した文字列のXPtrロケーションパスを評価する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>xptr_eval</function></funcdef> + <paramdef>object + <parameter><optional>xpath_context</optional></parameter> + </paramdef> + <paramdef>string <parameter>eval_str</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; </para> </refsect1> </refentry> Index: phpdoc/ja/functions/errorfunc.xml diff -u phpdoc/ja/functions/errorfunc.xml:1.9 phpdoc/ja/functions/errorfunc.xml:1.10 --- phpdoc/ja/functions/errorfunc.xml:1.9 Wed Dec 12 15:52:53 2001 +++ phpdoc/ja/functions/errorfunc.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.errorfunc"> <title>エラー処理およびログ記録関数</title> <titleabbrev>エラーとログ記録</titleabbrev> @@ -101,14 +102,21 @@ </tgroup> </table> </para> + <warning> + <para> + TCP/IP経由でのリモートデバッグは、PHP 3の機能であり、PHP 4では利 + 用できません。 + </para> + </warning> <para> <example role="php"> <title><function>error_log</function> の例</title> <programlisting role="php"> +<![CDATA[ // データベースに接続できない場合、 // サーバログを通してエラーを通知する。 -if (!Ora_Logon($username, $password)) { - error_log("オラクルのデータベースが使用できません!", 0); +if (!Ora_Logon ($username, $password)) { + error_log ("オラクルのデータベースが使用できません!", 0); } // Foo に失敗したら、管理者に email で通知する @@ -121,6 +129,7 @@ error_log ("大変だ!", 2, "127.0.0.1:7000"); error_log ("大変だ!", 2, "loghost"); error_log ("大変だ!", 3, "/var/tmp/my-errors.log"); +]]> </programlisting> </example> </para> @@ -137,7 +146,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>error_reporting</function></funcdef> - <paramdef>mixed + <paramdef>int <parameter> <replaceable><optional>level</optional></replaceable> </parameter> @@ -156,6 +165,7 @@ <example role="php"> <title>エラー整数の変更</title> <programlisting role="php"> +<![CDATA[ error_reporting(55); // PHP 3 では E_ALL ^ E_NOTICE と等価 /* 一方、PHP 4 では、'55' は(E_ERROR | E_WARNING | E_PARSE | @@ -164,9 +174,9 @@ error_reporting(2039); // PHP 4 では E_ALL ^ E_NOTICE と等価 error_reporting(E_ALL ^ E_NOTICE); // PHP 3 と 4 の両方で共通 +]]> </programlisting> </example> - これらの意味を得るために内部の値を以下に示します。 <table> <title><function>error_reporting</function> ビット値</title> @@ -227,6 +237,24 @@ <link linkend="internal.e-compile-warning">E_COMPILE_WARNING</link> </entry> </row> + <row> + <entry>256</entry> + <entry> + <link linkend="internal.e-user-error">E_USER_ERROR</link> + </entry> + </row> + <row> + <entry>512</entry> + <entry> + <link linkend="internal.e-user-warning">E_USER_WARNING</link> + </entry> + </row> + <row> + <entry>1024</entry> + <entry> + <link linkend="internal.e-user-error">E_USER_NOTICE</link> + </entry> + </row> </tbody> </tgroup> </table> @@ -235,21 +263,23 @@ <example role="php"> <title><function>error_reporting</function> の例</title> <programlisting role="php"> -error_reporting(0); +<![CDATA[ +error_reporting (0); // 全てのレポートをオフにする -error_reporting(7); // 古い構文、 PHP 2/3 -error_reporting(E_ERROR | E_WARNING | E_PARSE); // PHP 3/4の新しい構文 +error_reporting (7); // 古い構文、 PHP 2/3 +error_reporting (E_ERROR | E_WARNING | E_PARSE); // PHP 3/4の新しい構文 /* 簡単な実行エラーに適する */ -error_reporting(15); // 古い構文、 PHP 2/3 -error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // PHP 3/4の新しい構文 +error_reporting (15); // 古い構文、 PHP 2/3 +error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // PHP 3/4の新しい構文 /* 初期化されたいない(または恐らくスペルミスの)変数を通知するコードを 作成するのに適する */ -error_reporting(63); // 古い構文、 PHP 2/3 -error_reporting(E_ALL); // PHP 3/4の新しい構文 +error_reporting (63); // 古い構文、 PHP 2/3 +error_reporting (E_ALL); // PHP 3/4の新しい構文 /* 全てのPHPエラーをリポート */ +]]> </programlisting> </example> </para> @@ -268,7 +298,7 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>restore_error_handler</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> <para> @@ -326,50 +356,51 @@ <function>trigger_error</function>によるエラー処理 </title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php // ユーザエラー定数による再定義 - PHP4 のみ -define(FATAL,E_USER_ERROR); -define(ERROR,E_USER_WARNING); -define(WARNING,E_USER_NOTICE); +define (FATAL,E_USER_ERROR); +define (ERROR,E_USER_WARNING); +define (WARNING,E_USER_NOTICE); // このスクリプトのエラー出力レベルを設定 -error_reporting(FATAL | ERROR | WARNING); +error_reporting (FATAL | ERROR | WARNING); // エラーハンドラ関数 function myErrorHandler ($errno, $errstr, $errfile, $errline) { switch ($errno) { case FATAL: - echo &quot;&lt;b&gt;FATAL&lt;/b&gt; [$errno] $errstr&lt;br&gt;\n&quot;; - echo &quot; Fatal error in line &quot;.$errline.&quot; of file &quot;.$errfile; - echo &quot;, PHP &quot;.PHP_VERSION.&quot; (&quot;.PHP_OS.&quot;)&lt;br&gt;\n&quot;; - echo &quot;Aborting...&lt;br&gt;\n&quot;; + echo "<b>FATAL</b> [$errno] $errstr<br>\n"; + echo " Fatal error in line ".$errline." of file ".$errfile; + echo ", PHP ".PHP_VERSION." (".PHP_OS.")<br>\n"; + echo "Aborting...<br>\n"; exit -1; break; case ERROR: - echo &quot;&lt;b&gt;ERROR&lt;/b&gt; [$errno] $errstr&lt;br&gt;\n&quot;; + echo "<b>ERROR</b> [$errno] $errstr<br>\n"; break; case WARNING: - echo &quot;&lt;b&gt;WARNING&lt;/b&gt; [$errno] $errstr&lt;br&gt;\n&quot;; + echo "<b>WARNING</b> [$errno] $errstr<br>\n"; break; default: - echo &quot;Unkown error type: [$errno] $errstr&lt;br&gt;\n&quot;; + echo "Unkown error type: [$errno] $errstr<br>\n"; break; } } // エラー処理のテスト用関数 function scale_by_log ($vect, $scale) { - if ( !is_numeric($scale) || $scale &lt;= 0 ) - trigger_error(&quot;log(x) for x &lt;= 0 is undefined, you used: scale = $scale&quot;, + if ( !is_numeric($scale) || $scale <= 0 ) + trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", FATAL); if (!is_array($vect)) { - trigger_error(&quot;Incorrect input vector, array of values expected&quot;, ERROR); + trigger_error("Incorrect input vector, array of values expected", ERROR); return null; } - for ($i=0; $i&lt;count($vect); $i++) { + for ($i=0; $i<count($vect); $i++) { if (!is_numeric($vect[$i])) - trigger_error(&quot;Value at position $i is not a number, using 0 (zero)&quot;, + trigger_error("Value at position $i is not a number, using 0 (zero)", WARNING); $temp[$i] = log($scale) * $vect[$i]; } @@ -377,15 +408,15 @@ } // 定義したエラーハンドラを設定する -$old_error_handler = set_error_handler(&quot;myErrorHandler&quot;); +$old_error_handler = set_error_handler("myErrorHandler"); // エラーを発生します。まず、数値でない項目が混ざった配列を定義します。 -echo &quot;vector a\n&quot;; -$a = array(2,3,&quot;foo&quot;,5.5,43.3,21.11); +echo "vector a\n"; +$a = array(2,3,"foo",5.5,43.3,21.11); print_r($a); // 次に警告を発生するような2番目の配列を生成します。 -echo &quot;----\nvector b - a warning (b = log(PI) * a)\n&quot;; +echo "----\nvector b - a warning (b = log(PI) * a)\n"; $b = scale_by_log($a, M_PI); print_r($b); @@ -395,46 +426,49 @@ var_dump($c); // ゼロまたは負数の log が定義されないという致命的なエラーを発生します。 -echo &quot;----\nvector d - fatal error\n&quot;; +echo "----\nvector d - fatal error\n"; $d = scale_by_log($a, -2.5); -?&gt; +?> +]]> </programlisting> </example> このサンプルスクリプトを実行すると、出力は次のようになります。 <informalexample> <programlisting> +<![CDATA[ vector a Array ( - [0] =&gt; 2 - [1] =&gt; 3 - [2] =&gt; foo - [3] =&gt; 5.5 - [4] =&gt; 43.3 - [5] =&gt; 21.11 + [0] => 2 + [1] => 3 + [2] => foo + [3] => 5.5 + [4] => 43.3 + [5] => 21.11 ) ---- vector b - a warning (b = log(PI) * a) -&lt;b&gt;WARNING&lt;/b&gt; [1024] Value at position 2 is not a number, using 0 (zero)&lt;br&gt; +<b>WARNING</b> [1024] Value at position 2 is not a number, using 0 (zero)<br> Array ( - [0] =&gt; 2.2894597716988 - [1] =&gt; 3.4341896575482 - [2] =&gt; 0 - [3] =&gt; 6.2960143721717 - [4] =&gt; 49.566804057279 - [5] =&gt; 24.165247890281 + [0] => 2.2894597716988 + [1] => 3.4341896575482 + [2] => 0 + [3] => 6.2960143721717 + [4] => 49.566804057279 + [5] => 24.165247890281 ) ---- vector c - an error -&lt;b&gt;ERROR&lt;/b&gt; [512] Incorrect input vector, array of values expected&lt;br&gt; +<b>ERROR</b> [512] Incorrect input vector, array of values expected<br> NULL ---- vector d - fatal error -&lt;b&gt;FATAL&lt;/b&gt; [256] log(x) for x &lt;= 0 is undefined, you used: scale = -2.5&lt;br&gt; - Fatal error in line 36 of file trigger_error.php, PHP 4.0.2 (Linux)&lt;br&gt; -Aborting...&lt;br&gt; +<b>FATAL</b> [256] log(x) for x <= 0 is undefined, you used: scale = -2.5<br> + Fatal error in line 36 of file trigger_error.php, PHP 4.0.2 (Linux)<br> +Aborting...<br> +]]> </programlisting> </informalexample> </para> @@ -495,9 +529,11 @@ この関数は、実行時の例外に特定の応答を生成する必要がある場合に有 用です。以下に例を示します。 <informalexample> - <programlisting role="php"> -if (assert($divisor == 0)) - trigger_error("Cannot divide by zero", E_USER_ERROR); + <programlisting> +<![CDATA[ +if (assert ($divisor == 0)) + trigger_error ("Cannot divide by zero", E_USER_ERROR); +]]> </programlisting> </informalexample> <note> Index: phpdoc/ja/functions/exec.xml diff -u phpdoc/ja/functions/exec.xml:1.11 phpdoc/ja/functions/exec.xml:1.12 --- phpdoc/ja/functions/exec.xml:1.11 Wed Dec 12 15:52:53 2001 +++ phpdoc/ja/functions/exec.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.12 $ --> <reference id="ref.exec"> <title>プログラム実行関数</title> <titleabbrev>プログラムの実行</titleabbrev> @@ -40,7 +41,9 @@ <para> <informalexample> <programlisting role="php"> -system("ls ".EscapeShellArg($dir)) +<![CDATA[ +system("ls ".escapeshellarg($dir)); +]]> </programlisting> </informalexample> </para> @@ -78,10 +81,12 @@ <para> <informalexample> <programlisting role="php"> -$e = EscapeShellCmd($userinput); -system("echo $e"); // ここでは、 $e にスペースがあるかは配慮していません -$f = EscapeShellCmd($filename); -system("touch \"/tmp/$f\"; ls -l \"/tmp/$f\""); // ここでは配慮し、クオートします +<![CDATA[ +$e = escapeshellcmd($userinput); +system("echo $e"); // ここでは、$eにスペースがあるかは配慮していません +$f = escapeshellcmd($filename); +system("touch \"/tmp/$f\"; ls -l \"/tmp/$f\""); // こでは配慮し、クオートします +]]> </programlisting> </informalexample> </para> @@ -118,13 +123,12 @@ </paramdef> </funcprototype> </funcsynopsis> - <para> - <function>exec</function>は指定された - <parameter>command</parameter>を実行しますが、一切の出力はありませ - ん。ただ単に、コマンド結果の最後の行を返すだけです。コマンドを実行 - し、一切干渉を受けずに直接コマンドから全てのデータを受けとる必要が - あるならば、<function>PassThru</function> 関数を使ってください。 + <function>exec</function>は指定された + <parameter>command</parameter>を実行しますが、一切の出力はありま + せん。ただ単に、コマンド結果の最後の行を返すだけです。コマンドを実行 + し、一切干渉を受けずに直接コマンドから全てのデータを受けとる必要が + あるならば、<function>PassThru</function> 関数を使ってください。 </para> <para> 引数<parameter>array</parameter>が存在する場合、指定した配列は、 @@ -229,22 +233,26 @@ system関数に似ています。2番目の引数として変数が指定された場合、実 行したコマンドのステータスコードが、この変数に書き込まれます。 </para> - <para> - ユーザが入力したデータをこの関数に渡そうとする場合、 - <function>EscapeShellCmd</function>を使用して、ユーザが - システムをだまして、勝手なコマンドを実行することのないように - するべきです。 - </para> - <para> - この関数を使用してプログラム実行を開始し、バックグラウンドで実行 - したままにしたい場合には、プログラムの出力をファイルまたは他の出 - 力ストリームにリダイレクトする必要があることにも注意して下さい。 - さもないと、PHPはそのプログラムの実行が終了するまでハングします。 - </para> + <warning> + <para> + ユーザが入力したデータをこの関数に渡そうとする場合、 + <function>escapeshellarg</function>または + <function>escapeshellcmd</function>を使用して、ユーザがシステム + をだまして、勝手なコマンドを実行することのないようにするべきです。 + </para> + </warning> + <note> + <para> + この関数を使用してプログラム実行を開始し、バックグラウンドで実行 + したままにしたい場合には、プログラムの出力をファイルまたは他の出 + 力ストリームにリダイレクトする必要があることにも注意して下さい。 + さもないと、PHPはそのプログラムの実行が終了するまでハングします。 + </para> + </note> <para> PHPをサーバモジュールとして実行している場合、 <function>system</function>のコールにより、各行を出力した後、 - webサーバの出力バッファが自動的にクリアされます。 + Webサーバの出力バッファが自動的にクリアされます。 </para> <para> 成功時にコマンド出力の最後の行が返され、失敗時に&false;が返されます。 @@ -259,7 +267,30 @@ <function>popen</function>,<function>EscapeShellCmd</function>, <link linkend="language.operators.execution">backtick 演算子 </link>を参照下さい。 - </para> + </para> + </refsect1> + </refentry> + + <refentry id='function.shell-exec'> + <refnamediv> + <refname>shell_exec</refname> + <refpurpose> + シェルによりコマンドを実行し、文字列として出力全体を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>shell_exec</function></funcdef> + <paramdef>string <parameter>cmd</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + この演算子は、<link + linkend="language.operators.execution">実行演算子</link>と同じで + す。 + </para> </refsect1> </refentry> Index: phpdoc/ja/functions/fbsql.xml diff -u phpdoc/ja/functions/fbsql.xml:1.9 phpdoc/ja/functions/fbsql.xml:1.10 --- phpdoc/ja/functions/fbsql.xml:1.9 Wed Dec 12 15:52:54 2001 +++ phpdoc/ja/functions/fbsql.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.fbsql"> <title>FrontBase関数</title> <titleabbrev>FrontBase</titleabbrev> @@ -51,7 +52,7 @@ <para> <function>fbsql_affected_rows</function> は、 <parameter>link_identifier</parameter>が指す接続において - 直近のINSERT, UPDATE, DELETEクエルで作用されたレコードの数を返し + 直近のINSERT, UPDATE, DELETEクエリで作用されたレコードの数を返し ます。リンクIDが指定されない場合、 <function>fbsql_connect</function>により直近にオープンされた接続 が使用されます。 @@ -70,22 +71,22 @@ </para> <note> <para> - When using UPDATE, FrontBase will not update columns where the new - value is the same as the old value. This creates the possiblity - that <function>fbsql_affected_rows</function> may not actually - equal the number of rows matched, only the number of rows that - were literally affected by the query. + UPDATEを使用する場合、FrontBaseは、新しい値が古い値と同じ場合に + はカラムを更新しません。このため、 + <function>fbsql_affected_rows</function>は、実際にはマッチした行 + の数と一致しない可能性があり、クエリにより実際に変更された行の数 + だけとなります。 </para> </note> <para> - If the last query failed, this function will return -1. + 直近のクエリが失敗した場合、この関数は-1を返します。 </para> <para> <function>fbsql_num_rows</function>も参照下さい。 </para> </refsect1> </refentry> - + <refentry id="function.fbsql-autocommit"> <refnamediv> <refname>fbsql_autocommit</refname> @@ -107,10 +108,20 @@ </funcprototype> </funcsynopsis> <para> - <function>fbsql_autocommit</function> returns the current - autocommit status. if the optional OnOff parameter is - given the auto commit status will be changed. + <function>fbsql_autocommit</function>は、カレントのautocommitステー + タスを返します。オプションのOnOffパラメータが指定された場合、オー + トコミットステータスは変更されます。 + OnOffを&true;に設定すると、エラーがない場合には、各命令は自動的に + コミットされます。 + OnOffが &false; に設定された場合、ユーザは、 + <function>fbsql_commit</function>または + <function>fbsql_rollback</function>のどちらかによりユーザはコミッ + トまたはロールバックを行う必要があります。 </para> + <para> + <function>fbsql_commit</function>および + <function>fbsql_rollback</function>も参照下さい。 + </para> </refsect1> </refentry> @@ -138,15 +149,16 @@ <optional>link_identifier</optional> </parameter> </paramdef> - </funcprototype> + </funcprototype> </funcsynopsis> <para> - <function>fbsql_change_user</function> changes the logged in user - of the current active connection, or the connection given by the - optional parameter link_identifier. If a database is - specified, this will default or current database after the user - has been changed. If the new user and password authorization fails, - the current connected user stays active. + <function>fbsql_change_user</function>は、カレントのアクティブ接 + 続またはオプションのパラメータ + <parameter>link_identifier</parameter>で指定した接続のログインユー + ザを変更します。<parameter>database</parameter>が指定された場合、 + ユーザ変更後のデフォルトまたはカレントのデータベースとなります。 + 新規ユーザ及びパスワード認証が失敗した場合、カレントの接続ユーザ + はアクティブなままとなります。 </para> </refsect1> </refentry> @@ -169,27 +181,30 @@ </funcprototype> </funcsynopsis> <para> - Returns: &true; on success, &false; on error. + 成功時に&true;、エラー時に&false;を返します。 </para> - <para> <function>fbsql_close</function> closes the connection to - the FrontBase server that's associated with the specified link - identifier. If <parameter>link_identifier</parameter> isn't - specified, the last opened link is used. + <para> + <function>fbsql_close</function>は、指定したリンクIDに関連する + FrontBaseサーバへの接続を閉じます。 + <parameter>link_identifier</parameter>が指定されない場合、直近に + オープンされたリンクが使用されます。 </para> <para> - Using <function>fbsql_close</function> isn't usually necessary, - as non-persistent open links are automatically closed at the end - of the script's execution. + 持続的でないオープンされたリンクは、スクリプト実行終了時に自動的 + にクローズされるため、<function>fbsql_close</function>は実際には + 不用です。 </para> <example> <title><function>fbsql_close</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = fbsql_connect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); print ("Connected successfully"); fbsql_close ($link); -?&gt; +?> +]]> </programlisting> </example> <para> @@ -199,6 +214,39 @@ </refsect1> </refentry> + <refentry id="function.fbsql-commit"> + <refnamediv> + <refname>fbsql_commit</refname> + <refpurpose>データベースへのトランザクションをコミットする</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>fbsql_commit</function></funcdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + 成功時に&true;、失敗時に&false;を返します。 + </para> + <para> + <function>fbsql_commit</function>は、ディスクへのinsert、update、 + deleteを全て書き込み、トランザクションによりホールドされた全ての + 行及びテーブルのロックをアンロックします。このコマンドは、 + autocommitがfalseに設定されている場合のみ必要です。 + </para> + <para> + <function>fbsql_autocommit</function>及び + <function>fbsql_rollback</function>も参照下さい。 + </para> + </refsect1> + </refentry> + <refentry id="function.fbsql-connect"> <refnamediv> <refname>fbsql_connect</refname> @@ -228,44 +276,44 @@ </funcprototype> </funcsynopsis> <para> - Returns a positive FrontBase link identifier on success, or an error - message on failure. + 成功時に正のFrontBaseリンクIDは、失敗時にエラーメッセージを返しま + す。 </para> <para> - <function>fbsql_connect</function> establishes a connection - to a FrontBase server. The following defaults are assumed for - missing optional parameters: <parameter>hostname</parameter> = - '&null;', <parameter>username</parameter> = '_SYSTEM' and - <parameter>password</parameter> = empty password. + <function>fbsql_connect</function>は、FrontBaseサーバへの接続を確 + 立します。オプションのパラメータを省略した場合には以下のデフォル + ト値が仮定されます。: <parameter>hostname</parameter> = '&null;', + <parameter>username</parameter> = '_SYSTEM', + <parameter>password</parameter> = 空のパスワード </para> <para> - If a second call is made to <function>fbsql_connect</function> - with the same arguments, no new link will be established, but - instead, the link identifier of the already opened link will be - returned. + 同じ引数で<function>fbsql_connect</function>への2番目のコールが行 + われた場合、新規のリンクは確立されず、替わりに既にオープンされて + いるリンクIDが返されます。 </para> <para> - The link to the server will be closed as soon as the execution of - the script ends, unless it's closed earlier by explicitly calling - <function>fbsql_close</function>. + <function>fbsql_close</function>をコールすることにより事前に明示 + 的にクローズされていない限り、サーバへのリンクはスクリプト実行終 + 了時にクローズされます。 </para> <example> <title><function>fbsql_connect</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = fbsql_connect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); print ("Connected successfully"); fbsql_close ($link); -?&gt; +?> +]]> </programlisting> </example> <para> - See also - <function>fbsql_pconnect</function>, and - <function>fbsql_close</function>. + <function>fbsql_pconnect</function>および + <function>fbsql_close</function>も参照下さい。 </para> </refsect1> </refentry> @@ -289,14 +337,14 @@ </funcprototype> </funcsynopsis> <para> - <function>fbsql_create_db</function> attempts to create a new - database on the server associated with the specified link - identifier. + <function>fbsql_create_db</function>は、指定したリンクIDが指すサー + バ上に新規にデータベースを作成します。 </para> <example> - <title><function>fbsql_create_db</function> example</title> + <title><function>fbsql_create_db</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); if (fbsql_create_db ("my_db")) { @@ -304,11 +352,164 @@ } else { printf("Error creating database: %s\n", fbsql_error ()); } -?&gt; +?> +]]> + </programlisting> + </example> + <para> + <function>fbsql_drop_db</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-create-blob"> + <refnamediv> + <refname>fbsql_create_blob</refname> + <refpurpose>BLOBを生成する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_create_blob</function></funcdef> + <paramdef>string <parameter>blob_data</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + 返り値: 新規に生成されたblobへのリソースハンドル + </para> + <para> + <function>fbsql_create_blob</function>は、blob_dataからblobを生成 + します。返されたリソースハンドルは、データベース中にblobを保存す + るinsert及びupdateコマンドで使用されます。 + </para> + <example> + <title><function>fbsql_create_blob</function>の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") + or die ("Could not connect"); + $filename = "blobfile.bin"; + $fp = fopen($filename, "rb"); + $blobdata = fread($fp, filesize($filename)); + fclose($fp); + + $blobHandle = fbsql_create_blob($blobdata, $link); + + $sql = "INSERT INTO BLOB_TABLE (BLOB_COLUMN) VALUES ($blobHandle);"; + $rs = fbsql_query($sql, $link); +?> +]]> </programlisting> </example> + <para> + <function>fbsql_create_clob</function>, + <function>fbsql_read_blob</function>, + <function>fbsql_read_clob</function>, + <function>fbsql_set_lob_mode</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-create-clob"> + <refnamediv> + <refname>fbsql_create_clob</refname> + <refpurpose>CLOBを生成する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_create_clob</function></funcdef> + <paramdef>string <parameter>clob_data</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> <para> - See also: <function>fbsql_drop_db</function>. + 返り値: 新規に生成されたCLOBへのリソースハンドル + </para> + <para> + <function>fbsql_create_clob</function>は、clob_dataからclobを生成 + します。返されたリソースハンドルは、データベースにclob保存する + insert及びupdateコマンドで使用されます。 + </para> + <example> + <title><function>fbsql_create_clob</function>の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") + or die ("Could not connect"); + $filename = "clob_file.txt"; + $fp = fopen($filename, "rb"); + $clobdata = fread($fp, filesize($filename)); + fclose($fp); + + $clobHandle = fbsql_create_clob($clobdata, $link); + + $sql = "INSERT INTO CLOB_TABLE (CLOB_COLUMN) VALUES ($clobHandle);"; + $rs = fbsql_query($sql, $link); +?> +]]> + </programlisting> + </example> + <para> + <function>fbsql_create_blob</function>, + <function>fbsql_read_blob</function>, + <function>fbsql_read_clob</function>, + <function>fbsql_set_lob_mode</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-database-password"> + <refnamediv> + <refname>fbsql_database_password</refname> + <refpurpose> + FrontBaseデータベースのパスワードを設定または取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string + <function>fbsql_database_password</function> + </funcdef> + <paramdef>resource + <parameter>link_identifier</parameter></paramdef> + <paramdef>string + <parameter> + <optional>database_password</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + 返り値: リンクIDにより表されるデータベースのデータベースパスワード + </para> + <para> + <function>fbsql_database_password</function>は、カレントのデータ + ベースパスワードを設定または取得します。二番目のオプションのパラ + メータが指定された場合、指定したリンクIDが指すサーバのパスワード + のデータベースパスワードを設定します。リンクIDが指定されない場合、 + 直近にオープンされたリンクが仮定されます。リンクがオープンされて + いない場合、この関数は、<function>fbsql_connect</function>がコー + ルされた場合と同様にリンクを確立し、使用します。 + </para> + <para> + <function>fbsql_connect</function>および + <function>fbsql_pconnect</function>も参照下さい。 </para> </refsect1> </refentry> @@ -323,27 +524,30 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_data_seek</function></funcdef> - <paramdef>resource <parameter>result_identifier</parameter></paramdef> + <paramdef>resource + <parameter>result_identifier</parameter> + </paramdef> <paramdef>int <parameter>row_number</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns: &true; on success, &false; on failure. + 返り値: 成功時に&true;、失敗時に&false;。 </para> <para> - <function>fbsql_data_seek</function> moves the internal row - pointer of the FrontBase result associated with the specified result - identifier to point to the specified row number. The next call - to <function>fbsql_fetch_row</function> would return that row. + <function>fbsql_data_seek</function>は、指定した結果IDが指す + FrontBase結果の内部行ポインタを指定した行番号に移動します。 + これ以降、<function>fbsql_fetch_row</function>をコールすると、そ + の行が返されます。 </para> <para> - <parameter>Row_number</parameter> starts at 0. + <parameter>row_number</parameter>は、0から始まります。 </para> <example> - <title><function>fbsql_data_seek</function> example</title> + <title><function>fbsql_data_seek</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); @@ -365,11 +569,12 @@ if(!($row = fbsql_fetch_object ($result))) continue; - printf("%s %s&lt;BR>\n", $row->last_name, $row->first_name); + printf("%s %s<BR>\n", $row->last_name, $row->first_name); } fbsql_free_result ($result); -?&gt; +?> +]]> </programlisting> </example> </refsect1> @@ -395,19 +600,98 @@ </funcprototype> </funcsynopsis> <para> - Returns: A positive FrontBase result identifier to the query result, - or &false; on error. + 返り値: クエリ結果への正のFrontBase結果ID、またはエラー時には&false;。 + </para> + <para> + <function>fbsql_db_query</function>は、データベースを選択し、そこ + でクエリを実行します。オプションのリンクIDが省略された場合、この + 関数は、FrontBaseサーバへのリンクをオープンしようとし、 + <function>fbsql_connect</function>が引数無しでコールされた時と同 + 様にリンクを作成します。 + </para> + <para> + <function>fbsql_connect</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-db-status"> + <refnamediv> + <refname>fbsql_db_status</refname> + <refpurpose>指定したデータベースのステータスを取得する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>fbsql_db_status</function></funcdef> + <paramdef>string <parameter>database_name</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + 返り値: カレントステータスを表す整数値 </para> <para> - <function>fbsql_db_query</function> selects a database and - executes a query on it. If the optional link identifier isn't - specified, the function will try to find an open link to the - FrontBase server and if no such link is found it'll try to create one - as if <function>fbsql_connect</function> was called with no - arguments + <function>fbsql_db_status</function>は、 + <parameter>database_name</parameter>で指定したデータベースのカレ + ントステータスを取得します。 + <parameter>link_identifier</parameter>が省略された場合、デフォル + トのlink_identifierが使用されます。 + </para> + <para> + 返り値は、次の定数の1つとします。 + <itemizedlist> + <listitem> + <simpara> + &false; - hostが無効なexecハンドラ。このエラーは、 + link_identifierがポート番号を用いてデータベースへ直接接続する + 場合に発生します。FBExecはサーバで利用可能ですが、接続は行われ + ていません。 + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_UNKNOWN - 未知のステータスです。 + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_STOPPED - データベースは実行されていません。データベース + を開始するには、<function>fbsql_start_db</function>を使用して + 下さい。 + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_STARTING - データベースは起動中です。 + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_RUNNING - データベースは実行中で、SQL処理を実行可能です。 + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_STOPPING - データベースは停止中です。 + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_NOEXEC - FBExecはサーバで実行されておらず、データベース + のステータスを取得することはできません。 + </simpara> + </listitem> + </itemizedlist> </para> <para> - See also <function>fbsql_connect</function>. + <function>fbsql_start_db</function>および + <function>fbsql_stop_db</function>も参照下さい。 </para> </refsect1> </refentry> @@ -431,12 +715,11 @@ </funcprototype> </funcsynopsis> <para> - Returns: &true; on success, &false; on failure. + 返り値: 成功時に&true;、失敗時に&false;。 </para> <para> - <function>fbsql_drop_db</function> attempts to drop (remove) an - entire database from the server associated with the specified - link identifier. + <function>fbsql_drop_db</function>は、指定したリンクIDが指すサー + バからデータベース全体を破棄(削除)します。 </para> </refsect1> </refentry> @@ -475,14 +758,16 @@ function. <informalexample> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect("marliesle"); -echo fbsql_errno().": ".fbsql_error()."&lt;BR>"; +echo fbsql_errno().": ".fbsql_error()."<BR>"; fbsql_select_db("nonexistentdb"); -echo fbsql_errno().": ".fbsql_error()."&lt;BR>"; +echo fbsql_errno().": ".fbsql_error()."<BR>"; $conn = fbsql_query("SELECT * FROM nonexistenttable;"); -echo fbsql_errno().": ".fbsql_error()."&lt;BR>"; -?&gt; +echo fbsql_errno().": ".fbsql_error()."<BR>"; +?> +]]> </programlisting> </informalexample> </para> @@ -526,14 +811,16 @@ sure you check the value before calling another fbsql function. <informalexample> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect("marliesle"); -echo fbsql_errno().": ".fbsql_error()."&lt;BR>"; +echo fbsql_errno().": ".fbsql_error()."<BR>"; fbsql_select_db("nonexistentdb"); -echo fbsql_errno().": ".fbsql_error()."&lt;BR>"; +echo fbsql_errno().": ".fbsql_error()."<BR>"; $conn = fbsql_query("SELECT * FROM nonexistenttable;"); -echo fbsql_errno().": ".fbsql_error()."&lt;BR>"; -?&gt; +echo fbsql_errno().": ".fbsql_error()."<BR>"; +?> +]]> </programlisting> </informalexample> </para> @@ -580,7 +867,9 @@ make an alias for the column. <informalexample> <programlisting> +<![CDATA[ select t1.f1 as foo t2.f1 as bar from t1, t2 +]]> </programlisting> </informalexample> </para> @@ -597,23 +886,26 @@ FBSQL_BOTH. </para> <para> - For further details, see also - <function>fbsql_fetch_row</function> and <function>fbsql_fetch_assoc</function>. + 詳細については、 + <function>fbsql_fetch_row</function>および + <function>fbsql_fetch_assoc</function>も参照下さい。 </para> <example> - <title><function>fbsql_fetch_array</function> example</title> + <title><function>fbsql_fetch_array</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect ($host, $user, $password); $result = fbsql_db_query ("database","select user_id, fullname from table"); while ($row = fbsql_fetch_array ($result)) { - echo "user_id: ".$row["user_id"]."&lt;br>\n"; - echo "user_id: ".$row[0]."&lt;br>\n"; - echo "fullname: ".$row["fullname"]."&lt;br>\n"; - echo "fullname: ".$row[1]."&lt;br>\n"; + echo "user_id: ".$row["user_id"]."<br>\n"; + echo "user_id: ".$row[0]."<br>\n"; + echo "fullname: ".$row["fullname"]."<br>\n"; + echo "fullname: ".$row[1]."<br>\n"; } fbsql_free_result ($result); -?&gt; +?> +]]> </programlisting> </example> </refsect1> @@ -658,13 +950,14 @@ provides a significant added value. </para> <para> - For further details, see also - <function>fbsql_fetch_row</function> and <function>fbsql_fetch_array</function>. + 詳細については、<function>fbsql_fetch_row</function>および + <function>fbsql_fetch_array</function>も参照下さい。 </para> <example> - <title><function>fbsql_fetch_assoc</function> example</title> + <title><function>fbsql_fetch_assoc</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect ($host, $user, $password); $result = fbsql_db_query ("database","select * from table"); while ($row = fbsql_fetch_assoc ($result)) { @@ -672,7 +965,8 @@ echo $row["fullname"]; } fbsql_free_result ($result); -?&gt; +?> +]]> </programlisting> </example> </refsect1> @@ -738,36 +1032,38 @@ </itemizedlist> </para> <example> - <title><function>fbsql_fetch_field</function> example</title> + <title><function>fbsql_fetch_field</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect ($host, $user, $password) or die ("Could not connect"); $result = fbsql_db_query ("database", "select * from table") or die ("Query failed"); # get column metadata $i = 0; -while ($i &lt; fbsql_num_fields ($result)) { - echo "Information for column $i:&lt;BR>\n"; +while ($i < fbsql_num_fields ($result)) { + echo "Information for column $i:<BR>\n"; $meta = fbsql_fetch_field ($result); if (!$meta) { - echo "No information available&lt;BR>\n"; + echo "No information available<BR>\n"; } - echo "&lt;PRE> + echo "<PRE> max_length: $meta->max_length name: $meta->name not_null: $meta->not_null table: $meta->table type: $meta->type -&lt;/PRE>"; +</PRE>"; $i++; } fbsql_free_result ($result); -?&gt; +?> +]]> </programlisting> </example> <para> - See also <function>fbsql_field_seek</function>. + <function>fbsql_field_seek</function>も参照下さい。 </para> </refsect1> </refentry> @@ -848,9 +1144,10 @@ <function>fbsql_fetch_row</function> (the difference is insignificant). <example> - <title><function>fbsql_fetch_object</function> example</title> + <title><function>fbsql_fetch_object</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect ($host, $user, $password); $result = fbsql_db_query ("database", "select * from table"); while ($row = fbsql_fetch_object ($result)) { @@ -858,13 +1155,14 @@ echo $row->fullname; } fbsql_free_result ($result); -?&gt; +?> +]]> </programlisting> </example> </para> <para> - See also: <function>fbsql_fetch_array</function> and - <function>fbsql_fetch_row</function>. + <function>fbsql_fetch_array</function>および + <function>fbsql_fetch_row</function>も参照下さい。 </para> </refsect1> </refentry> @@ -965,8 +1263,9 @@ </note> <para> <example> - <title><function>fbsql_field_name</function> example</title> + <title><function>fbsql_field_name</function>の例</title> <programlisting role="php"> +<![CDATA[ // The users table consists of three fields: // user_id // username @@ -976,15 +1275,18 @@ echo fbsql_field_name($res, 0) . "\n"; echo fbsql_field_name($res, 2); +]]> </programlisting> </example> </para> <para> - The above example would produce the following output: + 上の例の出力は以下のようになります。 <informalexample> <programlisting> +<![CDATA[ user_id password +]]> </programlisting> </informalexample> </para> @@ -1091,7 +1393,8 @@ <example> <title><function>fbsql_field_type</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect ("localhost", "_SYSTEM", ""); fbsql_select_db ("wisconsin"); @@ -1100,19 +1403,20 @@ $rows = fbsql_num_rows ($result); $i = 0; $table = fbsql_field_table ($result, $i); -echo "Your '".$table."' table has ".$fields." fields and ".$rows." records &lt;BR>"; -echo "The table has the following fields &lt;BR>"; -while ($i &lt; $fields) { +echo "Your '".$table."' table has ".$fields." fields and ".$rows." records <BR>"; +echo "The table has the following fields <BR>"; +while ($i < $fields) { $type = fbsql_field_type ($result, $i); $name = fbsql_field_name ($result, $i); $len = fbsql_field_len ($result, $i); $flags = fbsql_field_flags ($result, $i); - echo $type." ".$name." ".$len." ".$flags."&lt;BR>"; + echo $type." ".$name." ".$len." ".$flags."<BR>"; $i++; } fbsql_close(); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -1215,32 +1519,36 @@ </para> <para> <example> - <title><function>fbsql_list_dbs</function> example</title> + <title><function>fbsql_list_dbs</function>の例</title> <programlisting role="php"> +<![CDATA[ $link = fbsql_connect('localhost', 'myname', 'secret'); $db_list = fbsql_list_dbs($link); while ($row = fbsql_fetch_object($db_list)) { - echo $row->Database . "\n"; + echo $row->Database . "\n"; } +]]> </programlisting> </example> </para> <para> - The above example would produce the following output: + 上の例の出力は以下のようになります。 <informalexample> <programlisting> +<![CDATA[ database1 database2 database3 ... +]]> </programlisting> </informalexample> </para> <note> <para> - The above code would just as easily work with - <function>fbsql_fetch_row</function> or other similar functions. + 上記のコードは、<function>fbsql_fetch_row</function>または他の類 + 似の関数でも簡単に同じことが可能です。 </para> </note> </refsect1> @@ -1283,27 +1591,31 @@ </para> <para> <example> - <title><function>fbsql_list_fields</function> example</title> + <title><function>fbsql_list_fields</function>の例</title> <programlisting role="php"> +<![CDATA[ $link = fbsql_connect('localhost', 'myname', 'secret'); $fields = fbsql_list_fields("database1", "table1", $link); $columns = fbsql_num_fields($fields); -for ($i = 0; $i &lt; $columns; $i++) { - echo fbsql_field_name($fields, $i) . "\n";; +for ($i = 0; $i < $columns; $i++) { + echo fbsql_field_name($fields, $i) . "\n";; } +]]> </programlisting> </example> </para> <para> - The above example would produce the following output: + 上の例の出力は以下のようになります。 <informalexample> <programlisting> +<![CDATA[ field1 field2 field3 ... +]]> </programlisting> </informalexample> </para> @@ -1365,7 +1677,8 @@ <example> <title><function>fbsql_next_result</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = fbsql_connect ("localhost", "_SYSTEM", "secret"); fbsql_select_db("MyDB", $link); $SQL = "Select * from table1; select * from table2;"; @@ -1376,7 +1689,8 @@ } while (fbsql_next_result($rs)); fbsql_free_result($rs); fbsql_close ($link); -?&gt; +?> +]]> </programlisting> </example> </refsect1> @@ -1427,9 +1741,10 @@ To retrieve the number of rows returned from a INSERT, UPDATE or DELETE query, use <function>fbsql_affected_rows</function>. <example> - <title><function>fbsql_num_rows</function> example</title> + <title><function>fbsql_num_rows</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $link = fbsql_connect("localhost", "username", "password"); fbsql_select_db("database", $link); @@ -1439,16 +1754,16 @@ echo "$num_rows Rows\n"; -?&gt; +?> +]]> </programlisting> </example> </para> <para> - See also: <function>fbsql_affected_rows</function>, <function>fbsql_connect</function>, - <function>fbsql_select_db</function> and - <function>fbsql_query</function>. + <function>fbsql_select_db</function>, + <function>fbsql_query</function>も参照下さい。 </para> </refsect1> </refentry> @@ -1553,12 +1868,14 @@ The following query is syntactically invalid, so <function>fbsql_query</function> fails and returns &false;: <example> - <title><function>fbsql_query</function> example</title> + <title><function>fbsql_query</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $result = fbsql_query ("SELECT * WHERE 1=1") or die ("Invalid query"); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -1568,12 +1885,14 @@ <literal>my_tbl</literal>, so <function>fbsql_query</function> fails and returns &false;: <example> - <title><function>fbsql_query</function> example</title> + <title><function>fbsql_query</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $result = fbsql_query ("SELECT my_col FROM my_tbl") or die ("Invalid query"); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -1610,6 +1929,134 @@ </refsect1> </refentry> + <refentry id="function.fbsql-read-blob"> + <refnamediv> + <refname>fbsql_read_blob</refname> + <refpurpose>データベースからBLOBを読み込む</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_read_blob</function></funcdef> + <paramdef>string <parameter>blob_handle</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + 返り値: blob_handleで指定したBLOBを含む文字列。 + </para> + <para> + <function>fbsql_read_blob</function> reads BLOB data from the + database. If a select statement contains BLOB and/or BLOB + columns FrontBase will return the data directly when data is + fetched. This default behavior can be changed with + <function>fbsql_set_lob_mode</function> so the fetch functions + will return handles to BLOB and CLOB data. If a handle is + fetched a user must call <function>fbsql_read_blob</function> to + get the actual BLOB data from the database. + </para> + <example> + <title><function>fbsql_read_blob</function>の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") + or die ("Could not connect"); + $sql = "SELECT BLOB_COLUMN FROM BLOB_TABLE;"; + $rs = fbsql_query($sql, $link); + $row_data = fbsql_fetch_row($rs); + // $row_data[0] will now contain the blob data for teh first row + fbsql_free_result($rs); + + $rs = fbsql_query($sql, $link); + fbsql_set_lob_mode($rs, FBSQL_LOB_HANDLE); + $row_data = fbsql_fetch_row($rs); + // $row_data[0] will now contain a handle to the BLOB data in the first row + $blob_data = fbsql_read_blob($row_data[0]); + fbsql_free_result($rs); + +?> +]]> + </programlisting> + </example> + <para> + <function>fbsql_create_blob</function>, + <function>fbsql_read_blob</function>, + <function>fbsql_read_clob</function>, + <function>fbsql_set_lob_mode</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-read-clob"> + <refnamediv> + <refname>fbsql_read_clob</refname> + <refpurpose>データベースからCLOBを読み込む</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_read_clob</function></funcdef> + <paramdef>string <parameter>clob_handle</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + 返り値: clob_handleにより指定したCLOBを含む文字列。 + </para> + <para> + <function>fbsql_read_clob</function> reads CLOB data from the + database. If a select statement contains BLOB and/or CLOB + columns FrontBase will return the data directly when data is + fetched. This default behavior can be changed with + <function>fbsql_set_lob_mode</function> so the fetch functions + will return handles to BLOB and CLOB data. If a handle is + fetched a user must call <function>fbsql_read_clob</function> to + get the actual CLOB data from the database. + </para> + <example> + <title><function>fbsql_read_clob</function>の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") + or die ("Could not connect"); + $sql = "SELECT CLOB_COLUMN FROM CLOB_TABLE;"; + $rs = fbsql_query($sql, $link); + $row_data = fbsql_fetch_row($rs); + // $row_data[0] will now contain the clob data for teh first row + fbsql_free_result($rs); + + $rs = fbsql_query($sql, $link); + fbsql_set_lob_mode($rs, FBSQL_LOB_HANDLE); + $row_data = fbsql_fetch_row($rs); + // $row_data[0] will now contain a handle to the CLOB data in the first row + $clob_data = fbsql_read_clob($row_data[0]); + fbsql_free_result($rs); + +?> +]]> + </programlisting> + </example> + <para> + <function>fbsql_create_blob</function>, + <function>fbsql_read_blob</function>, + <function>fbsql_read_clob</function>, + <function>fbsql_set_lob_mode</function>も参照下さい。 + </para> + </refsect1> + </refentry> + <refentry id="function.fbsql-result"> <refnamediv> <refname>fbsql_result</refname> @@ -1651,10 +2098,101 @@ with calls to other functions that deal with the result set. </para> <para> - Recommended high-performance alternatives: + 推奨される高性能な代替関数: <function>fbsql_fetch_row</function>, - <function>fbsql_fetch_array</function>, and - <function>fbsql_fetch_object</function>. + <function>fbsql_fetch_array</function>, + <function>fbsql_fetch_object</function> + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-rollback"> + <refnamediv> + <refname>fbsql_rollback</refname> + <refpurpose>データベースへのトランザクションをロールバックする</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>fbsql_rollback</function></funcdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns: &true; on success, &false; on failure. + </para> + <para> + <function>fbsql_rollback</function> ends the current transaction by + rolling back all statements issued since last commit. + This command is only needed if autocommit is set to false. + </para> + <para> See also: + <function>fbsql_autocommit</function> and + <function>fbsql_commit</function> + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-set-lob-mode"> + <refnamediv> + <refname>fbsql_set_lob_mode</refname> + <refpurpose> + FrontBase結果セットのLOB取得モードを設定する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>fbsql_set_lob_mode</function></funcdef> + <paramdef>resource <parameter>result</parameter></paramdef> + <paramdef>string <parameter>database_name</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + 返り値: 成功時に&true; on success、エラー時に&false;。 + </para> + <para> + <function>fbsql_set_lob_mode</function> sets the mode for + retrieving LOB data from the database. When BLOB and CLOB data is + stored in FrontBase it can be stored direct or indirect. Direct + stored LOB data will always be fetched no matter the setting of + the lob mode. If the LOB data is less than 512 bytes it will + always be stored directly. + <itemizedlist> + <listitem> + <simpara> + FBSQL_LOB_DIRECT - LOB data is retrieved directly. When data + is fetched from the database with + <function>fbsql_fetch_row</function>, and other fetch + functions, all CLOB and BLOB columns will be returned as + ordinary columns. This is the default value on a new + FrontBase result. + </simpara> + </listitem> + <listitem> + <simpara> + FBSQL_LOB_HANDLE - LOB data is retrieved as handles to the + data. When data is fetched from the database with + <function>fbsql_fetch_row </function>, and other fetch + functions, LOB data will be returned as a handle to the data + if the data is stored indirect or the data if it is stored + direct. If a handle is returned it will be a 27 byte string + formatted as "@'000000000000000000000000'". + </simpara> + </listitem> + </itemizedlist> + </para> + <para> + <function>fbsql_create_blob</function>, + <function>fbsql_create_clob</function>, + <function>fbsql_read_blob</function>, + <function>fbsql_read_clob</function>も参照下さい。 </para> </refsect1> </refentry> @@ -1708,6 +2246,72 @@ </refsect1> </refentry> + <refentry id="function.fbsql-start-db"> + <refnamediv> + <refname>fbsql_start_db</refname> + <refpurpose> + ローカルまたはリモートサーバのデータベースを開始する + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>fbsql_start_db</function></funcdef> + <paramdef>string <parameter>database_name</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns: &true; on success, &false; on failure. + </para> + <para> + <function>fbsql_start_db</function> + </para> + <para> + See also: <function>fbsql_db_status</function> and + <function>fbsql_stop_db</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.fbsql-stop-db"> + <refnamediv> + <refname>fbsql_stop_db</refname> + <refpurpose> + ローカルまたはリモートサーバのデータベースを停止する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>fbsql_stop_db</function></funcdef> + <paramdef>string <parameter>database_name</parameter></paramdef> + <paramdef>resource + <parameter> + <optional>link_identifier</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns: &true; on success, &false; on failure. + </para> + <para> + <function>fbsql_stop_db</function> + </para> + <para> + <function>fbsql_db_status</function>および + <function>fbsql_start_db</function>も参照下さい。 + </para> + </refsect1> + </refentry> + <refentry id="function.fbsql-tablename"> <refnamediv> <refname>fbsql_tablename</refname> @@ -1729,18 +2333,20 @@ <function>fbsql_num_rows</function> function may be used to determine the number of tables in the result pointer. <example> - <title><function>fbsql_tablename</function> example</title> + <title><function>fbsql_tablename</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php fbsql_connect ("localhost", "_SYSTEM", ""); $result = fbsql_list_tables ("wisconsin"); $i = 0; -while ($i &lt; fbsql_num_rows ($result)) { +while ($i < fbsql_num_rows ($result)) { $tb_names[$i] = fbsql_tablename ($result, $i); - echo $tb_names[$i] . "&lt;BR>"; + echo $tb_names[$i] . "<BR>"; $i++; } -?&gt; +?> +]]> </programlisting> </example> </para> @@ -1771,6 +2377,148 @@ <para> <function>fbsql_warnings</function> は、FrontBaseの警告を有効または 無効にします。 + </para> + </refsect1> + </refentry> + + <refentry id='function.fbsql-database'> + <refnamediv> + <refname>fbsql_database</refname> + <refpurpose> + No description given yet + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_database</function></funcdef> + <paramdef>resource <parameter>link_identifier</parameter></paramdef> + <paramdef>string + <parameter><optional>database</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.fbsql-get-autostart-info'> + <refnamediv> + <refname>fbsql_get_autostart_info</refname> + <refpurpose> + No description given yet + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>fbsql_get_autostart_info</function></funcdef> + <paramdef>resource + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.fbsql-hostname'> + <refnamediv> + <refname>fbsql_hostname</refname> + <refpurpose> + No description given yet + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_hostname</function></funcdef> + <paramdef>resource <parameter>link_identifier</parameter></paramdef> + <paramdef>string + <parameter><optional>host_name</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.fbsql-password'> + <refnamediv> + <refname>fbsql_password</refname> + <refpurpose> + No description given yet + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_password</function></funcdef> + <paramdef>resource <parameter>link_identifier</parameter></paramdef> + <paramdef>string + <parameter><optional>password</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.fbsql-set-transaction'> + <refnamediv> + <refname>fbsql_set_transaction</refname> + <refpurpose> + トランザクションのロックとアイソレーションを設定する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>fbsql_set_transaction</function></funcdef> + <paramdef>resource <parameter>link_identifier</parameter></paramdef> + <paramdef>int <parameter>Locking</parameter></paramdef> + <paramdef>int <parameter>Isolation</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.fbsql-username'> + <refnamediv> + <refname>fbsql_username</refname> + <refpurpose> + No description given yet + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>fbsql_username</function></funcdef> + <paramdef>resource <parameter>link_identifier</parameter></paramdef> + <paramdef>string + <parameter><optional>username</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; </para> </refsect1> </refentry> Index: phpdoc/ja/functions/filepro.xml diff -u phpdoc/ja/functions/filepro.xml:1.8 phpdoc/ja/functions/filepro.xml:1.9 --- phpdoc/ja/functions/filepro.xml:1.8 Wed Dec 12 15:52:56 2001 +++ phpdoc/ja/functions/filepro.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.9 $ --> <reference id="ref.filepro"> <title>filePro 関数</title> <titleabbrev>filePro</titleabbrev> Index: phpdoc/ja/functions/filesystem.xml diff -u phpdoc/ja/functions/filesystem.xml:1.36 phpdoc/ja/functions/filesystem.xml:1.37 --- phpdoc/ja/functions/filesystem.xml:1.36 Wed Dec 12 15:52:56 2001 +++ phpdoc/ja/functions/filesystem.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.37 $ --> <reference id="ref.filesystem"> <title>ファイルシステム関数</title> <titleabbrev>ファイルシステム</titleabbrev> @@ -16,11 +17,16 @@ <funcprototype> <funcdef>string <function>basename</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> + <paramdef>string + <parameter><optional>suffix</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> この関数は、ファイルへのパスを有する文字列を引数とし、 - ファイルのベース名を返します。 + ファイルのベース名を返します。ファイル名が、 + <parameter>suffix</parameter>で終了する場合、この部分もカットされ + ます。 </para> <para> Windows では、スラッシュ(<literal>/</literal>)とバックスラッシュ @@ -30,11 +36,20 @@ <para> <example><title><function>basename</function>の例</title> <programlisting role="php"> -$path = "/home/httpd/html/index.php3"; -$file = basename ($path); // $file は"index.php3"にセットされる +<![CDATA[ +$path = "/home/httpd/html/index.php"; +$file = basename ($path); // $file is set to "index.php" +$file = basename ($path,".php"); // $file is set to "index" +]]> </programlisting> </example> </para> + <note> + <para> + パラメータ<parameter>suffix</parameter>は、PHP 4.1.0で追加されま + した。 + </para> + </note> <para> <function>dirname</function>も参照下さい。 </para> @@ -56,8 +71,8 @@ </funcprototype> </funcsynopsis> <para> - ファイル<parameter>filename</parameter>のグループを - <parameter>group</parameter>に変更しようと試みます。 + (名前または番号で指定した)ファイル<parameter>filename</parameter> + のグループを<parameter>group</parameter>に変更しようと試みます。 スーパーユーザのみがファイルのグループを任意に変更できます。 その他のユーザは、ファイルのグループをそのユーザがメンバーとして 属しているグループに変更できます。 @@ -69,15 +84,10 @@ <function>chown</function>および<function>chmod</function> も参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> - <refentry id="function.chmod"> <refnamediv> <refname>chmod</refname> @@ -103,9 +113,11 @@ (0)を付ける必要があります。 <informalexample> <programlisting role="php"> +<![CDATA[ chmod ("/somedir/somefile", 755); // 10 進数; おそらく間違い chmod ("/somedir/somefile", "u+rwx,go+rx"); // 文字列; 正しくない chmod ("/somedir/somefile", 0755); // 8 進数; 正しいモードの値 +]]> </programlisting> </informalexample> </para> @@ -116,11 +128,7 @@ <function>chown</function>および<function>chgrp</function> も参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -139,8 +147,9 @@ </funcprototype> </funcsynopsis> <para> - ファイルfilenameの所有者をユーザuserに変更しようと試みます。 - スーパーユーザのみがファイルの所有者を変更できます。 + ファイル<parameter>filename</parameter>の所有者を(名前または番号 + で指定した)ユーザ<parameter>user</parameter>に変更しようと試みま + す。スーパーユーザのみがファイルの所有者を変更できます。 </para> <para> 成功すると&true;を返し、そうでなければ&false;を返します。 @@ -149,6 +158,7 @@ <function>chown</function>および<function>chmod</function> も参照下さい。 </para> + &note.no-windows; </refsect1> </refentry> @@ -224,14 +234,24 @@ <example> <title><function>copy</function>の例</title> <programlisting role="php"> +<![CDATA[ if (!copy($file, $file.'.bak')) { - print ("$file へのコピーに失敗しました...&lt;br>\n"); + print ("failed to copy $file...<br>\n"); } +]]> </programlisting> </example> </para> + <warning> + <para> + コピー先のファイルが既に存在する場合、上書きされます。 + </para> + </warning> <para> - <function>rename</function>も参照下さい。 + <function>move_uploaded_file</function>、 + <function>rename</function>、 + <link linkend="features.file-upload">ファイルアップロード処理 + </link>に関するマニュアルのセクションも参照下さい。 </para> </refsect1> </refentry> @@ -287,8 +307,10 @@ <example> <title><function>dirname</function>の例</title> <programlisting role="php"> +<![CDATA[ $path = "/etc/passwd"; $file = dirname ($path); // $file は "/etc" にセットされる +]]> </programlisting> </example> </para> @@ -298,16 +320,16 @@ </refsect1> </refentry> - <refentry id="function.diskfreespace"> + <refentry id="function.disk-free-space"> <refnamediv> - <refname>diskfreespace</refname> + <refname>disk_free_space</refname> <refpurpose>ディレクトリの利用可能なスペースを返す</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>float <function>diskfreespace</function></funcdef> + <funcdef>float <function>disk_free_space</function></funcdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -317,9 +339,62 @@ </para> <para> <example> - <title><function>diskfreespace</function>の例</title> + <title><function>disk_free_space</function>の例</title> + <programlisting role="php"> +<![CDATA[ +$df = disk_free_space("/"); // $dfは"/"で利用可能なバイト数となります。 +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id="function.diskfreespace"> + <refnamediv> + <refname>diskfreespace</refname> + <refpurpose><function>disk_free_space</function>へのエイリアス</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>float <function>diskfreespace</function></funcdef> + <paramdef>string <parameter>directory</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + この関数は、<function>disk_free_space</function>への古いエイリア + スです。替わりにこの関数を使用して下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.disk-total-space"> + <refnamediv> + <refname>disk_total_space</refname> + <refpurpose>ディレクトリの全体サイズを返す</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>float <function>disk_total_space</function></funcdef> + <paramdef>string <parameter>directory</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + ディレクトリを含む文字列を指定して下さい。この関数は、ファイルシ + ステムまたはディスクパーティションに対応する全体バイト数を返しま + す。 + </para> + <para> + <example> + <title><function>disk_total_space</function>の例</title> <programlisting role="php"> -$df = diskfreespace("/"); // $dfは"/"で利用可能なバイト数となります。 +<![CDATA[ +$df = disk_total_space("/"); // $dfは、"/"で利用可能な全体バイト数 +]]> </programlisting> </example> </para> @@ -335,7 +410,7 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>fclose</function></funcdef> + <funcdef>bool <function>fclose</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -489,17 +564,19 @@ 込み、出力します。 </title> <programlisting role="php"> +<![CDATA[ $row = 1; $fp = fopen ("test.csv","r"); while ($data = fgetcsv ($fp, 1000, ",")) { $num = count ($data); - print "&lt;p> $num fields in line $row: &lt;br>"; + print "<p> $num fields in line $row: <br>"; $row++; - for ($c=0; $c&lt;$num; $c++) { - print $data[$c] . "&lt;br>"; + for ($c=0; $c < $num; $c++) { + print $data[$c] . "<br>"; } } fclose ($fp); +]]> </programlisting> </example> </refsect1> @@ -516,14 +593,17 @@ <funcprototype> <funcdef>string <function>fgets</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int + <parameter><optional>length</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> - fpで指定したファイルポインタから最大length-1バイト読み出し、 - その文字列を返します。読み出しは、length-1バイト読み出したか、 - (返り値に含まれる)改行文字を検出したか、 - EOFに達したかのいずれかが起こった時点で終了します。 + fpで指定したファイルポインタから最大length-1バイト読み出し、その + 文字列を返します。読み出しは、length-1バイト読み出したか、(返り値 + に含まれる)改行文字を検出したか、EOFに達したかのいずれかが起こっ + た時点で終了します。lengthが指定されない場合、デフォルトは1kまた + は1024バイトとなります。 </para> <para> エラーが起こった場合、&false;を返します。 @@ -546,15 +626,23 @@ <example> <title>行毎にファイルを読み込む</title> <programlisting role="php"> +<![CDATA[ $fd = fopen ("/tmp/inputfile.txt", "r"); while (!feof ($fd)) { $buffer = fgets($fd, 4096); echo $buffer; } fclose ($fd); +]]> </programlisting> </example> </para> + <note> + <simpara> + <parameter>length</parameter>パラメータは、PHP 4.2.0でオプション + となりました。 + </simpara> + </note> <para> <function>fread</function>, <function>fopen</function>, <function>popen</function>, @@ -593,8 +681,8 @@ ことができます。 <note> <para> - <parameter>allowable_tags</parameter>は、PHP 3.0.13、PHP4B3で追加 - されました。 + <parameter>allowable_tags</parameter>は、PHP 3.0.13、PHP 4.0.0 + で追加されました。 </para> </note> </para> @@ -638,19 +726,23 @@ <para> <informalexample> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php // Webページを配列として取得し、出力します。 -$fcontents = file ('http://www.php.net'); +$fcontents = file ('http://www.php.net/'); while (list ($line_num, $line) = each ($fcontents)) { - echo "&lt;b&gt;Line $line_num:&lt;/b&gt; " . htmlspecialchars ($line) . "&lt;br&gt;\n"; + echo "<b>Line $line_num:</b>; ", htmlspecialchars ($line), "<br>\n"; } // Webページを文字列として取得します。 -$fcontents = join ( '', file ( 'http://www.php.net')); -?&gt; +$fcontents = join ('', file ('http://www.php.net/')); +?> +]]> </programlisting> </informalexample> </para> + &note.not-bin-safe; + &tip.fopen-wrapper; <para> <function>readfile</function>,<function>fopen</function>, <function>fsockopen</function>,<function>popen</function>も参照下 @@ -709,18 +801,16 @@ この関数の結果はキャッシュされます。詳細は、 <function>clearstatcache</function>を参照下さい。 </simpara> - <note> - <para> - ファイルのatimeは、ファイルのデータブロックが読み込まれる度 - に変更されるとみなされます。この仕様は、アプリケーションが非常に - 多くのファイルまたはディレクトリに常にアクセスする場合に性能上の - 負荷となる可能性があります。いくつかのUNIXファイルシステムでは、 - このようなアプリケーションの性能を向上させるためにatimeの更新を無 - 効としてマウントすることが可能です。USENETのニューススプールが一 - 般的な例です。このようなファイルシステムでは、この関数は使用でき - ません。 - </para> - </note> + <simpara> + 注意: ファイルのatimeは、ファイルのデータブロックが読み込まれる度 + に変更されるとみなされます。この仕様は、アプリケーションが非常に + 多くのファイルまたはディレクトリに常にアクセスする場合に性能上の + 負荷となる可能性があります。いくつかのUNIXファイルシステムでは、 + このようなアプリケーションの性能を向上させるためにatimeの更新を無 + 効としてマウントすることが可能です。USENETのニューススプールが一 + 般的な例です。このようなファイルシステムでは、この関数は使用でき + ません。 + </simpara> <simpara> この関数は、<link linkend="features.remote-files">リモートファイ ル</link> では動作しません。評価するファイルはサーバのファイルシ @@ -750,23 +840,19 @@ この関数の結果はキャッシュされます。詳細は、 <function>clearstatcache</function> を参照下さい。 </para> - <note> - <para> - 多くのUNIXファイルシステムでは、i-ノードが変更された際、つま - り、パーミッション、所有者、グループ、または他のメタデータが書き - 込まれた際に、ファイルが変更されたとみなされます。 - <function>filemtime</function>(この関数はWebページ上で"Last - Modified"フッタを作成したい場合に使用するものです。)および - <function>fileatime</function>も参照下さい。 - </para> - </note> - <note> - <para> - いくつかのUNIXでは、ファイルのctimeはファイルの作成時間として参照 - されます。これは間違っています。多くのUNIXファイルシステムでは - UNIXファイルの作成時間は存在しません。 - </para> - </note> + <para> + 注意: 多くのUNIXファイルシステムでは、i-ノードが変更された際、つ + まり、パーミッション、所有者、グループ、または他のメタデータが書 + き込まれた際に、ファイルが変更されたとみなされます。 + <function>filemtime</function>(この関数はWebページ上で"Last + Modified"フッタを作成したい場合に使用するものです。)および + <function>fileatime</function>も参照下さい。 + </para> + <para> + いくつかのUNIXでは、ファイルのctimeはファイルの作成時間として参照 + されます。これは間違っています。多くのUNIXファイルシステムでは + UNIXファイルの作成時間は存在しません。 + </para> <simpara> この関数は、<link linkend="features.remote-files">リモートファイ ル</link> では動作しません。評価するファイルはサーバのファイルシ @@ -797,11 +883,9 @@ この関数の結果はキャッシュされます。詳細は、 <function>clearstatcache</function>を参照下さい。 </para> + &note.no-windows; <note> <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - <simpara> この関数は、<link linkend="features.remote-files">リモートファイ ル</link> では動作しません。評価するファイルはサーバのファイルシ ステムによりアクセス可能である必要があります。 @@ -835,11 +919,7 @@ ル</link> では動作しません。評価するファイルはサーバのファイルシ ステムによりアクセス可能である必要があります。 </simpara> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -869,14 +949,12 @@ ル</link> では動作しません。評価するファイルはサーバのファイルシ ステムによりアクセス可能である必要があります。 </simpara> - <note> - <para> - この関数は、ファイルのブロックデータが書き込まれた時間を返します。 - これは、ファイルの内容が変更された際の時間です。ページのフッタで - 使用するために出力可能な修正時刻を取得するには、この関数の結果を - <function>date</function>に使用して下さい。 - </para> - </note> + <para> + 注意:この関数は、ファイルのブロックデータが書き込まれた時間を返し + ます。これは、ファイルの内容が変更された際の時間です。ページのフッ + タで使用するために出力可能な修正時刻を取得するには、この関数の結 + 果を<function>date</function>に使用して下さい。 + </para> </refsect1> </refentry> @@ -907,11 +985,7 @@ ル</link> では動作しません。評価するファイルはサーバのファイルシ ステムによりアクセス可能である必要があります。 </simpara> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -940,11 +1014,6 @@ この関数の結果はキャッシュされます。詳細は、 <function>clearstatcache</function>を参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> </refsect1> </refentry> @@ -976,7 +1045,6 @@ </refsect1> </refentry> - <refentry id="function.filetype"> <refnamediv> <refname>filetype</refname> @@ -1080,14 +1148,26 @@ <function>flock</function> は成功時に&true;、 (例えばロックが確保できなかった場合等の)エラー時に&false;を返します。 </simpara> + <note> + <para> + <function>flock</function>は、ファイルポインタを必要とするため、 + (<function>fopen</function>へ引数"w"または"w+"を指定して)書き込 + みモードでオープンすることにより丸めるファイルにアクセス保護する + 特別なロックファイルを使用する必要があるかもしれません。 + </para> + </note> <warning> <para> - ほとんどのオーペレーティングシステムで - <function>flock</function> はプロセスレベルで実装されています。 - ISAPIのようなマルチスレッド型のサーバーAPIを使用している場合、同 - じサーバーインスタンスの並列スレッドで実行されている他のPHPスク - リプトに対してファイルを保護する際に <function>flock</function> - を使用することはできません。 + <function>flock</function>はNFS及び他の多くのネットワークファイ + ルシステムでは動作しません。詳細についてはオペレーティングシステ + ムのドキュメントを確認下さい。 + </para> + <para> + いくつかのオーペレーティングシステムで<function>flock</function> + はプロセスレベルで実装されています。ISAPIのようなマルチスレッド + 型のサーバーAPIを使用している場合、同じサーバーインスタンスの並 + 列スレッドで実行されている他のPHPスクリプトに対してファイルを保 + 護する際に <function>flock</function>を使用することはできません! </para> </warning> </refsect1> @@ -1210,10 +1290,12 @@ <example> <title><function>fopen</function>の例</title> <programlisting role="php"> +<![CDATA[ $fp = fopen ("/home/rasmus/file.txt", "r"); $fp = fopen ("/home/rasmus/file.gif", "wb"); $fp = fopen ("http://www.php.net/", "r"); $fp = fopen ("ftp://user:password@example.com/", "w"); +]]> </programlisting> </example> </para> @@ -1228,7 +1310,9 @@ エスケープするかフォワードスラッシュを使用することに注意して下さい。 <informalexample> <programlisting role="php"> +<![CDATA[ $fp = fopen ("c:\\data\\info.txt", "r"); +]]> </programlisting> </informalexample> </para> @@ -1256,11 +1340,12 @@ </funcprototype> </funcsynopsis> <simpara> - 与えられたファイルポインタをEOFまで読み、結果を標準出力に書き出します。 + 与えられたファイルポインタをEOFまで読み、結果を標準出力に書き出し + ます。 </simpara> <simpara> エラーが起こった場合、<function>fpassthru</function>は - &false;を返します。 + &false;を返します。 </simpara> <simpara> ファイルポインタは有効なものでなければならず、また @@ -1276,6 +1361,14 @@ <function>readfile</function>を使用することが可能です。 この場合、<function>fopen</function>コールは必要ありません。 </simpara> + <note> + <para> + <function>fpassthru</function>をWindowsシステムのバイナリファイ + ルで使用する場合、<function>fopen</function>をコールする際に + モードに<literal>b</literal>を追加してバイナリモードでファイルを + オープンするようにして下さい。 + </para> + </note> <simpara> <function>readfile</function>, <function>fopen</function>, <function>popen</function>, <function>fsockopen</function> @@ -1336,11 +1429,13 @@ <para> <informalexample> <programlisting role="php"> +<![CDATA[ // ファイルの中身を読んで文字列に格納する $filename = "/usr/local/something.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); +]]> </programlisting> </informalexample> </para> @@ -1354,10 +1449,12 @@ <para> <informalexample> <programlisting role="php"> +<![CDATA[ $filename = "c:\\files\\somepic.gif"; $fd = fopen ($filename, "rb"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); +]]> </programlisting> </informalexample> </para> @@ -1400,23 +1497,27 @@ された場合、この関数は、代入された値の数を返します。オプション引 数は参照渡しとする必要があります。 <example> - <title><function>fscanf</function> の例</title> + <title><function>fscanf</function>の例</title> <programlisting role="php"> +<![CDATA[ $fp = fopen ("users.txt","r"); while ($userinfo = fscanf ($fp,"%s\t%s\t%s\n")) { list ($name, $profession, $countrycode) = $userinfo; //... 値を用いた処理 } fclose($fp); +]]> </programlisting> </example> <example> <title>users.txt</title> <programlisting> +<![CDATA[ javier argonaut pe hiroshi sculptor jp robert slacker us luigi florist it +]]> </programlisting> </example> </para> @@ -1481,7 +1582,7 @@ </para> <note> <para> - 引数<parameter>whence</parameter>はPHP4.0RC1以降で追加されました。 + 引数<parameter>whence</parameter>はPHP 4.0.0以降で追加されました。 </para> </note> <para> @@ -1621,10 +1722,14 @@ 事象により書き込みは中止されます。 </simpara> <simpara> - <parameter>length</parameter> パラメータが指定されている場合、 - <link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link> - 構成オプションは無視され、<parameter>string</parameter>からの - スラッシュ文字の取り除きは行われないことに注意して下さい。 + <function>fwrite</function>は書き込んだバイト数、またはエラー時に- + 1を返します。 + </simpara> + <simpara> + <parameter>length</parameter> パラメータが指定されている場合、 + <link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link> + 構成オプションは無視され、<parameter>string</parameter>からの + スラッシュ文字の取り除きは行われないことに注意して下さい。 </simpara> <note> <para> @@ -1680,12 +1785,14 @@ <example> <title><function>set_file_buffer</function>の例</title> <programlisting role="php"> +<![CDATA[ $fp=fopen($file, "w"); if($fp){ set_file_buffer($fp, 0); fputs($fp, $output); fclose($fp); } +]]> </programlisting> </example> </para> @@ -1713,16 +1820,16 @@ <parameter>filename</parameter>が存在して、かつそれが ディレクトリであれば&true;を返します。 </para> + <para> + この関数の結果はキャッシュされます。詳細は、 + <function>clearstatcache</function>を参照下さい。 + </para> <simpara> この関数は、<link linkend="features.remote-files">リモートファイ ル</link>では動作しません。評価されるファイルはサーバのファイルシ ステムによりアクセス可能である必要があります。 </simpara> <para> - この関数の結果はキャッシュされます。詳細は、 - <function>clearstatcache</function>を参照下さい。 - </para> - <para> <function>is_file</function>, <function>is_link</function> も参照下さい。 </para> @@ -1759,11 +1866,6 @@ <function>is_dir</function>および<function>is_link</function> も参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> </refsect1> </refentry> @@ -1811,10 +1913,10 @@ </funcprototype> </funcsynopsis> <para> - <parameter>filename</parameter>が存在して、かつっ?が - シンボリックリンクであれば&true;を返します。 + <parameter>filename</parameter>が存在し、かつシンボリックリンクで + あれば&true;を返します。 </para> - <para> + <para> この関数の結果はキャッシュされます。詳細は、 <function>clearstatcache</function> を参照下さい。 </para> @@ -1827,11 +1929,7 @@ ル</link>では動作しません。評価されるファイルはサーバのファイルシ ステムによりアクセス可能である必要があります。 </simpara> - <note> - <simpara> - この関数は、Windowsシステムでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -1849,13 +1947,13 @@ </funcprototype> </funcsynopsis> <para> - <parameter>filename</parameter>が存在し、それが - 読み込み可能であれば&true;を返します。 + <parameter>filename</parameter>が存在し、それが読み込み可能であれ + ば&true;を返します。 </para> <para> - PHPは、Webサーバが実行されているユーザ ID('nobody' が多い) - でファイルにアクセスすることを覚えておいて下さい。 - セーフモードの制限は働きません。 + PHPは、Webサーバが実行されているユーザ ID('nobody' が多い)でファ + イルにアクセスすることを覚えておいて下さい。セーフモードの制限は + 働きません。 </para> <para> この関数の結果はキャッシュされます。詳細は、 @@ -1991,11 +2089,7 @@ <function>linkinfo</function>、<function>readlink</function> も参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -2024,11 +2118,7 @@ <function>symlink</function>, <function>link</function>, <function>readlink</function>も参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -2051,11 +2141,14 @@ 作成しようと試みます。 </para> <para> - モードを8進数で指定する場合には、先頭にゼロを付ける必要が - あることに注意して下さい。 + モードを8進数で指定する必要があり、このため、先頭にゼロを付ける必 + 要があることに注意して下さい。modeは、カレントのumaskでも修正され + ます。umaskは、<function>umask</function>により変更可能です。 <informalexample> <programlisting role="php"> +<![CDATA[ mkdir ("/path/to/my/dir", 0700); +]]> </programlisting> </informalexample> </para> @@ -2083,10 +2176,6 @@ </funcprototype> </funcsynopsis> <para> - この関数は、PHP 3.0.16 より後のバージョンのPHP 3および4.0.2より後 - のバージョンの PHP 4 でのみ利用可能です。 - </para> - <para> この関数は、<parameter>filename</parameter>で指定されたファイルが (PHPのHTTP POSTアップロード機構によりアップロードされたという意味 で)有効なアップロードファイルであるかどうかを確認します。そのファ @@ -2109,9 +2198,12 @@ 合には、その内容をユーザ、または同じシステム上の他のユーザにさえ 暴かれる可能性があるため、特に重要です。 </para> - &note.sm.uidcheck; - + <warning> + <para> + コピー先のファイルが既に存在する場合、上書きされます。 + </para> + </warning> <para> 簡単な使用例については、 <function>is_uploaded_file</function>および<link @@ -2121,6 +2213,115 @@ </refsect1> </refentry> + <refentry id="function.parse-ini-file"> + <refnamediv> + <refname>parse_ini_file</refname> + <refpurpose>設定ファイルをパースする</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>parse_ini_file</function></funcdef> + <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>bool + <parameter> + <optional>process_sections</optional> + </parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>parse_ini_file</function> は、 + <parameter>filename</parameter>で指定したiniファイルをロードし、 + 連想配列としてその設定値を返します。 + 直近の<parameter>process_sections</parameter>パラメータに&true; + を設定することにより、セクション名と設定が含まれた多次元の配列を + 得ることができます。デフォルトでは、 + <parameter>process_sections</parameter>は、&false;です。 + </para> + <note> + <para> + この関数は、<filename>php.ini</filename>ファイルには何もしません。 + このファイルはスクリプトを実行している時には既に処理されています。 + この関数は、アプリケーション個有の設定ファイルを読み込む際に使用 + 可能です。 + </para> + </note> + <para> + 初期ファイルの構造は、<filename>php.ini</filename>の構造に似てい + ます。 + </para> + <para> + <example> + <title>sample.iniの内容</title> + <programlisting> +<![CDATA[ +; This is a sample configuration file +; Comments start with ';', as in php.ini + +[first_section] +one = 1 +five = 5 + +[second_section] +path = /usr/local/bin +]]> + </programlisting> + </example> + </para> + <para> + <example> + <title><function>parse_ini_file</function>の例</title> + <programlisting> +<![CDATA[ +<?php + +// Parse without sections +$ini_array = parse_ini_file("sample.ini"); +print_r($ini_array); + +// Parse with sections +$ini_array = parse_ini_file("sample.ini", TRUE); +print_r($ini_array); + +?> +]]> + </programlisting> + </example> + </para> + <para> + 出力は以下のようになります: + <informalexample> + <programlisting> +<![CDATA[ +Array +( + [one] => 1 + [five] => 5 + [path] => /usr/local/bin +) +Array +( + [first_section] => Array + ( + [one] => 1 + [five] => 5 + ) + + [second_section] => Array + ( + [path] => /usr/local/bin + ) + +) +]]> + </programlisting> + </informalexample> + </para> + </refsect1> + </refentry> + <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> @@ -2142,9 +2343,10 @@ </para> <para> <example> - <title><function>pathinfo</function> の例</title> + <title><function>pathinfo</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $path_parts = pathinfo("/www/htdocs/index.html"); @@ -2152,7 +2354,8 @@ echo $path_parts["basename"] . "\n"; echo $path_parts["extension"] . "\n"; -?&gt; +?> +]]> </programlisting> </example> </para> @@ -2160,15 +2363,17 @@ 出力は次のようになります。 <informalexample> <programlisting> +<![CDATA[ /www/htdocs index.html html +]]> </programlisting> </informalexample> </para> <para> - <function>dirname</function>, - <function>basename</function>, <function>realpath</function> も参 + <function>dirname</function>, <function>basename</function>, + <function>parse_url</function>, <function>realpath</function>も参 照下さい。 </para> </refsect1> @@ -2238,7 +2443,9 @@ <para> <informalexample> <programlisting role="php"> +<![CDATA[ $fp = popen ("/bin/ls", "r"); +]]> </programlisting> </informalexample> </para> @@ -2280,8 +2487,8 @@ オープンされ、返されたテキストが標準出力に書き出されます。 </para> <para> - HTTPリダイレクトは処理されないので、ディレクトリ名を - 指定する場合は末尾にスラッシュを置く必要があります。 + PHP 4.0.5より前のバージョンは、HTTPリダイレクトを処理しません。こ + のため、ディレクトリには末尾のスラッシュを含める必要があります。 </para> <para> <parameter>filename</parameter>が "ftp://"(大文字小文字は区別されません) @@ -2330,11 +2537,7 @@ <function>symlink</function>,<function>readlink</function>, <function>linkinfo</function>も参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -2386,7 +2589,13 @@ ファイルポインタは有効なものでなければならず、また <function>fopen</function>で正常にオープンされたファイルを 指している必要があります。 - </para> + </para> + <note> + <para> + 追記("a")モードでファイルをオープンした場合、ファイル位置によら + ずファイルに書き込まれるデータは常に追加されます。 + </para> + </note> <para> <function>fseek</function>, <function>ftell</function>も参照下さい。 </para> @@ -2455,7 +2664,16 @@ <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> <listitem><simpara>number of blocks allocated</simpara></listitem> </orderedlist> - * - st_blksizeタイプをサポートしているシステムでのみ有効です《 その他のシステム(_とHばWindowsなど)では-1を返します。</para> + * - st_blksizeタイプをサポートしているシステムでのみ有効です。 + (Windowsのような)その他のシステムでは-1を返します。 + </para> + <para> + エラーの場合は、&false;を返します。 + </para> + <para> + <function>stat</function>は、<function>fopen</function>のように + URLを処理しません。 + </para> <para> この関数の結果はキャッシュされます。詳細は、 <function>clearstatcache</function>を参照下さい。 @@ -2535,7 +2753,9 @@ <example> <title><function>realpath</function>の例</title> <programlisting role="php"> -$real_path = realpath("../../index.php"); +<![CDATA[ +$real_path = realpath ("../../index.php"); +]]> </programlisting> </example> </para> @@ -2564,17 +2784,12 @@ <para> ハードリンクを作るには<function>link</function>、そして <function>readlink</function>と<function>linkinfo</function> - を参照下っD。 + を参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> - <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> @@ -2593,22 +2808,34 @@ ユニークなテンポラリファイル名を指定したディレクトリに作成します。 指定したディレクトリが存在しない場合、 <function>tempnam</function> は、システムのテンポラリディレクトリ - にファイル名を生成します。 + にあるファイル名を生成し、その名前を返します。 </para> <para> - 関数<function>tempnam</function>の動作はシステムに依存します。 - WindowsにおいてTMP環境変数は<parameter>dir</parameter>パラメータ - を上書きします。Linuxにおいては、TMPDIR環境変数が優先されます。 - 一方、SVR4においては指定したディレクトリが存在する場合は、 - 常に<parameter>dir</parameter>パラメータを使用します。 - 疑問がある場合は、tempnam(3)に関するシステムドキュメントを参照下さい。 + PHP 4.0.6より前では、関数<function>tempnam</function>の動作はシス + テムに依存していました。WindowsにおいてTMP環境変数は + <parameter>dir</parameter>パラメータを上書きします。Linuxにおいて + は、TMPDIR環境変数が優先されます。一方、SVR4においては指定したディ + レクトリが存在する場合は、常に<parameter>dir</parameter>パラメー + タを使用します。疑問がある場合は、tempnam(3)に関するシステムドキュ + メントを参照下さい。 </para> <para> - 新しい中間ファイル名を返し、失敗すると空の文字列を返します。 + 新しいテンポラリファイル名を返し、失敗時にはすると&false;文字列を + 返します。 <example> <title><function>tempnam</function>の例</title> <programlisting role="php"> -$tmpfname = tempnam ( "/tmp", "FOO" ); +<![CDATA[ +$tmpfname = tempnam ("/tmp", "FOO"); + +$fp = fopen($tmpfname, "w"); +fwrite($fp, "writing to tempfile"); +fclose($fp); + +// ここで何か行う + +unlink($tmpfname); +]]> </programlisting> </example> </para> @@ -2617,11 +2844,14 @@ この関数の動作は、4.0.3 で変更され、文字列が生成された時間の間や スクリプトがファイルの作成にとりかかる前にファイルシステムに現れ る可能性がある場合のファイルとの競合を回避するためにもテンポラリ - ファイルは作成されます。 + ファイルは作成されます。このファイルは自動的に削除されないため、 + 不要となった場合にはこのファイルを削除する必要があることに注意し + て下さい。 </simpara> </note> <para> - <function>tmpfile</function>も参照下さい。 + <function>tmpfile</function>, <function>unlink</function>も参照下 + さい。 </para> </refsect1> </refentry> @@ -2636,7 +2866,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>tmpfile</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> <para> @@ -2652,6 +2882,18 @@ い。 </para> <para> + <example> + <title><function>tmpfile</function>の例</title> + <programlisting role="php"> +<![CDATA[ +$temp = tmpfile(); +fwrite($temp, "writing to tempfile"); +fclose($temp); // ファイルを削除します +]]> + </programlisting> + </example> + </para> + <para> <function>tempnam</function>も参照下さい。 </para> </refsect1> @@ -2685,11 +2927,14 @@ <example> <title><function>touch</function>の例</title> <programlisting role="php"> -if ( touch($FileName) ) { - print "$FileName modification time has been changed to todays date and time"; +<![CDATA[ +if (touch ($FileName)) { + print "$FileName modification time has been + changed to todays date and time"; } else { - print "Sorry Could Not change modification time of $FileName"; + print "Sorry Could Not change modification time of $FileName"; } +]]> </programlisting> </example> </para> @@ -2711,19 +2956,14 @@ </funcsynopsis> <para> <function>umask</function>はPHPのumaskをmask &amp; 0777にセットし、 - 元のumask値を返します。 - PHPがサーバ・モジュールとして動作中の場合、各リクエストが - 終了するたびにumaskは元の値に戻されます。 + 元のumask値を返します。PHPがサーバ・モジュールとして動作中の場合、 + 各リクエストが終了するたびにumaskは元の値に戻されます。 </para> <para> <function>umask</function>を引数無しで実行すると、単に現在の umask値を返します。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> + &note.no-windows; </refsect1> </refentry> @@ -2745,16 +2985,11 @@ と動作は同じです。 </para> <para> - 0を返し、エラーの場合は&false;を返します。 + &return.success; </para> <para> ディレクトリの削除には、<function>rmdir</function>を参照下さい。 </para> - <note> - <simpara> - この関数は、Windowsでは動作しません。 - </simpara> - </note> </refsect1> </refentry> Index: phpdoc/ja/functions/ftp.xml diff -u phpdoc/ja/functions/ftp.xml:1.12 phpdoc/ja/functions/ftp.xml:1.13 --- phpdoc/ja/functions/ftp.xml:1.12 Wed Dec 12 15:52:57 2001 +++ phpdoc/ja/functions/ftp.xml Sat Jan 19 09:58:31 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.13 $ --> <reference id="ref.ftp"> <title>FTP 関数</title> <titleabbrev>FTP</titleabbrev> @@ -9,17 +10,13 @@ Protocol (FTP)を使用してファイルサーバにアクセスするクライアントの 実装です。 </para> - - <para> - FTP は、File Transfer Protocol を意味します。 - </para> <para> FTP モジュールを使用する際、次の定数が定義されます。 <constant>FTP_ASCII</constant>および<constant>FTP_BINARY</constant> </para> <para> - PHPの設定でFTP関数を使用するためには、PHP 4をインストールする場合に - は、オプション <link linkend="install.configure.enable-ftp"> + PHPの設定でFTP関数を使用するためには、PHP 4をインストールする場合、 + オプション <link linkend="install.configure.enable-ftp"> <option>--enable-ftp</option></link>、PHP 3を使用している場合には、 <link linkend="install.configure.with-ftp"> <option>--with-ftp</option></link>を使用する必要があります。 @@ -28,35 +25,37 @@ <example> <title><function>ftp</function> の例</title> <programlisting> -&lt;?php -// 基本的な接続を設定 -$conn_id = ftp_connect("$ftp_server"); +<![CDATA[ +<?php +// set up basic connection +$conn_id = ftp_connect($ftp_server); -// ユーザ名とパスワードを指定してログイン -$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass"); +// login with username and password +$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); -// 接続を確認 +// check connection if ((!$conn_id) || (!$login_result)) { echo "Ftp connection has failed!"; - echo "Attempted to connect to $ftp_server for user $user"; + echo "Attempted to connect to $ftp_server for user $ftp_user_name"; die; } else { - echo "Connected to $ftp_server, for user $user"; + echo "Connected to $ftp_server, for user $ftp_user_name"; } -// ファイルをアップロードする -$upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY); +// upload the file +$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); -// アップロードのステータスを確認 +// check upload status if (!$upload) { echo "Ftp upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } -// FTPストリームを閉じる -ftp_quit($conn_id); +// close the FTP stream +ftp_close($conn_id); ?> +]]> </programlisting> </example> </para> @@ -71,27 +70,41 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_connect</function></funcdef> + <funcdef>resource <function>ftp_connect</function></funcdef> <paramdef>string <parameter>host</parameter></paramdef> <paramdef>int - <parameter> - <replaceable><optional>port</optional></replaceable> - </parameter> + <parameter><optional>port</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>timeout</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に FTP ストリームを、エラーの場合に &false; を返します。</para> + 成功時にFTPストリーム、エラーの場合に&false;を返します。 + </para> <para> - <function>ftp_connect</function> は、指定した <parameter>host</parameter> - への FTP 接続をオープンします。 - <parameter>port</parameter> パラメータは別のポートに接続することを - 指定します。これを省略するか 0 にした場合、デフォルトの FTP ポート、 - つまり、21 が使用されます。</para> + <function>ftp_connect</function>は、指定した + <parameter>host</parameter>へのFTP接続をオープンします。 + <parameter>port</parameter>パラメータは別のポートに接続することを + 指定します。これを省略するか0にした場合、デフォルトのFTPポート、 + つまり、21が使用されます。 + </para> + <para> + パラメータ<parameter>timeout</parameter>は、以降の全てのネットワー + ク処理のタイムアウトを指定します。省略された場合、デフォルト値は、 + 90秒となります。timeoutは、<function>ftp_set_option</function>お + よび<function>ftp_get_option</function>でいつでも変更および取得可 + 能です。 + <note> + <para> + このパラメータは、CVS版でのみ利用可能です。 + </para> + </note> + </para> </refsect1> </refentry> - <refentry id="function.ftp-login"> <refnamediv> <refname>ftp_login</refname> @@ -101,16 +114,18 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_login</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_login</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - 成功時に &true;、エラー時に &false; を返します。</para> <para> - 指定した FTP ストリームにログインします。</para> + 指定したFTPストリームにログインします。 + </para> + <para> + 成功時に&true;、エラー時に&false;を返します。 + </para> </refsect1> </refentry> @@ -124,11 +139,12 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>ftp_pwd</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 現在のディレクトリを返します。エラーの場合は、&false; を返します。 + カレントのディレクトリを返します。エラーの場合は、&false; を返し + ます。 </para> </refsect1> </refentry> @@ -142,14 +158,16 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_cdup</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_cdup</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - 成功時に &true;、エラー時に &false; を返します。</para> <para> - 親ディレクトリに移動します。</para> + 親ディレクトリに移動します。 + </para> + <para> + 成功時に &true;、エラー時に &false; を返します。 + </para> </refsect1> </refentry> @@ -162,15 +180,17 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_chdir</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_chdir</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - 成功時に &true;、エラー時に &false; を返します。</para> <para> - 指定した <parameter>directory</parameter> に移動します。</para> + 指定した<parameter>directory</parameter>に移動します。 + </para> + <para> + 成功時に&true;、エラー時に&false;を返します。 + </para> </refsect1> </refentry> @@ -184,14 +204,17 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>ftp_mkdir</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - 成功した時に、新規に作成したディレクトリ名、エラー時に&false;を返します。</para> <para> - 指定した <parameter>directory</parameter> を作成します。</para> + 指定した<parameter>directory</parameter>を作成します。 + </para> + <para> + 成功した時に、新規に作成したディレクトリ名、エラー時に&false;を返 + します。 + </para> </refsect1> </refentry> @@ -204,15 +227,17 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_rmdir</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_rmdir</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - 成功時に &true;、エラー時に &false; を返します。</para> <para> - 指定した <parameter>directory</parameter> を削除します。</para> + 指定した<parameter>directory</parameter>を削除します。 + </para> + <para> + 成功時に &true;、エラー時に &false; を返します。 + </para> </refsect1> </refentry> @@ -226,12 +251,14 @@ <funcsynopsis> <funcprototype> <funcdef>array <function>ftp_nlist</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時にファイル名の配列を、エラー時に &false; を返します。</para> + 成功時に指定したディレクトリにあるファイル名の配列を、エラー時に + &false;を返します。 + </para> </refsect1> </refentry> @@ -247,7 +274,7 @@ <funcsynopsis> <funcprototype> <funcdef>array <function>ftp_rawlist</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -273,7 +300,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>ftp_systype</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -291,21 +318,21 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_pasv</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> - <paramdef>int <parameter>pasv</parameter></paramdef> + <funcdef>bool <function>ftp_pasv</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> + <paramdef>bool <parameter>pasv</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に&true;、エラー時に&false;を返します。 - </para> - <para> <function>ftp_pasv</function> は、<parameter>pasv</parameter> パ ラメータが &true; の場合にパッシブモードをオンにします。 (<parameter>pasv</parameter> が &false; の場合は、パッシブモードを オフにします) パッシモードでは、データ接続はサーバーではなくクラ イアントにより初期化されます。 </para> + <para> + 成功時に&true;、エラー時に&false;を返します。 + </para> </refsect1> </refentry> @@ -318,17 +345,14 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_get</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_get</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>local_file</parameter></paramdef> <paramdef>string <parameter>remote_file</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に &true;、エラー時に &false; を返します。 - </para> - <para> <function>ftp_get</function> は、FTPサーバーから <parameter>remote_file</parameter>を取得し、ローカルシステムの <parameter>local_file</parameter> に保存します。転送モード @@ -336,30 +360,35 @@ たは <constant>FTP_BINARY</constant>のどちらかを指定する必要があ ります。 </para> + <para> + 成功時に &true;、エラー時に &false; を返します。 + </para> + <para> + <function>ftp_fget</function>も参照下さい。 + </para> </refsect1> </refentry> <refentry id="function.ftp-fget"> <refnamediv> <refname>ftp_fget</refname> - <refpurpose>FTP サーバーからファイルをダウンロードし、 - オープン中のファイルに保存する</refpurpose> + <refpurpose> + FTP サーバーからファイルをダウンロードし、オープン中のファイルに + 保存する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_fget</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> - <paramdef>int <parameter>fp</parameter></paramdef> + <funcdef>bool <function>ftp_fget</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>fp</parameter></paramdef> <paramdef>string <parameter>remote_file</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に &true;、エラー時に &false; を返します。 - </para> - <para> <function>ftp_fget</function> は、FTP サーバーから <parameter>remote_file</parameter> を取得し、指定したファイルポイ ンタ <parameter>fp</parameter> に書きこみます。転送モード @@ -367,6 +396,9 @@ または<constant>FTP_BINARY</constant>のどちらかを指定する必要があ ります。 </para> + <para> + 成功時に &true;、エラー時に &false; を返します。 + </para> </refsect1> </refentry> @@ -379,27 +411,29 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_put</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_put</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>remote_file</parameter></paramdef> <paramdef>string <parameter>local_file</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に &true;、エラー時に &false; を返します。 - </para> - <para> <function>ftp_put</function> は <parameter>local_file</parameter> を <parameter>remote_file</parameter> として FTP サーバーに保存します。 <parameter>mode</parameter> には、<constant>FTP_ASCII</constant> または<constant>FTP_BINARY</constant> </para> <para> + 成功時に &true;、エラー時に &false; を返します。 + </para> + <para> <example> <title><function>ftp_put</function> の例</title> <programlisting role="php"> -$upload = ftp_put ($conn_id, "$destination_file", "$source_file", FTP_ASCII); +<![CDATA[ +$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_ASCII); +]]> </programlisting> </example> </para> @@ -417,17 +451,14 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_fput</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_fput</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>remote_file</parameter></paramdef> - <paramdef>int <parameter>fp</parameter></paramdef> + <paramdef>resource <parameter>fp</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に &true;、エラー時に &false; を返します。 - </para> - <para> <function>ftp_fput</function> は、ファイルポインタ <parameter>fp</parameter> からデータをファイルの終端まで アップロードします。結果は、FTPサーバーの @@ -436,6 +467,9 @@ <constant>FTP_ASCII</constant>または <constant>FTP_BINARY</constant>のどちらかを指定する必要があります。 </para> + <para> + 成功時に &true;、エラー時に &false; を返します。 + </para> </refsect1> </refentry> @@ -449,19 +483,19 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>ftp_size</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>remote_file</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時にファイルのサイズ、エラー時に -1 を返します。 - </para> - <para> <function>ftp_size</function> はファイルのサイズを返します。エラー を生じた場合、またはファイルが存在しない場合、 -1 が返されます。 全てのサーバーがこの機能をサポートしているわけではないことに注意 してください。 </para> + <para> + 成功時にファイルのサイズ、エラー時に -1 を返します。 + </para> </refsect1> </refentry> @@ -475,19 +509,19 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>ftp_mdtm</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>remote_file</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時にUNIXのタイムスタンプ、エラー時に -1 を返します。 - </para> - <para> <function>ftp_mdtm</function> はあるファイルについて最後に修正さ れた時間を調べ、UNIXタイムスタンプとして返します。エラーを生じた 場合、またはファイルが存在しない場合、-1 が返されます。全てのサー バーがこの機能をサポートしているわけではないことに注意してください。 </para> + <para> + 成功時にUNIXのタイムスタンプ、エラー時に -1 を返します。 + </para> <note> <para> <function>ftp_mdtm</function> はディレクトリについては動作しません。 @@ -512,14 +546,14 @@ </funcprototype> </funcsynopsis> <para> - 成功時に&true;、エラー時に&false;を返します。 - </para> - <para> <function>ftp_rename</function> は、 FTP ストリーム <parameter>ftp_stream</parameter>において <parameter>from</parameter> という名前のファイルまたはディレクトリを <parameter>to</parameter> に変更します。 </para> + <para> + 成功時に&true;、エラー時に&false;を返します。 + </para> </refsect1> </refentry> @@ -532,18 +566,18 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_delete</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_delete</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に&true;、エラー時に&false;を返します。 - </para> - <para> <function>ftp_delete</function> は、<parameter>path</parameter> で指定したファイルをFTPサーバーから削除します。 </para> + <para> + 成功時に&true;、エラー時に&false;を返します。 + </para> </refsect1> </refentry> @@ -556,38 +590,218 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_site</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_site</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>cmd</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に&true;、エラー発生時に&false;を返します。</para> - <para> <function>ftp_site</function>は<parameter>cmd</parameter>で 指定されたコマンドをFTPサーバーに送信します。SITEコマンドは 規格が統一されていないため、サーバーにより仕様が異なります. ファイルのパーミッションやグループメンバーの設定のような - 処理を行う際には有用です。</para> + 処理を行う際には有用です。 + </para> + <para> + 成功時に&true;、エラー発生時に&false;を返します。 + </para> + </refsect1> + </refentry> + + <refentry id="function.ftp-close"> + <refnamediv> + <refname>ftp_close</refname> + <refpurpose>FTP接続を閉じる</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>ftp_close</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <note> + <para> + この関数はCVS版でのみ利用可能です。 + </para> + </note> + <para> + <function>ftp_close</function>は、 + <parameter>ftp_stream</parameter>を閉じ、リソースを解放します。こ + のリソースを再使用することはできませんが、 + <function>ftp_connect</function>で新規の接続を作成する必要があり + ます。 + </para> </refsect1> </refentry> <refentry id="function.ftp-quit"> <refnamediv> <refname>ftp_quit</refname> - <refpurpose>FTP 接続を閉じる</refpurpose> + <refpurpose>FTP接続を閉じる</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>ftp_quit</function></funcdef> + <paramdef>resource <parameter>ftp_stream</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>ftp_quit</function>は、<parameter>ftp_close</parameter> + のエイリアスです。 + </para> + </refsect1> + </refentry> + + <refentry id='function.ftp-exec'> + <refnamediv> + <refname>ftp_exec</refname> + <refpurpose> + ftpサーバでプログラム実行する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>ftp_exec</function></funcdef> + <paramdef>resource <parameter>stream</parameter></paramdef> + <paramdef>string <parameter>command</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + ftpサーバにSITE EXEC <parameter>command</parameter>リクエストを送 + 信する。リクエストを失敗した場合、&false;を返し、その他の場合は、 + コマンドの出力を返します。 + </para> + </refsect1> + </refentry> + + <refentry id='function.ftp-set-option'> + <refnamediv> + <refname>ftp_set_option</refname> + <refpurpose> + FTP実行オプションを設定する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_quit</function></funcdef> - <paramdef>int <parameter>ftp_stream</parameter></paramdef> + <funcdef>bool <function>ftp_set_option</function></funcdef> + <paramdef>resource <parameter>stream</parameter></paramdef> + <paramdef>int <parameter>option</parameter></paramdef> + <paramdef>mixed <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> + <note> + <para> + この関数はCVS版でのみ利用可能です。 + </para> + </note> + <para> + オプションが設定できる場合に&true;、そうでない場合に&false;を返し + ます。<parameter>option</parameter>がサポートされていないか、指定 + された<parameter>value</parameter>が指定した + <parameter>option</parameter>が期待する値に一致しない場合に警告メッ + セージが発生します。 + </para> + <para> + この関数は、指定したFTPストリームに関して種々の実行時オプションを + 制御します。パラメータ<parameter>value</parameter>は変更するパラ + メータ<parameter>option</parameter>に依存します。 + 現在、以下のオプションがサポートされています。 + <table> + <title>サポートされる実行時FTPオプション</title> + <tgroup cols="2"> + <tbody> + <row> + <entry>FTP_TIMEOUT_SEC</entry> + <entry> + 全てのネットワーク関連関数に関して秒単位でタイムアウトを変更 + します。パラメータ<parameter>value</parameter>は、int型で、0 + より大きい必要があります。デフォルトのタイムアウトは90秒です。 + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> <para> - <function>ftp_connect</function> は、<parameter>ftp_stream</parameter> - を閉じます。</para> + <example> + <title><function>ftp_set_option</function>の例</title> + <programlisting role="php"> +<![CDATA[ +// Set the network timeout down to 10 seconds +ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10); +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id='function.ftp-get-option'> + <refnamediv> + <refname>ftp_get_option</refname> + <refpurpose> + カレントのFTPストリームの種々の実行動作を取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>ftp_get_option</function></funcdef> + <paramdef>resource <parameter>stream</parameter></paramdef> + <paramdef>int <parameter>option</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <note> + <para> + この関数は、CVS版でのみ利用可能です。 + </para> + </note> + <para> + 成功時に値、指定した<parameter>option</parameter>がサポートされて + いない場合に&false;を返します。後者では、警告メッセージも発生しま + す。 + </para> + <para> + + この関数は、指定した<parameter>FTP stream</parameter>に関して指定 + した<parameter>option</parameter>に関する + <parameter>value</parameter>を返します。現在、以下のオプションが + サポートされています。 + <table> + <title>サポートされる実行時FTPオプション</title> + <tgroup cols="2"> + <tbody> + <row> + <entry>FTP_TIMEOUT_SEC</entry> + <entry> + ネットワーク関連処理で使用されるカレントのタイムアウトを返し + ます。 + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <para> + <example> + <title><function>ftp_get_option</function>の例</title> + <programlisting role="php"> +<![CDATA[ +// 指定したFTPストリームのタイムアウトを取得する +$timeout = ftp_get_option($conn_id, FTP_TIMEOUT_SEC); +]]> + </programlisting> + </example> + </para> </refsect1> </refentry>
« previous php.doc (#969341429) next »