cvs: phpdoc /ja/functions gmp.xml misc.xml mysql.xml pcre.xml posix.xml recode.xml strings.xml yaz.xml /ja/language oop.xml /ja/pear pear.xml
standards.xml
| From: | Rui Hirokawa | Date: | Sun, 11 Mar 2001 05:56:46 +0000 |
| Subject: | cvs: phpdoc /ja/functions gmp.xml misc.xml mysql.xml pcre.xml posix.xml recode.xml strings.xml yaz.xml /ja/language oop.xml /ja/pear pear.xml standards.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969334632@lists.php.net to get a copy of this message | ||
hirokawa Sat Mar 10 21:56:46 2001 EDT
Modified files:
/phpdoc/ja/functions gmp.xml misc.xml mysql.xml pcre.xml posix.xml
recode.xml strings.xml yaz.xml
/phpdoc/ja/language oop.xml
/phpdoc/ja/pear pear.xml standards.xml
Log:
update translation, fixed typos.
Index: phpdoc/ja/functions/gmp.xml diff -u phpdoc/ja/functions/gmp.xml:1.4 phpdoc/ja/functions/gmp.xml:1.5 --- phpdoc/ja/functions/gmp.xml:1.4 Thu Mar 1 07:24:45 2001 +++ phpdoc/ja/functions/gmp.xml Sat Mar 10 21:56:43 2001 @@ -367,7 +367,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>resource <function>gmp_divexact</function></funcdef> + <funcdef>resource <function>gmp_div</function></funcdef> <paramdef>resource <parameter>a</parameter></paramdef> <paramdef>resource <parameter>b</parameter></paramdef> </funcprototype> Index: phpdoc/ja/functions/misc.xml diff -u phpdoc/ja/functions/misc.xml:1.15 phpdoc/ja/functions/misc.xml:1.16 --- phpdoc/ja/functions/misc.xml:1.15 Thu Jan 4 22:29:04 2001 +++ phpdoc/ja/functions/misc.xml Sat Mar 10 21:56:43 2001 @@ -76,6 +76,52 @@ </refsect1> </refentry> + <refentry id="function.constant"> + <refnamediv> + <refname>constant</refname> + <refpurpose>宿°ã®å¤ãè¿ã</refpurpose> + </refnamediv> + <refsect1> + <title>説æ</title> + <funcsynopsis> + <funcprototype> + <funcdef>mixed <function>constant</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>constant</function> ã¯ã<parameter>name</parameter>ã§æ + å®ãã宿°ã®å¤ãè¿ãã¾ãã + </simpara> + <simpara> + <function>constant</function> ã¯ãã宿°ã®å¤ãåå¾ããå¿ è¦ããã + ãããã®ååã䏿ãªå ´åã«æç¨ã§ããããã¯ã宿°ã夿°ã«ä¿åãã + ã¦ãããã颿°ã«ããè¿ããããã®å ´åã§ãã + </simpara> + <para> + <example> + <title><function>constant</function> ã®ä¾</title> + <programlisting role="php"> +<php + +define ("MAXSIZE", 100); + +echo MAXSIZE; +echo constant("MAXSIZE"); // åã®è¡ã¨åä½ã¯åã + +?> + </programlisting> + </example> + </para> + <para> + <function>define</function>, + <function>defined</function>, + <function>constant</function> ããã³ <link + linkend="language.constants">宿°</link> ã®ç¯ãåç §ä¸ããã + </para> + </refsect1> + </refentry> + <refentry id="function.define"> <refnamediv> <refname>define</refname> @@ -148,7 +194,8 @@ è¿ãã¾ãã </para> <para> - <function>defined</function>ããã³ + <function>defined</function>, + <function>constant</function> ããã³ <link linkend="language.constants">宿°</link>ã®ç¯ãåç §ä¸ããã </para> </refsect1> @@ -174,7 +221,8 @@ trueããã®ä»ã®å ´åã«falseãè¿ãã¾ãã </para> <para> - <function>define</function>ããã³ + <function>define</function>, + <function>constant</function> ããã³ <link linkend="language.constants">宿°</link> ã®ç¯ãåç §ä¸ããã </para> </refsect1> @@ -195,21 +243,49 @@ <paramdef>string <parameter>message</parameter></paramdef> </funcprototype> </funcsynopsis> + <simpara> + <function>die</function> ã¯ã<parameter>message</parameter> ãåº + åããã¹ã¯ãªããã®å¦çãçµäºãã¾ãããã®é¢æ°ã¯å¤ãä½ãè¿ãã¾ããã + </simpara> <simpara> - ãã®è¨èªæ§é ã¯ãã¡ãã»ã¼ã¸ãåºåããã¹ã¯ãªããã®å¦çãçµäºãã¾ãã - ãã®é¢æ°ã¯ããªã¿ã¼ã³ãè¡ãã¾ããã + ã¾ãã<function>die</function> ã«ã¯ããã©ã¡ã¼ã¿ã¨ãã¦é¢æ°ãæå®å¯ + è½ã§ãããã®é¢æ°ã¯ã<function>die</function> ãã¹ã¯ãªããã®ãã¼ã¹ + ãçµäºããåã«å®è¡ããã¾ãã </simpara> <para> <example> - <title>die ã®ä¾</title> + <title><function>die</function> ã®ä¾</title> <programlisting role="php"> <?php + $filename = '/path/to/data-file'; -$file = fopen($filename, 'r') - or die "ãã¡ã¤ã«unable to open file ($filename)"; +$file = fopen ($filename, 'r') + or die("unable to open file ($filename)"); + ?> - </programlisting> - </example> + </programlisting> + </example> + </para> + <para> + <example> + <title>颿°ã使ç¨ãã <function>die</function> ã®ä¾</title> + <programlisting role="php"> +<?php + +function handle_error($msg) { + if ($fp = @fopen("/tmp/error.log", "a")) { + fwrite($fp, $msg, strlen($msg)); + fclose($fp); + } +} + +if ($bad) { + die(handle_error("Something bad happened.\n")); +} + +?> + </programlisting> + </example> </para> <simpara> <function>exit</function>ãåç §ä¸ããã @@ -422,8 +498,17 @@ 颿° <function>highlight_file</function>ã¯ã <parameter>filename</parameter>ã®ä¸ã®ã³ã¼ããPHPçµè¾¼ã®æ§æãã¤ã© ã¤ã¿ã§å®ç¾©ãããã«ã©ã¼ã使ç¨ãã¦æ§æãã¤ã©ã¤ã表示ãããã®ãåºå - ãã¾ãã + ãã¾ãããã®é¢æ°ã¯ãæåæã«trueããã®ä»ã®å ´åã«falseãè¿ãã¾ãã + (PHP 4) </simpara> + <note> + <simpara> + 颿° <function>show_source</function> ããã³ + <function>highlight_file</function>ã使ç¨ããå ´åã«ã¯ããã¹ã¯ã¼ + ããæ½å¨çãªã»ãã¥ãªãã£ä¸ã®å±éºãçãé¡ã®ä»ã®æ å ±ã®ãããªéè¦ãª + æ å ±ã䏿³¨æã§å ¬éãã¦ãã¾ããªãããã«æ³¨æããå¿ è¦ãããã¾ãã + </simpara> + </note> <para> <example> <title>URLã®ã½ã¼ã¹ãã¤ã©ã¤ã表示ã®ä½æ</title> @@ -790,7 +875,7 @@ åãæ§é ã失ããã«PHPã®å¤ãä¿åã¾ãã¯æ¸¡ãéã«æå¹ã§ãã </simpara> <simpara> - ã·ãªã¢ã«åã?ãæååãPHPã®å¤ã«æ»ãã«ã¯ã + ã·ãªã¢ã«åãããæååãPHPã®å¤ã«æ»ãã«ã¯ã <function>unserialize</function>ã使ç¨ãã¦ä¸ããã <function>serialize</function>ã¯å<type>integer</type>, <type>double</type>,<type>string</type>,<type>array</type> @@ -842,10 +927,16 @@ æ§æãã¤ã©ã¤ã表示ãåºåãã¾ãã æåæã«trueãããã§ãªãå ´åã«falseãè¿ãã¾ãã(PHP 4) </simpara> + <simpara> + ãã®é¢æ°ã¯ã颿°<function>highlight_file</function>ã®ã¨ã¤ãªã¢ã¹ã§ + ãã + </simpara> <note> <simpara> - ãã®é¢æ°ã¯ã颿°<function>highlight_file</function>ã®ã¨ã¤ãªã¢ã¹ - ã§ãã + 颿° <function>show_source</function> ããã³ + <function>highlight_file</function>ã使ç¨ããå ´åã«ã¯ããã¹ã¯ã¼ + ããæ½å¨çãªã»ãã¥ãªãã£ä¸ã®å±éºãçãé¡ã®ä»ã®æ å ±ã®ãããªéè¦ãª + æ å ±ã䏿³¨æã§å ¬éãã¦ãã¾ããªãããã«æ³¨æããå¿ è¦ãããã¾ãã </simpara> </note> <simpara> Index: phpdoc/ja/functions/mysql.xml diff -u phpdoc/ja/functions/mysql.xml:1.16 phpdoc/ja/functions/mysql.xml:1.17 --- phpdoc/ja/functions/mysql.xml:1.16 Sun Feb 18 15:29:44 2001 +++ phpdoc/ja/functions/mysql.xml Sat Mar 10 21:56:43 2001 @@ -45,18 +45,44 @@ </funcsynopsis> <para> <function>mysql_affected_rows</function>ã¯ãæå®ãã - link_identifierãæããµã¼ãã¼ã«ããã¦ç´è¿ã®INSERTãUPDATEãDELETE - ã¯ã¨ãªã¼ã«ãã夿´ãããè¡ã®æ°ãè¿ãã¾ããlink_identifierãæå®ã - ããªãå ´åãæå¾ã«ãªã¼ãã³ããããªã³ã¯ãä»®å®ããã¾ãã + <parameter>link_identifier</parameter> ãæããµã¼ãã¼ã«ããã¦ç´è¿ + ã®INSERTãUPDATEãDELETEã¯ã¨ãªã¼ã«ãã夿´ãããè¡ã®æ°ãè¿ãã¾ãã + link_identifierãæå®ãããªãå ´åã + <function>mysql_connect</function> ã«ããç´è¿ã«ãªã¼ãã³ããããªã³ + ã¯ãæå®ãããã¨ä»®å®ããã¾ãã </para> + <note> + <para> + ãã©ã³ã¶ã¯ã·ã§ã³ã使ç¨ããå ´åã«ã¯ã ã³ãããå¾ã§ã¯ãªããINSERT, + UPDATE, DELETE ã¯ã¨ãªã®å¾ã« + <function>mysql_affected_rows</function> ãã³ã¼ã«ããå¿ è¦ããã + ã¾ãã + </para> + </note> <para> ç´è¿ã®ã¯ã¨ãªã¼ãWHEREç¯ã®ãªãDELETEã¯ã¨ãªã¼ã§ãã£ãå ´åãå ¨ã¬ã³ã¼ ãã¯ãã¼ãã«ããåé¤ããã¦ãã¾ããããã®é¢æ°ã¯ã¼ããè¿ãã¾ãã </para> + <note> + <para> + UPDATEã使ç¨ããå ´åãMySQL ã¯æ°ããå¤ãå¤ãå¤ã¨åãå ´åã«ã¯ã«ã© + ã ãæ´æ°ãã¾ããããã®ããã + <function>mysql_affected_rows</function> ã¯ãããããè¡ã®æ°ã«ã¯ + ä¸è´ããªãå¯è½æ§ããããåã«ã¯ã¨ãªã«ããæåã®ä¸ã§ä½ç¨ãããè¡ + ã®æ°ã¨ãªãã¾ãã + </para> + </note> + <para> + <function>mysql_affected_rows</function> ã¯ãSELECTæã«ã¯ä½¿ç¨ã§ã + ã¾ãããã¬ã³ã¼ããä¿®æ£ããæã§ã®ã¿ä½¿ç¨ã§ãã¾ããSELECTããè¿ãã + ãè¡ã®æ°ãå¾ãéã«ã¯ã<function>mysql_num_rows</function>ã使ç¨ã + ã¦ä¸ããã + </para> + <para> + ç´è¿ã®ã¯ã¨ãªã失æããå ´åããã®é¢æ°ã¯-1ãè¿ãã¾ãã + </para> <para> - ãã®ã³ãã³ãã¯ãSELECTæã«ã¯ä½¿ç¨ã§ãã¾ãããã¬ã³ã¼ããä¿®æ£ããæ - ã§ã®ã¿ä½¿ç¨ã§ãã¾ããSELECTããè¿ãããè¡ã®æ°ãå¾ãéã«ã¯ã - <function>mysql_num_rows</function>ã使ç¨ãã¦ä¸ããã + <function>mysql_num_rows</function> ãåç §ä¸ããã </para> </refsect1> </refentry> @@ -228,11 +254,13 @@ <title>MySQL ã«æ¥ç¶ããä¾</title> <programlisting role="php"> <?php - $link = mysql_connect ("kraemer", "marliesle", "secret") + + $link = mysql_connect ("localhost", "username", "secret") or die ("æ¥ç¶ã§ãã¾ããã§ãã"); print ("æ¥ç¶ã«æåãã¾ãã"); mysql_close ($link); -?> + +?> </programlisting> </example> <para> @@ -1411,28 +1439,30 @@ <para> <function>mysql_num_rows</function>ã¯çµæã»ããã«ãããè¡ã®æ°ãè¿ ãã¾ãããã®ã³ãã³ãã¯SELECTæã§ã®ã¿æå¹ã§ãã - INSERTãUPDATEãDELETEããè¿ãããè¡ã®æ°ãåå¾ããéã«ã¯ã + INSERTãUPDATEãDELETE ã¯ã¨ãªããè¿ãããè¡ã®æ°ãåå¾ããéã«ã¯ã <function>mysql_affected_rows</function>ã使ç¨ãã¦ä¸ããã <example> - <title> - crubel@trilizio.org ã«ãã <function>mysql_num_rows</function> - ã®ä¾ - </title> + <title><function>mysql_num_rows</function>ã®ä¾</title> <programlisting role="php"> <?php -$conn = mysql_connect("hostaddress", "username", "password"); -mysql_select_db("database",$conn); // è¤æ°ã®ãã¼ã¿ãã¼ã¹ãããå ´åã¯å¿ è¦ -$Resultfornummembers = mysql_query("SELECT * FROM Accounts",$conn); -$NumMembers = mysql_num_rows($Resultfornummembers); -echo "$NumMembers Members"; -?> + +$link = mysql_connect("localhost", "username", "password"); +mysql_select_db("database", $link); + +$result = mysql_query("SELECT * FROM table1", $link); +$num_rows = mysql_num_rows($result); + +echo "$num_rows è¡\n"; + +?> </programlisting> </example> </para> <para> - <function>mysql_db_query</function>ã - <function>mysql_query</function>ã - <function>mysql_fetch_row</function> ãåç §ä¸ããã + <function>mysql_affected_rows</function>, + <function>mysql_connect</function>, + <function>mysql_select_db</function>, + <function>mysql_query</function> ãåç §ä¸ããã </para> <para> ä¸ä½äºææ§ã®ç¶æã®ããã<function>mysql_numrows</function> Index: phpdoc/ja/functions/pcre.xml diff -u phpdoc/ja/functions/pcre.xml:1.18 phpdoc/ja/functions/pcre.xml:1.19 --- phpdoc/ja/functions/pcre.xml:1.18 Sat Mar 3 16:53:36 2001 +++ phpdoc/ja/functions/pcre.xml Sat Mar 10 21:56:43 2001 @@ -939,9 +939,11 @@ </literallayout> </refsect1> - <refsect1> + <refsect1 id="regexp.reference"> <title>æ£è¦è¡¨ç¾ã®è©³ç´°</title> - <literallayout> + <refsect2 id="regexp.introduction"> + <title>å°å ¥</title> + <literallayout> PCRE ã«ãããµãã¼ããããæ£è¦è¡¨ç¾ã®æ§æã以ä¸ã«ç¤ºãã¾ãã æ£è¦è¡¨ç¾ã¯ãPerl ã®ããã¥ã¡ã³ããä»ã®å¤ãã®æ¸ç±ã«ãã㦠è±å¯ãªä¾ã¨å ±ã«èª¬æããã¦ãã¾ãã @@ -958,6 +960,12 @@ The quick brown fox ã¯ãæ¤ç´¢å¯¾è±¡æååã®ããèªä½ã¨åãé¨åã«ããããã¾ãã + </literallayout> + </refsect2> + + <refsect2 id="regexp.reference.meta"> + <title>ã¡ã¿æå</title> + <literallayout> æ£è¦è¡¨ç¾ã®å¼·åãã¯ããã¿ã¼ã³ä¸ã«è¤æ°ã®é¸æè¢ãç¹°ãè¿ã ãå«ãè½åã«ãããã®ã§ãã ãããã¯ã<emphasis>ã¡ã¿</emphasis>-<emphasis>æå</emphasis> ã @@ -992,8 +1000,13 @@ ] æåã¯ã©ã¹ã®çµäº 次ã®ã»ã¯ã·ã§ã³ã§ãåã¡ã¿æåã®ä½¿ç¨æ³ã®èª¬æãè¡ãã¾ãã + + </literallayout> + </refsect2> -ããã¯ã¹ã©ãã·ã¥ + <refsect2 id="regexp.reference.backslash"> + <title>ããã¯ã¹ã©ãã·ã¥</title> + <literallayout> ããã¯ã¹ã©ãã·ã¥ã«ã¯ãããã¤ãã®ä½¿ç¨æ³ãããã¾ããã¾ãã è±åã§ãªãæåãå¾ã«ç¶ãå ´åããã¦Öåãæãã ç¹å¥ãªæå³ã¯å¤±ããã¾ãããã®ããã¯ã¹ã©ãã·ã¥ã®ä½¿ãæ¹ã¯ã @@ -1127,8 +1140,12 @@ åãã¾ããã\Z åã³ \z ã®éãã¯ã\Z ã¯ãæååã®çµç«¯ã¨åæã« æååã®æå¾ã®æåãæ¹è¡ã®å ´åã«åã®æåã«ãã£Ãããã®ã«å¯¾ãã \z ã¯çµç«¯ã«ã®ã¿ããããã¾ãã + </literallayout> + </refsect2> -ãããè¨å·åã³ãã«è¨å· + <refsect2 id="regexp.reference.circudollar"> + <title>ãããè¨å·åã³ãã«è¨å·</title> + <literallayout> æåã¯ã©ã¹ã®å¤å´ã®å ´åãããã©ã«ãã®ãããã¢ã¼ãã§ã¯ããããè¨å·ã¯ ç¾å¨ãããã³ã°ãè¡ã£ã¦ããä½ç½®ã対象æååã®å§ç«¯ã§ããå ´åã«ã®ã¿ trueã¨ãªãè¨æã§ãã @@ -1170,18 +1187,24 @@ 両æ¹ã®ã¢ã¼ãã§å¯¾è±¡ã®å§ç«¯ããã³çµç«¯ã«ããããããããã« ã·ã¼ã±ã³ã¹ \A, \Z, \z ã使ç¨åºæ¥ããã¨ã«æ³¨æãã¦ãã ããã - ãã¿ã¼ã³ã®å £fã®æã \A ãä»ãã¦å§ã¾ãå ´åã + ãã¿ã¼ã³ã®æã \A ãä»ãã¦å§ã¾ãå ´åã PCRE_MULTILINE ã®è¨å®ã«ãããã常ã«ã¢ã³ã«ã¼ä»ãã¨ãªãã¾ãã - -çµæ¢ç¬¦ (ããªãªã, ããã) + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.dot"> + <title>çµæ¢ç¬¦</title> + <literallayout> æåã¯ã©ã¹ã®å¤å´ã§ã¯ããã¿ã¼ã³ã®ä¸ã®ãããã¯éåºåæåãå«ã (ããã©ã«ãã§ã¯)æ¹è¡ä»¥å¤ã®å¯¾è±¡ã®å ¨ã¦ã®1æåã«ããããã¾ãã PCRE_DOTALL ãªãã·ã§ã³ãè¨å®ããå ´åããããã¯æ¹è¡ã«ãããã ãã¾ãããããã®å¦çã¯ããããè¨å·ããã³ãã«è¨å·ã¨ã¯å®å ¨ã«ç¬ç«ã ã¦ãã¾ããå ±éãªç¹ã¯å ±ã«æ¹è¡æåãå«ããã¨ã ãã§ãã ãããã¯ãæåã¯ã©ã¹ã®ä¸ã§ã¯ç¹å¥ãªæå³ãæã¡ã¾ããã - -ãã©ã±ãã + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.squarebrackets"> + <title>è§æ¬å¼§</title> + <literallayout> å·¦ãã©ã±ããã¯æåã¯ã©ã¹ã®éå§ã表ããå³ãã©ã±ããã«ããçµäº ãã¾ããå³ãã©ã±ããã¯ãããèªä½ç¹å¥ãªãã®ã§ã¯ããã¾ããã å³ãã©ã±ãããã¯ã©ã¹ã®ã¡ã³ãã¼ã¨ãã¦å¿ è¦ãªå ´åã(ãããã㪠@@ -1247,9 +1270,11 @@ \, -, (å§ç«¯ã®)^ 以å¤ã®å ¨ã¦ã®è±æ°åã§ãªãæåããã³çµç«¯ã® ] ã¯ã æåã¯ã©ã¹ã«ããã¦ç¹å¥ã§ãªãæåã§ãããã¨ã¹ã±ã¼ãããå ´åã§ã æªå½±é¿ã¯ããã¾ããã - - -åç´ãã¼ + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.verticalbar"> + <title>åç´ãã¼</title> + <literallayout> åç´ãã¼æåã¯ã鏿è¢ãæå®ãããã¿ã¼ã³ã§ä½¿ç¨ããã¾ããä¾ãã°ããã¿ã¼ã³ gilbert|sullivan @@ -1261,9 +1286,13 @@ ã§èª¬æãã)ãµããã¿ã¼ã³ã®ä¸ã«ããå ´åã"æåãã"ã¨ãããã¨ã¯ ãµããã¿ã¼ã³ã®é¸æè¢ã¨åæ§ã«ã¡ã¤ã³ãã¿ã¼ã³ã®æ®ãã®é¨åãããã ããã¨ãããã¨ãæ?Wã¾ãã + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.internal_options"> + <title>å é¨ãªãã·ã§ã³è¨å®</title> + <literallayout> -å é¨ãªãã·ã§ã³è¨å® PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, PCRE_EXTENDED ã® è¨å®ã¯ã"(?" ããã³ ")" ã§æ¬ã£ã Perl ãªãã·ã§ã³æåã«ãã ãã¿ã¼ã³å é¨ã§å¤æ´å¯è½ã§ãã @@ -1324,7 +1353,11 @@ å ã§ä»ã®è¨å®ããªã³ã«ããåã«æå®ããå¿ è¦ãããã¾ãã ãã®ãã©ã°ã¯ãæåã«æå®ããã®ãæåã§ãã -ãµããã¿ã¼ã³ + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.subpatterns"> + <title>ãµããã¿ã¼ã³</title> + <literallayout> ãµããã¿ã¼ã³ã¯æ¬å¼§(丸æ¬å¼§)ã§åºåããããã¹ããå¯è½ã§ãã ãã¿ã¼ã³ã®ä¸é¨ããµããã¿ã¼ã³ã¨ãã¦æå®ããããã«ã¯ã2ã¤ã®ã ã¨ãè¡ãã¾ãã @@ -1378,7 +1411,13 @@ ãã®ãããä¸ã®ãã¿ã¼ã³ã¯ã"Saturday" ã¨åæ§ã«"SUNDAY" ã«ã ããããã¾ãã -ç¹°ãè¿ã + </literallayout> + </refsect2> + + <refsect2 id="regexp.reference.repetition"> + <title>ç¹°ãè¿ã</title> + <literallayout> + ç¹°ãè¿ãã¯ãå復æå®åã«ããæå®ãã¾ããæ¬¡ã®è¦ç´ ã®å¾ã«ä»ãã ãã¨ãåºæ¥ã¾ãã @@ -1502,8 +1541,13 @@ ã "aba" ã«ããããããã¨ã2çªç®ã«åå¾ãããé¨åæååã¯ã "b" ã«ãªãã¾ãã + + </literallayout> + </refsect2> -徿¹åç § + <refsect2 id="regexp.reference.back_references"> + <title>徿¹åç §</title> + <literallayout> æåã¯ã©ã¹ã®å¤ã§ãããã¯ã¹ã©ãã·ã¥ã®å¾ã« 0 ãã大ããæ°åã ä»ãããã®ã¯ãã¿ã¼ã³ã§ä»¥åã«(ããªãã¡å·¦ã«ãã)å¤ãåå¾ãã ãµããã¿ã¼ã³ã«å¯¾ãã徿¹åç §ã§ãããåã«ããå¤ã®åå¾ãè¡ã @@ -1563,8 +1607,12 @@ ããã¾ããããã¯ä¸ã®ä¾ã®ããã«é¸æã使ç¨ããããã¼ããæå°ã¨ ããå復æå®åã«ããè¡ããã¨ãã§ãã¾ãã + </literallayout> + </refsect2> -è¨æ + <refsect2 id="regexp.reference.assertions"> + <title>è¨æ</title> + <literallayout> è¨æã¯ãç¾å¨ããããè¡ã£ã¦ããä½ç½®ã®å¾ã«ç¶ããåã«ããæå㫠対ãããã¹ãã§ãããå®éã«ã¯æåã¸ã®ä½ç¨ãè¡ãã¾ããã @@ -1670,8 +1718,12 @@ è¨æã®æ¬å¼§ã§æ¬ããããµããã¿ã¼ã³ã®æ°ã¯ãæå¤§ 200 ã§ãã + </literallayout> + </refsect2> -ä¸åã ã使ç¨ãããµããã¿ã¼ã³ + <refsect2 id="regexp.reference.onlyonce"> + <title>ä¸åã ã使ç¨ãããµããã¿ã¼ã³</title> + <literallayout> å復ãæå¤§åããã³æå°åããå ´åã¯å ±ã«ãå¾ã«ç¶ããã®ã¸ã®ãã ãã失æããå ´åãå復æ°ãå¤ããå ´åã«ãã¿ã¼ã³ã®æ®ãã«ããã ãããã¨ãã§ãããã©ããã調ã¹ãããã«å復ããé ç®ãåè©ä¾¡ã @@ -1772,7 +1824,12 @@ æ°å以å¤ã®ä¸¦ã³ã«ããä¸åãçãããã¨ããªããªãã失æã¯æ©æã«çã ã¾ãã -æ¡ä»¶ä»ããµããã¿ã¼ã³ + </literallayout> + </refsect2> + + <refsect2 id="regexp.reference.conditional"> + <title>æ¡ä»¶ä»ããµããã¿ã¼ã³</title> + <literallayout> è¨æã®çµæã¾ãã¯åã®å¤ãåå¾ãããµããã¿ã¼ã³ãããããããã© ããã«ããããµããã¿ã¼ã³ã®ãããå¦çãè¡ã£ããããµããã¿ã¼ã³ã® 2ã¤ã®é¸æè¢ã鏿ããããããã¨ãå¯è½ã§ããæ¡ä»¶ä»ããµããã¿ã¼ @@ -1820,8 +1877,13 @@ ã¯ã2çªç®ã«ããããã¾ãããã®ãã¿ã¼ã³ã¯ã2ã¤ã®å½¢å¼ dd-aaa-dd ã¾ã㯠dd-dd-dd ã®ã©ã¡ããã®æååã«ããããã¾ãããã ãã aaa ã¯è±åãdd ã¯æ°åã§ãã + + </literallayout> + </refsect2> -ã³ã¡ã³ã + <refsect2 id="regexp.reference.comments"> + <title>ã³ã¡ã³ã</title> + <literallayout> (?# ã¨ãã並ã³ã¯ãéå§ãæå®ãã¾ããã³ã¡ã³ãã¯ã次ã®å³æ¬å¼§ã¾ã§ ç¶ãã¾ããæ¬å¼§ã®ãã¹ãã¯è¨±å¯ããã¾ãããã³ã¡ã³ãä¸ã®æåã¯ã ãã¿ã¼ã³ãããã³ã°ã«ã¯å ¨ãé¢ä¿ãã¾ããã @@ -1829,8 +1891,13 @@ PCRE_EXTENDED ãªãã·ã§ã³ãè¨å®ããã¦ããå ´åãæåã¯ã©ã¹ã®å¤ ã«ããã¨ã¹ã±ã¼ãããã¦ããªã # æåã¯ãã³ã¡ã³ããæå®ãã¾ãã ã³ã¡ã³ãã¯ããã¿ã¼ã³ä¸ã®æ¬¡ã®æ¹è¡æåã¾ã§ç¶ãã¾ãã + + </literallayout> + </refsect2> -å帰çãã¿ã¼ã³ + <refsect2 id="regexp.reference.recursive"> + <title>å帰çãã¿ã¼ã³</title> + <literallayout> ç¡å¶éã®ãã¹ãã許容ããæ¬å¼§ãå«ãæååã«ããããè¡ãåé¡ãèã ã¦ã¿ã¾ããããå帰ã使ç¨ããªãå ´åãå®ç¾å¯è½ãªæè¯ã®æ¹æ³ã¯ãä½ã ãã®åºå®ããæ·±ãã®ãã¹ãã¾ã§ããããè¡ããã¿ã¼ã³ã使ç¨ãããã¨ã§ @@ -1878,8 +1945,12 @@ å¾ã§ããªãå ´åãã¡ã¢ãªä¸è¶³ã¨ã©ã¼ãå帰ã®å å´ããåºåããææ®µ ã¯ãªããããæåã®15åã®åå¾ç¨æ¬å¼§ã«ã¤ãã¦ã®ã¿ãã¼ã¿ãä¿åã ãã¾ãã + </literallayout> + </refsect2> -æ§è½ + <refsect2 id="regexp.reference.performances"> + <title>æ§è½</title> + <literallayout> ãã¿ã¼ã³ã®å¹¾ã¤ãã®è¦ç´ ã¯ãä»ã®è¦ç´ ãããããå¹ççã§ãã (a|e|i|o|u) ã®ãããªé¸æè¢ã®éåããã [aeiou] ã®ãããªæå㯠ã©ã¹ã®æ¹ãããå¹ççã§ããä¸è¬ã«ãæ§æãæãç°¡åãªãã®ã @@ -1939,7 +2010,8 @@ åè ã¯ãå ¨ä½ã "a" æåã§ããè¡ã«é©ç¨ãããå ´åã«ã»ã¼ç¬éçã«å¤±æ ã¨å¤å®ãã¾ãã䏿¹ãå¾è ã§ã¯ãããã20æåããé·ãæååã§ã¯ã㪠ãã®æéããããã¾ãã - </literallayout> + </literallayout> + </refsect2> </refsect1> </refentry> </reference> Index: phpdoc/ja/functions/posix.xml diff -u phpdoc/ja/functions/posix.xml:1.5 phpdoc/ja/functions/posix.xml:1.6 --- phpdoc/ja/functions/posix.xml:1.5 Fri Oct 13 08:30:56 2000 +++ phpdoc/ja/functions/posix.xml Sat Mar 10 21:56:44 2001 @@ -545,7 +545,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>posix_getcwd</function></funcdef> + <funcdef>bool <function>posix_mkfifo</function></funcdef> <paramdef>string <parameter>pathname</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> Index: phpdoc/ja/functions/recode.xml diff -u phpdoc/ja/functions/recode.xml:1.5 phpdoc/ja/functions/recode.xml:1.6 --- phpdoc/ja/functions/recode.xml:1.5 Sat Nov 11 16:23:31 2000 +++ phpdoc/ja/functions/recode.xml Sat Mar 10 21:56:44 2001 @@ -62,7 +62,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>string <function>recode_string</function></funcdef> + <funcdef>string <function>recode</function></funcdef> <paramdef>string <parameter>request</parameter></paramdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> Index: phpdoc/ja/functions/strings.xml diff -u phpdoc/ja/functions/strings.xml:1.27 phpdoc/ja/functions/strings.xml:1.28 --- phpdoc/ja/functions/strings.xml:1.27 Sat Feb 24 17:00:02 2001 +++ phpdoc/ja/functions/strings.xml Sat Mar 10 21:56:44 2001 @@ -1668,13 +1668,14 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>setlocale</function></funcdef> - <paramdef>string <parameter>category</parameter></paramdef> + <paramdef>mixed <parameter>category</parameter></paramdef> <paramdef>string <parameter>locale</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <parameter>category</parameter>ã¯ããã±ã¼ã«è¨å®ã«ããå½±é¿ã - åãã颿°ã®ã«ãã´ãªãæå®ããæååã§ãã以ä¸ã®ãã®ãããã¾ãã + <parameter>category</parameter>ã¯ãååä»ãã®å®æ°(ã¾ãã¯æåå)ã§ + ããããã±ã¼ã«è¨å®ã«ããå½±é¿ãåãã颿°ã®ã«ãã´ãªãæå®ãã¾ãã + ã«ãã´ãªã«ã¯ã以ä¸ã®ãã®ãããã¾ãã <itemizedlist> <listitem> <simpara> @@ -1720,7 +1721,8 @@ <para> Setlocale ã¯ç¾å¨ã®æ°ãããã±ã¼ã«ãè¿ãããã±ã¼ã«æ©è½ãæªå®è£ ã æå®ããããã±ã¼ã«ãåå¨ããªããã«ãã´ãªåãç¡å¹ãªã©ã®å ´å㯠- å½ãè¿ãã¾ããã¾ããã«ãã´ãªåãç¡å¹ã®å ´åã¯è¦åã¡ãã»ã¼ã¸ãçºãããã¾ãã + å½ãè¿ãã¾ããã¾ããã«ãã´ãªåãç¡å¹ã®å ´åã¯è¦åã¡ãã»ã¼ã¸ãçºã + ããã¾ãã </para> </refsect1> </refentry> Index: phpdoc/ja/functions/yaz.xml diff -u phpdoc/ja/functions/yaz.xml:1.5 phpdoc/ja/functions/yaz.xml:1.6 --- phpdoc/ja/functions/yaz.xml:1.5 Mon Feb 19 01:57:19 2001 +++ phpdoc/ja/functions/yaz.xml Sat Mar 10 21:56:44 2001 @@ -281,7 +281,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>yaz_range</function></funcdef> + <funcdef>int <function>yaz_element</function></funcdef> <paramdef>int <parameter>id</parameter></paramdef> <paramdef>string <parameter>elementset</parameter></paramdef> </funcprototype> Index: phpdoc/ja/language/oop.xml diff -u phpdoc/ja/language/oop.xml:1.6 phpdoc/ja/language/oop.xml:1.7 --- phpdoc/ja/language/oop.xml:1.6 Sat Feb 24 17:00:02 2001 +++ phpdoc/ja/language/oop.xml Sat Mar 10 21:56:44 2001 @@ -30,7 +30,7 @@ } } } -?> +?> </programlisting> </informalexample> </para> @@ -194,6 +194,179 @@ </caution> </sect1> + <sect1 id="language.oop.newref"> + <title>ã³ã³ã¹ãã©ã¯ã¿ã®ä¸ã§ã®åç §</title> + <para> + ã³ã³ã¹ãã©ã¯ã¿ã®ä¸ã§åç §ã使ããã¨çµæãæ··ä¹±ããå¯è½æ§ãããã¾ãã + æ¬ç¯ã§ã¯ãã¥ã¼ããªã¢ã«å½¢å¼ã§èª¬æãã¾ããããã®åé¡ãé¿ããããã«å½¹ + ç«ã¤ã¯ãã§ãã + + <informalexample> + <programlisting role="php"> + +class foo { + function foo($name) { + // å é¨ã¸ã®åç §ã°ãã¼ãã«é å $globalref ã使 + global $globalref; + $globalref[] = &$this; + // name ãæå®ããå¤ã«è¨å® + $this->setName($name); + // ãããåºå + $this->echoName(); + } + + function echoName() { + echo "<br>",$this->Name; + } + + function setName($name) { + $this->Name = $name; + } +} + </programlisting> + </informalexample> + </para> + + <para> + ã³ãã¼æ¼ç®å <literal>=</literal> ã«ãã使ããã + <varname>$bar1</varname> 㨠åç §æ¼ç®å <literal>=&</literal> + ã«ãã使ããã <varname>$bar2</varname> ã®éã®å·®ç°ããããã©ãã + ã確èªãã¦ã¿ã¾ãããã + + <informalexample> + <programlisting role="php"> + + $bar1 = new foo('set in constructor'); + $bar1->echoName(); + $globalref[0]->echoName(); + + /* åºå: + set in constructor + set in constructor + set in constructor */ + + $bar2 =& new foo('set in constructor'); + $bar2->echoName(); + $globalref[1]->echoName(); + + /* åºå: + set in constructor + set in constructor + set in constructor */ + + </programlisting> + </informalexample> + </para> + <para> + æããã«éãã¯ããã¾ããããå®éã«ã¯åä½ã¯é常ã«ç°ãªã£ã¦ãã¾ãã㤠+ ã¾ãã<varname>$bar1</varname> 㨠<varname>$globalref[0]</varname> + ã¯ã åç §ããã¦ããããåã夿°ã§ãããã¾ããã + ããã¯ã"new" ãããã©ã«ãã§åç §ãè¿ããã代ããã«ã³ãã¼ãè¿ããã + ã§ãã + <note> + <simpara> + (PHP 4以éã§ã¯ãªãã¡ã¬ã³ã¹ã«ã¦ã³ãã£ã³ã°ã使ç¨ãã¦ããããã)å + ç §ã§ã¯ãªãã³ãã¼ãè¿ããã¨ã§æ§è½ãä½ä¸ãããã¨ã¯ããã¾ãããéã« + å¤ãã®å ´åãåç §ã使ããããåç´ã«ã³ãã¼ã使ã£ãæ¹ãè¯ãçµæã¨ãª + ãã¾ããããã¯ãåç §ã®ä½æã«ã¯æéããããã¾ãããã³ãã¼ã®ä½æã« + ã¯çæ³çã«ã¯æéãå ¨ãããããªãããã§ãã(ãã ãã大ããªé åã¾ + ãã¯ãªãã¸ã§ã¯ãã§ãã®ä¸ã¤ã夿´ãããã¨ã次ã ã«åç §å ã®ä»ã®è¦ç´ + ã«åç §å ã«æ³¢åããã¨ãã£ãå ´åãé¤ãã¾ã) + </simpara> + </note> + ä¸è¨ã®è¨è¿°ãæ£ãããã¨ã示ãããã«ä»¥ä¸ã®ã³ã¼ããè¦ã¦ã¿ã¾ãããã + + <informalexample> + <programlisting role="php"> +// ããã§ãname ã夿´ãã¦ã¿ã¾ããã©ããªãã§ãããã? +// $bar 㨠$globalref[0] ã®ä¸¡æ¹å ±ååãå¤ããã¨äºæ³ããããããã¾ãã... +$bar1->setName('set from outside'); + +// åè¨ã®ããã«ãã®å ´åã¯éãã¾ãã +$bar1->echoName(); +$globalref[0]->echoName(); + +/* åºå: +set on object creation set from outside */ + +// $bar2 㨠$globalref[1] ã®å·®ãè¦ã¦ã¿ã¾ããã +$bar2->setName('set from outside'); + +// ãã¾ãè¡ãã°ãå¤ãçããã ãã§ãªããåã夿°ã¨ãªãã¾ãã +// ã¤ã¾ãã$bar2->Name 㨠$globalref[1]->Name ãåãã«ãªãã¾ãã +$bar2->echoName(); +$globalref[1]->echoName(); + +/* åºå: +set from outside set from outside */ + + </programlisting> + </informalexample> + </para> + <para> + å¥ã®æå¾ã®ä¾ã«ã¤ãã¦èãã¦ã¿ã¦ä¸ããã + + <informalexample> + <programlisting role="php"> + +class a { + function a($i) { + $this->value = $i; + // ããã§åç §ã使ãå¿ è¦ããªãçç±ãèãã¦ã¿ã¦ä¸ãã + $this->b = new b($this); + } + + function createRef() { + $this->c = new b($this); + } + + function echoValue() { + echo "<br>","class ",get_class($this),': ',$this->value; + } +} + + +class b { + + function b(&$a) { + $this->a = &$a; + } + + function echoValue() { + echo "<br>","class ",get_class($this),': ',$this->a->value; + } + +} + +// 以ä¸ã®åç´ãªã³ãã¼ãã* å°ãä»ããè¡ã§æã¾ãããªãçµæãçãçç±ã +// èãã¦ã¿ã¦ä¸ããã +$a =& new a(10); +$a->createRef(); + +$a->echoValue(); +$a->b->echoValue(); +$a->c->echoValue(); + +$a->value = 11; + +$a->echoValue(); +$a->b->echoValue(); // * +$a->c->echoValue(); + +/* +åºå: +class a: 10 +class b: 10 +class b: 10 +class a: 11 +class b: 11 +class b: 11 +*/ + </programlisting> + </informalexample> + </para> + </sect1> + </chapter> <!-- Keep this comment at the end of the file Index: phpdoc/ja/pear/pear.xml diff -u phpdoc/ja/pear/pear.xml:1.1 phpdoc/ja/pear/pear.xml:1.2 --- phpdoc/ja/pear/pear.xml:1.1 Fri Mar 9 07:33:04 2001 +++ phpdoc/ja/pear/pear.xml Sat Mar 10 21:56:44 2001 @@ -12,7 +12,7 @@ <refentry id="class.pear"> <refnamediv> <refname>PEAR</refname> - <refpurpose>PEAR ãã¼ã¹ã¯ã©ã¹</refpurpose> + <refpurpose>PEARåºåºã¯ã©ã¹</refpurpose> </refnamediv> <refsynopsisdiv> <synopsis>class <replaceable>classname</replaceable> extends <classname>PEAR</classname> { ... }</synopsis> @@ -20,7 +20,7 @@ <refsect1> <title>説æ</title> <simpara> - PEARãã¼ã¹ã¯ã©ã¹ã¯ãå¤ãã®PEARã¯ã©ã¹ã§ä½¿ç¨ãããæ¨æºçãªæ©è½ãæ + PEARåºåºã¯ã©ã¹ã¯ãå¤ãã®PEARã¯ã©ã¹ã§ä½¿ç¨ãããæ¨æºçãªæ©è½ãæ ä¾ãã¾ããé常ãPEARã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãç´æ¥ä½æãããã¨ã¯ãã ã¾ããããã®ã¯ã©ã¹ã®ãµãã¯ã©ã¹åãã¦ä½¿ç¨ãã¦ä¸ããã </simpara> @@ -38,59 +38,60 @@ <refsect2> <title>PEAR "ãã¹ãã©ã¯ã¿"</title> <simpara> - If you inherit <classname>PEAR</classname> in a class called - <replaceable>ClassName</replaceable>, you can define a method in - it called called _<replaceable>ClassName</replaceable> (the - class name with an underscore prepended) that will be invoked - when the request is over. This is not a destructor in the sense - that you can "delete" an object and have the destructor called, - but in the sense that PHP gives you a callback in the object - when it is done executing. See <link - linkend="example.pear.destructors">the example</link> below. + <replaceable>ClassName</replaceable>ã¨ããååã®ã¯ã©ã¹ã§ + <classname>PEAR</classname> ãç¶æ¿ããå ´åã + _<replaceable>ClassName</replaceable> (ã¯ã©ã¹åã®åã«ã¢ã³ãã¼ã¹ + ã³ã¢ãä»ãããã®)ã¨ããã¡ã½ãããå®ç¾©ã§ãã¾ããããã¯ããªã¯ã¨ã¹ + ãã®çµäºæã«ã³ã¼ã«ããã¾ããããã¯ããªãã¸ã§ã¯ãã"åé¤"ã§ãã㨠+ ããæå³ã§ã®ãã¹ãã©ã¯ã¿ã§ã¯ãªããå®è¡ãçµäºããéã«ãªãã¸ã§ã¯ã + å ã§PHPããã®ã³ã¼ã«ããã¯ãæå®ããã¨ããæå³ã§ããã¹ãã©ã¯ã¿ã¨ + å¼ã°ãã¾ãã以ä¸ã® <link linkend="example.pear.destructors">ä¾ + </link> ãåç §ä¸ããã </simpara> </refsect2> + <refsect2> <title>PEARã®ã¨ã©ã¼å¦ç</title> <simpara> - PEAR's base class also provides a way of passing around more - complex errors than a true/false value or a numeric code. A - PEAR error is an object that is either an instance of the class - <classname>PEAR_Error</classname>, or some class inheriting - <classname>PEAR_Error</classname>. + PEARã®åºåºã¯ã©ã¹ã¯ãtrue/falseå¤ãæ°å¤ã³ã¼ããããè¤éãªã¨ã©ã¼ã + æ¸¡ãææ®µãæä¾ãã¾ããPEARã®ã¨ã©ã¼ã¯ãã¯ã©ã¹ + <classname>PEAR_Error</classname>ã¾ã㯠+ <classname>PEAR_Error</classname>ãç¶æ¿ããã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ + ã§ãã </simpara> <simpara> - One of the design criteria of PEAR's errors is that it should - not force a particular type of output on the user, it should be - possible to handle errors without any output at all if that is - desireable. This makes it possible to handle errors gracefully, - also when your output format is different from HTML (for example - WML or some other XML format). + PEARã®ã¨ã©ã¼ã®è¨è¨æéã®ä¸ã¤ã¯ãã¦ã¼ã¶ã«ç¹å®ã®åã®åºåãå¼·å¶ãã + ã¹ãã§ã¯ãªããå¿ è¦ãªãã°åºåãå ¨ãè¡ããã¨ãªãã¨ã©ã¼ãå¦çããã + ã¨ãå¯è½ã«ããã¹ãã§ããã¨ãããã®ã§ããããã«ãããã¨ã©ã¼å¦çã + æè»ã«è¡ããã¨ãå¯è½ã«ãªããã¾ããåºåå½¢å¼ãHTML以å¤ã¨ãªãå ´å + (ä¾ãã°ãWMLã¾ãã¯ä»ã®XMLå½¢å¼)ã§ãå¦çãè¡ããã¨ãå¯è½ã¨ãªãã¾ãã </simpara> <simpara> - The error object can be configured to do a number of things when - it is created, such as printing an error message, printing the - message and exiting, raising an error with PHP's - <function>trigger_error</function> function, invoke a callback, - or none of the above. This is typically specified in - <classname>PEAR_Error</classname>'s constructor, but all of the - parameters are optional, and you can set up defaults for errors - generated from each object based on the - <classname>PEAR</classname> class. See the <link - linkend="example.pear.error1">PEAR error examples</link> for how - to use it and the <classname>PEAR_Error</classname> reference - for the full details. + ã¨ã©ã¼ãªãã¸ã§ã¯ãã¯ã使æã«ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããããã¡ã + ã»ã¼ã¸ãåºåãçµäºããããPHPã® + <function>trigger_error</function>颿°ã§ã¨ã©ã¼ãçºçãã³ã¼ã«ãã + ã¯é¢æ°ãå¼ã³åºãããããããããã¨ãä½ãããªãã¨ãã£ãããã«ä½ã + ãã®åä½ãè¡ãããã«è¨å®å¯è½ã§ãããã®åä½ã¯ãé常ã + <classname>PEAR_Error</classname>ã®ã³ã³ã¹ãã©ã¯ã¿ã§æå®ããã¾ã + ããå ¨ã¦ã®ãã©ã¡ã¼ã¿ã¯ãªãã·ã§ã³ã§ããã + <classname>PEAR</classname>ã¯ã©ã¹ã«åºã¥ãåãªãã¸ã§ã¯ãããçæ + ãããã¨ã©ã¼ç¨ã«ããã©ã«ãå¤ãè¨å®å¯è½ã§ããä½¿ç¨æ³ã«ã¤ãã¦ã¯ + <link linkend="example.pear.error1">PEARã¨ã©ã¼ã®ä¾</link>ã詳細 + ã«ã¤ãã¦ã¯ã<classname>PEAR_Error</classname>ã®ãªãã¡ã¬ã³ã¹ãå + ç §ä¸ããã </simpara> </refsect2> </refsect1> + <refsect1> <title>ä¾</title> <para> - The example below shows how to use the PEAR's "poor man's kinda - emulated destructors" to implement a simple class that holds the - contents of a file, lets you append data to the object and - flushes the data back to the file at the end of the request: + 以ä¸ã®ä¾ã¯ãPEARã®ãè²§ä¹äººã®ãã¹ãã©ã¯ã¿ãã©ããã®ä½¿ç¨æ³ã示ãã + ã®ã§ã宿°ããã¡ã¤ã«ã«ä¿åããç°¡åãªã¯ã©ã¹ãå®è£ ãã¦ããããªãã¸ã§ + ã¯ãã«ãã¼ã¿ã追å ãããªã¯ã¨ã¹ãã®çµäºæã«ãã¡ã¤ã«ã«ãã¼ã¿ãæ¸ã + æ»ãã¾ãã <example id="example.pear.destructors"> - <title>PEAR: emulated destructors</title> + <title>PEAR: ãã¹ãã©ã¯ã¿ã®ã¨ãã¥ã¬ã¼ã·ã§ã³</title> <programlisting role="php"> require_once "PEAR.php"; @@ -102,7 +103,7 @@ function FileContainer($file) { - $this->PEAR(); // this calls the parent class constructor + $this->PEAR(); // ããã«ãã親ã¯ã©ã¹ã®ã³ã³ã¹ãã©ã¯ã¿ãã³ã¼ã«ãã¾ã $fp = fopen($file, "r"); if (!is_resource($fp)) { return; @@ -119,8 +120,8 @@ $this->modified++; } - // The "destructor" is named like the constructor - // but with an underscore in front. + // "destructor" ã¯ãã³ã³ã¹ãã©ã¯ã¿ã¨åæ§ãªååãä»ãããã¦ãã¾ããã + // å é ã«ã¢ã³ãã¼ã¹ã³ã¢ãä»ãã¾ãã function _FileContainer() { if ($this->modified) { @@ -137,28 +138,28 @@ $fileobj = new FileContainer("testfile"); $fileobj->append("this ends up at the end of the file\n"); -// When the request is done and PHP shuts down, $fileobj's -// "destructor" is called and updates the file on disk. +// ãªã¯ã¨ã¹ããçµäºããPHPãã·ã£ãããã¦ã³ããå ´åã$fileobjã® +// "ãã¹ãã©ã¯ã¿" ãã³ã¼ã«ããããã£ã¹ã¯ä¸ã®ãã¡ã¤ã«ãæ´æ°ããã¾ãã -</programlisting> + </programlisting> </example> <note> <simpara> - PEAR "destructors" use PHP's shutdown callbacks - (<function>register_shutdown_function</function>), and you - can't output anything from these when PHP is running in a web - server. So anything printed in a "destructor" gets lost except - when PHP is used in command-line mode. Bummer. + PEARã®"ãã¹ãã©ã¯ã¿"ã¯ãPHPã®ã·ã£ãããã¦ã³ã³ã¼ã«ãã㯠+ (<function>register_shutdown_function</function>)ã使ç¨ãã¾ãã + PHPãWebãµã¼ãä¸ã§å®è¡ãã¦ããå ´åã«ã¯ããããããåºåãè¡ãã + ã¨ã¯ã§ãã¾ããããã®ããã"ãã¹ãã©ã¯ã¿"ããåºåããããã®ã¯ã + ã³ãã³ãã©ã¤ã³ã¢ã¼ãã§PHPã使ç¨ãã¦ããå ´å以å¤ã¯å¤±ããã¾ãã </simpara> </note> </para> <simpara> - The next examples illustrate different ways of using PEAR's error - handling mechanism. + 次ã®ä¾ã¯ãPEARã®ã¨ã©ã¼å¦çæ©æ§ã使ç¨ããå¥ã®ææ³ã«ã¤ãã¦èª¬æãã + ãã®ã§ãã </simpara> <para> <example id="example.pear.error1"> - <title>PEAR error ã®ä¾ (1)</title> + <title>PEAR ã¨ã©ã¼ã®ä¾ (1)</title> <programlisting role="php"> function mysockopen($host = "localhost", $port = 8090) { @@ -173,27 +174,28 @@ if (PEAR::isError($sock)) { print "mysockopen error: ".$sock->getMessage()."<BR>\n" } -</programlisting> + </programlisting> </example> </para> <simpara> - This example shows a wrapper to <function>fsockopen</function> - that delivers the error code and message (if any) returned by - fsockopen in a PEAR error object. Notice that - <function>PEAR::isError</function> is used to detect whether a - value is a PEAR error. + ãã®ä¾ã¯ãã¨ã©ã¼ã³ã¼ãã¨ã¡ãã»ã¼ã¸ãè¿ã + <function>fsockopen</function>ã¸ã®ã©ããã¼ã®ä¾ã§ã(å¿ è¦ãªå ´åã«) + fsockopen ã«ããè¿ãããã¡ãã»ã¼ã¸ãPEARã¨ã©ã¼ãªãã¸ã§ã¯ãã«æ¸¡ã + ã¦ãã¾ããå¤ãPEARã¨ã©ã¼ãã©ããã調ã¹ãããã« + <function>PEAR::isError</function> ã使ç¨ããã¦ãããã¨ã«æ³¨æã㦠+ ä¸ããã </simpara> <simpara> - PEAR_Error's mode of operation in this example is simply - returning the error object and leaving the rest to the user - (programmer). This is the default error mode. + ãã®ä¾ã§ã®PEAR_Errorã®å¦çã¢ã¼ãã¯ãåã«ã¨ã©ã¼ãªãã¸ã§ã¯ããè¿ãã + ä»ã®å¦çã¯ã¦ã¼ã¶(ããã°ã©ã)ã«ã¾ããã¦ãã¾ãããããããã©ã«ãã® + ã¨ã©ã¼ã¢ã¼ãã§ãã </simpara> <simpara> - In the next example we're showing how to use default error modes: + 次ã®ä¾ã§ã¯ãããã©ã«ãã®ã¨ã©ã¼ã¢ã¼ãã®ä½¿ç¨æ³ã示ãã¾ãã </simpara> <para> <example id="example.pear.error2"> - <title>PEAR error example (2)</title> + <title>PEAR ã¨ã©ã¼ã®ä¾ (2)</title> <programlisting role="php"> class TCP_Socket extends PEAR { @@ -217,18 +219,19 @@ $sock->setErrorHandling(PEAR_ERROR_DIE); $sock->connect("localhost", 8090); print "still alive<BR>\n"; -</programlisting> + </programlisting> </example> </para> <simpara> - Here, we set the default error mode to - <constant>PEAR_ERROR_DIE</constant>, and since we don't specify - any error mode in the raiseError call (that'd be the third - parameter), raiseError uses the default error mode and exits if - fsockopen fails. + ããã§ã¯ãããã©ã«ãã®ã¨ã©ã¼ã¢ã¼ãã + <constant>PEAR_ERROR_DIE</constant>ã«è¨å®ãã¦ããã + raiseErrorã³ã¼ã«ã§(3çªç®ã®ãã©ã¡ã¼ã¿ã«ãã)ã¨ã©ã¼ã¢ã¼ããæå®ã㦠+ ããªããããraiseErrorã¯ããã©ã«ãã®ã¨ã©ã¼ã¢ã¼ãã使ç¨ãã + fsockopenã失æããå ´åã«çµäºãã¾ãã </simpara> </refsect1> </refentry> + <refentry id="class.pear-error"> <refnamediv> <refname>PEAR_Error</refname> @@ -240,36 +243,35 @@ <refsect1> <title>ã¨ã©ã¼ã¢ã¼ã</title> <para> - - An error object has a mode of operation that can be set with one - of the following constants: + ã¨ã©ã¼ãªãã¸ã§ã¯ãã¯å¦çã¢ã¼ããæãã¦ãããæ¬¡ã®ã©ãããè¨å®å¯è½ + ã§ãã <variablelist id="pear.error-modes"> - <varlistentry id="constant.pear-error-return"> + <varlistentry id="constant.pear-error-return"> <term>PEAR_ERROR_RETURN</term> - <listitem> - <simpara> - Just return the object, don't do anything special in - PEAR_Error's constructor. - </simpara> - </listitem> - </varlistentry> + <listitem> + <simpara> + ãªãã¸ã§ã¯ããè¿ãã ãã§ãããPEAR_Errorã®ã³ã³ã¹ãã©ã¯ã¿ã§ç¹ + å¥ãªãã¨ã¯ä½ããã¾ããã + </simpara> + </listitem> + </varlistentry> <varlistentry id="constant.pear-error-print"> <term>PEAR_ERROR_PRINT</term> <listitem> <simpara> - Print the error message in the constructor. The execution is - not interrupted. - </simpara> + ã¨ã©ã¼ã¡ãã»ã¼ã¸ãã³ã³ã¹ãã©ã¯ã¿ã§åºåãã¾ããå®è¡ã¯ä¸æãã¾ + ããã + </simpara> </listitem> </varlistentry> <varlistentry id="constant.pear-error-trigger"> <term>PEAR_ERROR_TRIGGER</term> <listitem> <simpara> - Use PHP's <function>trigger_error</function> function to - raise an internal error in PHP. The execution is aborted if - you have defined your own PHP error handler or if you set the - error severity to E_USER_ERROR. + PHPã§å é¨ã¨ã©ã¼ãçºçããããã«PHPã® + <function>trigger_error</function>颿°ã使ç¨ãã¾ããã¦ã¼ã¶ã + PHPã¨ã©ã¼ãã³ãã©ãå®ç¾©ãã¦ãããã¨ã©ã¼ã®severityã + E_USER_ERRORã«è¨å®ãã¦ããå ´åã«å®è¡ã¯çµäºãã¾ãã </simpara> </listitem> </varlistentry> @@ -277,8 +279,8 @@ <term>PEAR_ERROR_DIE</term> <listitem> <simpara> - Print the error message and exit. Execution is of course - aborted. + ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããçµäºãã¾ããå®è¡ã¯ãã¡ããçµäºãã¾ + ãã </simpara> </listitem> </varlistentry> @@ -286,18 +288,20 @@ <term>PEAR_ERROR_CALLBACK</term> <listitem> <simpara> - Use a callback function or method to handle errors. - Execution is aborted. + ã¨ã©ã¼å¦çã«ã³ã¼ã«ããã¯é¢æ°ã¾ãã¯ã¡ã½ããã使ç¨ãã¾ããå®è¡ + ã¯çµäºããã¾ãã </simpara> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1> <title>ããããã£</title> <simpara></simpara> </refsect1> + <refsect1> <title>ã¡ã½ãã</title> <funcsynopsis> @@ -315,13 +319,13 @@ <refsect2> <title>説æ</title> <para> - PEAR_Error constructor. Parameters: + PEAR_Error ã®ã³ã³ã¹ãã©ã¯ã¿ããã©ã¡ã¼ã¿: <variablelist> <varlistentry> <term>message</term> <listitem> <simpara> - error message, defaults to "unknown error" + ã¨ã©ã¼ã¡ãã»ã¼ã¸ãããã©ã«ãã¯ã"unknown error" </simpara> </listitem> </varlistentry> @@ -329,7 +333,7 @@ <term>code</term> <listitem> <simpara> - error code (optional) + ã¨ã©ã¼ã³ã¼ã (ãªãã·ã§ã³) </simpara> </listitem> </varlistentry> @@ -337,9 +341,8 @@ <term>mode</term> <listitem> <simpara> - Mode of operation. See the <link - linkend="pear.error-modes">error modes</link> section for - details. + å¦çã¢ã¼ãã詳細ã¯ã<link linkend="pear.error-modes">ã¨ã©ã¼ + ã¢ã¼ã</link> ã®ç¯ãåç §ä¸ããã </simpara> </listitem> </varlistentry> @@ -347,15 +350,15 @@ <term>options</term> <listitem> <simpara> - If the mode of can have any options specified, use this - parameter. Currently the "trigger" and "callback" modes are - the only using the options parameter. For trigger mode, - this parameter is one of <constant>E_USER_NOTICE</constant>, - <constant>E_USER_WARNING</constant> or - <constant>E_USER_ERROR</constant>. For callback mode, this - parameter should contain either the callback function name - (string), or a two-element (object, string) array - representing an object and a method name. + ãªãã·ã§ã³ãæå®å¯è½ãªã¢ã¼ãã®å ´åããã®ãã©ã¡ã¼ã¿ã使ç¨ã㦠+ ä¸ãããç¾å¨ã"trigger" 㨠"callback" ã¢ã¼ãã®ã¿ããªãã·ã§ã³ + ãã©ã¡ã¼ã¿ã使ç¨ãã¦ãã¾ããtriggerã¢ã¼ãã®å ´åããã®ãã©ã¡ã¼ + ã¿ã¯ã<constant>E_USER_NOTICE</constant>ã + <constant>E_USER_WARNING</constant>ã + <constant>E_USER_ERROR</constant>ã®ã©ããã§ããcallbackã¢ã¼ + ãã®å ´åããã®ãã©ã¡ã¼ã¿ã¯ãã³ã¼ã«ããã¯é¢æ°å(æåå)ã¾ã㯠+ ãªãã¸ã§ã¯ãã¨ã¡ã½ããåã表ãäºã¤ã®è¦ç´ (ãªãã¸ã§ã¯ããæå + å)ãããªãé åã®ã©ã¡ãããæå®ããå¿ è¦ãããã¾ãã </simpara> </listitem> </varlistentry> Index: phpdoc/ja/pear/standards.xml diff -u phpdoc/ja/pear/standards.xml:1.1 phpdoc/ja/pear/standards.xml:1.2 --- phpdoc/ja/pear/standards.xml:1.1 Fri Mar 9 07:33:04 2001 +++ phpdoc/ja/pear/standards.xml Sat Mar 10 21:56:45 2001 @@ -4,32 +4,34 @@ <sect1 id="pear.standards.indenting"> <title>ã¤ã³ãã³ã</title> <para> - Use an indent of 4 spaces, with no tabs. If you use Emacs to edit PEAR - code, you should set indent-tabs-mode to nil. Here is an example mode - hook that will set up Emacs according to these guidelines (you will - need to ensure that it is called when you are editing php files): + ã¤ã³ãã³ãã¨ãã¦ç©ºç½4ã¤ã使ç¨ããã¿ãã¯ä½¿ç¨ããªãã§ä¸ãããPEARã³ã¼ + ããç·¨éããããã«Emacsã使ç¨ãã¦ããå ´åã indent-tabs-mode ã + nil ã«è¨å®ãã¦ä¸ããã以ä¸ã«ãããã®æéã«æ²¿ã£ã¦Emacsãè¨å®ããã + ãã®ã¢ã¼ãããã¯ã®ä¾ã示ãã¾ãã(PHPãã¡ã¤ã«ãç·¨éããéã«ãã®ãã + ã¯ãã³ã¼ã«ãããããã«ããå¿ è¦ãããã¾ãã) <programlisting role="elisp"> (defun php-mode-hook () (setq tab-width 4 c-basic-offset 4 c-hanging-comment-ender-p nil indent-tabs-mode nil)) -</programlisting> + </programlisting> </para> - <para>Here are vim rules for the same thing: + <para> + åããã¨ãè¡ã vim ç¨ã®è¨å®ã示ãã¾ãã <programlisting role="vim"> set expandtab set shiftwidth=4 set tabstop=4 -</programlisting> + </programlisting> </para> </sect1> <sect1 id="pear.standards.control"> <title>å¶å¾¡æ§é </title> <para> - These include if, for, while, switch, etc. Here is an example if - statement, since it is the most complicated of them: + å¶å¾¡æ§é ã«ã¯ãif, for, while, switch, çãå«ã¾ãã¾ããå¶å¾¡æ§é ã®ä¸ + ã§æãè¤éãªifæã®ä¾ã以ä¸ã«ç¤ºãã¾ãã <programlisting role="php"> if ((condition1) || (condition2)) { action1; @@ -41,18 +43,17 @@ </programlisting> </para> <simpara> - Control statements should have one space between the control keyword - and opening parenthesis, to distinguish them from function calls. + å¶å¾¡æã¯ã颿°ã®ã³ã¼ã«ã¨åºå¥ããããã«å¶å¾¡ç¨ã®ãã¼ã¯ã¼ãã¨éãæ¬å¼§ + ã®éã«ç©ºç½ãä¸ã¤ããå¿ è¦ãããã¾ãã </simpara> <simpara> - You are strongly encouraged to always use curly braces even in - situations where they are technically optional. Having them - increases readability and decreases the likelihood of logic errors - being introduced when new lines are added. + ææ³çã«ã¯ä»ã®é¸æè¢ãããã¾ãããå¸¸ã«æ³¢æ¬å¼§ã使ç¨ãããã¨ãå¼·ãæ¨ + 奨ããã¾ãããã®ããã«ãããã¨ã«ãããå¯èªæ§ãåä¸ããæ¹è¡ã追å ã + ããéã«çºçãããããããªãè«çæ§é ä¸ã®ã¨ã©ã¼ãæ¸å°ãã¾ãã </simpara> <para> - For switch statements: - <programlisting role="php"> + switch æã®å ´åã¯æ¬¡ã®ããã«ãã¾ãã + <programlisting role="php"> switch (condition) { case 1: action1; @@ -67,38 +68,36 @@ break; } -</programlisting> + </programlisting> </para> </sect1> <sect1 id="pear.standards.funcalls"> <title>颿°ã®ã³ã¼ã«</title> <para> - Functions should be called with no spaces between the function - name, the opening parenthesis, and the first parameter; spaces - between commas and each parameter, and no space between the last - parameter, the closing parenthesis, and the semicolon. Here's an - example: + 颿°ã¯ã颿°åãéãæ¬å¼§ãæåã®ãã©ã¡ã¼ã¿ã®éã«ç©ºç½ãä»ãã¦ã³ã¼ã« + ããã¹ãã§ã¯ããã¾ãããã¾ããã«ã³ãã¨åãã©ã¡ã¼ã¿ã®éã«ã¯ã空ç½ã + ç½®ããæå¾ã®ãã©ã¡ã¼ã¿ã¨éãæ¬å¼§ããã³ã»ãã³ãã³ã®éã«ã¯ç©ºç½ãç½®ã + ãªãããã«ãã¾ãã以ä¸ã«ä¾ã示ãã¾ãã <programlisting role="php"> $var = foo($bar, $baz, $quux); </programlisting> </para> <para> - As displayed above, there should be one space on either side of an - equals sign used to assign the return value of a function to a - variable. In the case of a block of related assignments, more space - may be inserted to promote readability: + ä¸è¨ã®ããã«ã颿°ã®å¤ã夿°ã«ä»£å ¥ããããã«ä½¿ç¨ãããçå·ã®ä¸¡å´ã« + ã¯ã空ç½ãä¸ã¤ç½®ãã¾ããé¢é£ããä»£å ¥ã®ãããã¯ã®å ´åã«ã¯ãå¯èªæ§ã + åä¸ãããããã«è¤æ°ã®ç©ºç½ãæ¿å ¥ãããã¨ãå¯è½ã§ãã <programlisting role="php"> $short = foo($bar); $long_variable = foo($baz); -</programlisting> + </programlisting> </para> </sect1> <sect1 id="pear.standards.funcdef"> <title>颿°ã®å®ç¾©</title> <para> - Function declaractions follow the "one true brace" convention: + 颿°é¸è¨ã®å¾ã«ã¯ã次ã®ããã«æ³¢æ¬å¼§ãä¸ã¤ç½®ãæµåã¨ãã¾ãã <programlisting role="php"> function fooFunction($arg1, $arg2 = '') { @@ -107,12 +106,12 @@ } return $val; } -</programlisting> + </programlisting> </para> <para> - Arguments with default values go at the end of the argument list. - Always attempt to return a meaningful value from a function if one - is appropriate. Here is a slightly longer example: + ããã©ã«ãå¤ãæãã弿°ã¯ã弿°ãªã¹ãã®æå¾ã«ã¤ãã¾ãã颿°ã®åä½ + ãæ£å¸¸ã§ããå ´åã«ã¯ã常ã«ãã®é¢æ°ããæå³ã®ããå¤ãè¿ãããã«ã㦠+ ä¸ããã以ä¸ã«ããé·ãä¾ã示ãã¾ãã <programlisting role="php"> function connect(&$dsn, $persistent = false) { @@ -135,39 +134,39 @@ <sect1 id="pear.standards.comments"> <title>ã³ã¡ã³ã</title> <para> - Inline documentation for classes should follow the PHPDoc - convention, similar to Javadoc. More information about PHPDoc can - be found here: <ulink url="&url.phpdoc;">&url.phpdoc;</ulink> + ã¯ã©ã¹ç¨ã®ã¤ã³ã©ã¤ã³ããã¥ã¡ã³ãã¯ãJavadocã«ä¼¼ãPHPDocã®æµåã«æ²¿ã£ + ã¦ããå¿ è¦ãããã¾ããPHPDocã«é¢ããããè©³ç´°ãªæ å ±ã¯ã + <ulink url="&url.phpdoc;">&url.phpdoc;</ulink> ã«ããã¾ãã </para> <para> - Non-documentation comments are strongly encouraged. A general rule of - thumb is that if you look at a section of code and think "Wow, I don't - want to try and describe that", you need to comment it before you - forget how it works. + ããã¥ã¡ã³ã以å¤ã®ã³ã¡ã³ããå¼·ãæ¨å¥¨ããã¾ããä¸è¬çãªæéã¨ãã¦ã + ãã³ã¼ãã®ãããã¯ãè¦ã¦ããããã説æãããã¨ã¯æããªããã¨æã£ã + å ´åã«ã¯ãåä½å 容ãå¿ããåã«ã³ã¡ã³ããæ¸ãå¿ è¦ãããã¾ãã </para> <para> - C++ style comments (/* */) and standard C comments (// ) are both - fine. Use of perl/shell style comments (# ) is discouraged. + C å½¢å¼ã®ã³ã¡ã³ã (/* */) ã¨æ¨æºç㪠C++ ã®ã³ã¡ã³ã (// ) ã¯å ±ã«ä½¿ + ç¨å¯è½ã§ããPer/ã·ã§ã«å½¢å¼ã®ã³ã¡ã³ã (# ) ã®ä½¿ç¨ã¯æ¨å¥¨ããã¾ããã </para> </sect1> <sect1 id="pear.standards.including"> <title>ã³ã¼ãã®èªã¿è¾¼ã¿</title> <para> - Anywhere you are unconditionally including a class file, use - <function>require_once</function>. Anywhere you are conditionally - including a class file (for example, factory methods), use - <function>include_once</function>. Either of these will ensure - that class files are included only once. They share the same file - list, so you don't need to worry about mixing them - a file - included with <function>require_once</function> will not be - included again by <function>include_once</function>. + ã¯ã©ã¹ãã¡ã¤ã«ãç¡æ¡ä»¶ã«ã©ããã«èªãè¾¼ãå ´åã«ã¯ã + <function>require_once</function> ã使ç¨ãã¦ä¸ãããæ¡ä»¶ä»ãã§ã¯ã© + ã¹ãã¡ã¤ã«ãã©ããã«èªã¿è¾¼ãå ´å(ä¾ãã°ãfactoryã¡ã½ãã)ã«ã¯ã + <function>include_once</function>ã使ç¨ãã¦ä¸ãããã©ã¡ãã®å ´åã + ã¯ã©ã¹ãã¡ã¤ã«ãä¸åº¦ã ãèªã¿è¾¼ã¾ããããã«ãã¦ä¸ããããããã®ææ³ + ã¯ãåããã¡ã¤ã«ãªã¹ããå ±æãã¦ãããããããããæ··ç¨ãããã¨ãå¿ + é ããå¿ è¦ã¯ããã¾ãããã¤ã¾ãããããã¡ã¤ã«ã + <function>require_once</function> ã§èªã¿è¾¼ãã¨ã + <function>include_once</function>ã§å度èªã¿è¾¼ã¾ãããã¨ã¯ããã¾ã + ãã <note> <simpara> - <function>include_once</function> and - <function>require_once</function> are statements, not - functions. You don't <emphasis>need</emphasis> parentheses - around the filename to be included. + <function>include_once</function> 㨠+ <function>require_once</function> ã¯å½ä»¤ã§ããã颿°ã§ã¯ããã¾ã + ããèªã¿è¾¼ããã¡ã¤ã«åã®åå¾ã«æ¬å¼§ã¯å¿ è¦ããã¾ããã </simpara> </note> </para> @@ -176,18 +175,19 @@ <sect1 id="pear.standards.tags"> <title>PHPã³ã¼ãã®ã¿ã°</title> <para> - <emphasis>Always</emphasis> use <literal><?php ?></literal> to - delimit PHP code, not the <literal><? ?></literal> shorthand. - This is required for PEAR compliance and is also the most portable - way to include PHP code on differing operating systems and setups. + PHPã³ã¼ããè¨è¿°ããéã«ãç縮形㮠<literal><? ?></literal> ã§ã¯ + ãªã <emphasis>常ã«</emphasis> <literal><?php ?></literal> ã使 + ç¨ãã¦ä¸ãããããã¯ãPEARäºæã¨ããããã«å¿ è¦ã§ãããPHPã³ã¼ãã + ç°ãªã£ãã·ã¹ãã ãè¨å®ã§èªã¿è¾¼ãéã«æãç§»æ¤æ§ã®ããææ³ã§ãããã¾ + ãã </para> </sect1> <sect1 id="pear.standards.header"> <title>ãããã®ã³ã¡ã³ãé¨</title> <para> - All source code files in the core PEAR distribution should contain - the following comment block as the header: + PEARã®ã³ã¢ãªé å¸ãã¡ã¤ã«ã«ããå ¨ã¦ã®ã½ã¼ã¹ã³ã¼ããã¡ã¤ã«ã«ã¯ãä»¥ä¸ + ã®ãããªã³ã¡ã³ããããã¯ããããã¨ãã¦è¨è¿°ããã¦ãã¾ãã <programlisting role="php"> /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ @@ -211,36 +211,36 @@ </programlisting> </para> <para> - There's no hard rule to determine when a new code contributer - should be added to the list of authors for a given source file. - In general, their changes should fall into the "substantial" - category (meaning somewhere around 10% to 20% of code changes). - Exceptions could be made for rewriting functions or contributing - new logic. + æ°ããªã³ã¼ãã«è²¢ç®ãã人ããã½ã¼ã¹ãã¡ã¤ã«ä¸ã®ä½è ãªã¹ãã«è¿½å ãã + ããã©ãããå®ç¾©ããæç¢ºãªã«ã¼ã«ã¯ããã¾ãããä¸è¬ã«ãè¡ã£ã夿´ã + ãæ¬è³ªçãªãåºåã«å±ããå ´å(ããã10%ãã20%ã®ã³ã¼ã夿´ãæå³ã + ã¾ã)ã«è¡ããã¾ãã颿°ãæ¸ãç´ããããæ°ããªãã¸ãã¯ã使ããå ´ + åã«ã¯ãã®ä¾å¤ã¨ãªãå ´åãããã¾ãã </para> <para> - Simple code reorganization or bug fixes would not justify the - addition of a new individual to the list of authors. + ç°¡åãªã³ã¼ãã®åæ§æããã°ä¿®æ£ã¯ãä½è ã®ãªã¹ãã¸æ°ãã«äººã追å ãã + ã«ã¯ããããªãã¨æããã¾ãã </para> <para> - Files not in the core PEAR repository should have a similar block - stating the copyright, the license, and the authors. All files - should include the modeline comments to encourage consistency. + PEARã®ã³ã¢ãªã¬ãã¸ããªã«ãªããã¡ã¤ã«ãåæ§ã«è使¨©ãã©ã¤ã»ã³ã¹ãä½ + è ã«é¢ããè¨è¿°ãè¡ãå¿ è¦ãããã¾ããå ¨ã¦ã®ãã¡ã¤ã«ã«ã¯ãäºææ§ãä¿ + ã¤ããã«ãã¢ã¼ãæå®ç¨ã®ã³ã¡ã³ããæ¿å ¥ãã¦ããã¹ãã§ãã </para> </sect1> <sect1 id="pear.standards.cvstags"> <title>CVS ã¿ã°</title> <para> - Include the $Id$ CVS vendor tag in each file. As each file - is edited, add this tag if it's not yet present (or replace - existing forms such as "Last Modified:", etc.). + åãã¡ã¤ã«ã«ã¯ãCVSãã³ãã¼ã¿ã° $Id$ ãæ¿å ¥ãã¦ä¸ã + ããåãã¡ã¤ã«ãç·¨éããéã«ãã¾ã ãªãå ´åã«ã¯ãã®ã¿ã°ã追å ãã¦ä¸ + ããã(ãããã¯ã "Last Modified:"ã®ãããªæ¢åã®å½¢å¼ãç½®æãã¦ä¸ã + ãã) <note> <simpara> - We have a custom $Horde tag in Horde cvs to track our versions - seperately; we could do the same and make a $PEAR tag, that - would remain even if PEAR files were put into another source - control system, etc...] + Horde cvs ã«ã¯ãã¹ã¼ã¸ã§ã³ãå¥åã«ç®¡çããããã«ç¹å¥ãª $Horde ã¿ + ã°ãããã¾ããåæ§ã«$PEARã¿ã°ã使ãããã¨ãã§ãã¾ãããã®å ´åã + PEARãã¡ã¤ã«ãä»ã®ã½ã¼ã¹ã³ã¼ã管çã·ã¹ãã çã«å¦çãããå ´åã§ãã + ã¿ã°ã¯ä¿æããã¾ãã </simpara> </note> </para> @@ -249,18 +249,17 @@ <sect1 id="pear.standards.exampleurls"> <title>URLã®ä¾</title> <para> - Use "example.com" for all example URLs, per RFC 2606. + RFC 2606ã«åºã¥ããä¾ãã°"example.com" ã®ããã«ãã¦ä¸ããã </para> </sect1> <sect1 id="pear.standards.constants"> <title>宿°ã®åå</title> <para> - Constants should always be uppercase, with underscores to seperate - words. Prefix constant names with the name of the class/package - they are used in. For example, the constants used by the - <literal>DB::</literal> package all begin with - "<literal>DB_</literal>". + 宿°ã¯å¸¸ã«å¤§æåã¨ããåèªãåºåãããã«ã¯ãã¢ã³ãã¼ã¹ã³ã¢ã使ç¨ã + ã¦ä¸ãããå«ã¾ãã¦ããã¯ã©ã¹/ããã±ã¼ã¸ã®ååã宿°ã®æ¥é è¾ã¨ã㦠+ ä»ãã¦ä¸ãããä¾ãã°ã<literal>DB::</literal>ããã±ã¼ã¸ã§ä½¿ç¨ãã + ã宿°ã¯å ¨ã¦"<literal>DB_</literal>"ã§å§ã¾ãã¾ãã </para> </sect1>
Index: phpdoc/ja/functions/gmp.xml diff -u phpdoc/ja/functions/gmp.xml:1.4 phpdoc/ja/functions/gmp.xml:1.5 --- phpdoc/ja/functions/gmp.xml:1.4 Thu Mar 1 07:24:45 2001 +++ phpdoc/ja/functions/gmp.xml Sat Mar 10 21:56:43 2001 @@ -367,7 +367,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>resource <function>gmp_divexact</function></funcdef> + <funcdef>resource <function>gmp_div</function></funcdef> <paramdef>resource <parameter>a</parameter></paramdef> <paramdef>resource <parameter>b</parameter></paramdef> </funcprototype> Index: phpdoc/ja/functions/misc.xml diff -u phpdoc/ja/functions/misc.xml:1.15 phpdoc/ja/functions/misc.xml:1.16 --- phpdoc/ja/functions/misc.xml:1.15 Thu Jan 4 22:29:04 2001 +++ phpdoc/ja/functions/misc.xml Sat Mar 10 21:56:43 2001 @@ -76,6 +76,52 @@ </refsect1> </refentry> + <refentry id="function.constant"> + <refnamediv> + <refname>constant</refname> + <refpurpose>宿°ã®å¤ãè¿ã</refpurpose> + </refnamediv> + <refsect1> + <title>説æ</title> + <funcsynopsis> + <funcprototype> + <funcdef>mixed <function>constant</function></funcdef> + <paramdef>string <parameter>name</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>constant</function> ã¯ã<parameter>name</parameter>ã§æ + å®ãã宿°ã®å¤ãè¿ãã¾ãã + </simpara> + <simpara> + <function>constant</function> ã¯ãã宿°ã®å¤ãåå¾ããå¿ è¦ããã + ãããã®ååã䏿ãªå ´åã«æç¨ã§ããããã¯ã宿°ã夿°ã«ä¿åãã + ã¦ãããã颿°ã«ããè¿ããããã®å ´åã§ãã + </simpara> + <para> + <example> + <title><function>constant</function> ã®ä¾</title> + <programlisting role="php"> +<php + +define ("MAXSIZE", 100); + +echo MAXSIZE; +echo constant("MAXSIZE"); // åã®è¡ã¨åä½ã¯åã + +?> + </programlisting> + </example> + </para> + <para> + <function>define</function>, + <function>defined</function>, + <function>constant</function> ããã³ <link + linkend="language.constants">宿°</link> ã®ç¯ãåç §ä¸ããã + </para> + </refsect1> + </refentry> + <refentry id="function.define"> <refnamediv> <refname>define</refname> @@ -148,7 +194,8 @@ è¿ãã¾ãã </para> <para> - <function>defined</function>ããã³ + <function>defined</function>, + <function>constant</function> ããã³ <link linkend="language.constants">宿°</link>ã®ç¯ãåç §ä¸ããã </para> </refsect1> @@ -174,7 +221,8 @@ trueããã®ä»ã®å ´åã«falseãè¿ãã¾ãã </para> <para> - <function>define</function>ããã³ + <function>define</function>, + <function>constant</function> ããã³ <link linkend="language.constants">宿°</link> ã®ç¯ãåç §ä¸ããã </para> </refsect1> @@ -195,21 +243,49 @@ <paramdef>string <parameter>message</parameter></paramdef> </funcprototype> </funcsynopsis> + <simpara> + <function>die</function> ã¯ã<parameter>message</parameter> ãåº + åããã¹ã¯ãªããã®å¦çãçµäºãã¾ãããã®é¢æ°ã¯å¤ãä½ãè¿ãã¾ããã + </simpara> <simpara> - ãã®è¨èªæ§é ã¯ãã¡ãã»ã¼ã¸ãåºåããã¹ã¯ãªããã®å¦çãçµäºãã¾ãã - ãã®é¢æ°ã¯ããªã¿ã¼ã³ãè¡ãã¾ããã + ã¾ãã<function>die</function> ã«ã¯ããã©ã¡ã¼ã¿ã¨ãã¦é¢æ°ãæå®å¯ + è½ã§ãããã®é¢æ°ã¯ã<function>die</function> ãã¹ã¯ãªããã®ãã¼ã¹ + ãçµäºããåã«å®è¡ããã¾ãã </simpara> <para> <example> - <title>die ã®ä¾</title> + <title><function>die</function> ã®ä¾</title> <programlisting role="php"> <?php + $filename = '/path/to/data-file'; -$file = fopen($filename, 'r') - or die "ãã¡ã¤ã«unable to open file ($filename)"; +$file = fopen ($filename, 'r') + or die("unable to open file ($filename)"); + ?> - </programlisting> - </example> + </programlisting> + </example> + </para> + <para> + <example> + <title>颿°ã使ç¨ãã <function>die</function> ã®ä¾</title> + <programlisting role="php"> +<?php + +function handle_error($msg) { + if ($fp = @fopen("/tmp/error.log", "a")) { + fwrite($fp, $msg, strlen($msg)); + fclose($fp); + } +} + +if ($bad) { + die(handle_error("Something bad happened.\n")); +} + +?> + </programlisting> + </example> </para> <simpara> <function>exit</function>ãåç §ä¸ããã @@ -422,8 +498,17 @@ 颿° <function>highlight_file</function>ã¯ã <parameter>filename</parameter>ã®ä¸ã®ã³ã¼ããPHPçµè¾¼ã®æ§æãã¤ã© ã¤ã¿ã§å®ç¾©ãããã«ã©ã¼ã使ç¨ãã¦æ§æãã¤ã©ã¤ã表示ãããã®ãåºå - ãã¾ãã + ãã¾ãããã®é¢æ°ã¯ãæåæã«trueããã®ä»ã®å ´åã«falseãè¿ãã¾ãã + (PHP 4) </simpara> + <note> + <simpara> + 颿° <function>show_source</function> ããã³ + <function>highlight_file</function>ã使ç¨ããå ´åã«ã¯ããã¹ã¯ã¼ + ããæ½å¨çãªã»ãã¥ãªãã£ä¸ã®å±éºãçãé¡ã®ä»ã®æ å ±ã®ãããªéè¦ãª + æ å ±ã䏿³¨æã§å ¬éãã¦ãã¾ããªãããã«æ³¨æããå¿ è¦ãããã¾ãã + </simpara> + </note> <para> <example> <title>URLã®ã½ã¼ã¹ãã¤ã©ã¤ã表示ã®ä½æ</title> @@ -790,7 +875,7 @@ åãæ§é ã失ããã«PHPã®å¤ãä¿åã¾ãã¯æ¸¡ãéã«æå¹ã§ãã </simpara> <simpara> - ã·ãªã¢ã«åã?ãæååãPHPã®å¤ã«æ»ãã«ã¯ã + ã·ãªã¢ã«åãããæååãPHPã®å¤ã«æ»ãã«ã¯ã <function>unserialize</function>ã使ç¨ãã¦ä¸ããã <function>serialize</function>ã¯å<type>integer</type>, <type>double</type>,<type>string</type>,<type>array</type> @@ -842,10 +927,16 @@ æ§æãã¤ã©ã¤ã表示ãåºåãã¾ãã æåæã«trueãããã§ãªãå ´åã«falseãè¿ãã¾ãã(PHP 4) </simpara> + <simpara> + ãã®é¢æ°ã¯ã颿°<function>highlight_file</function>ã®ã¨ã¤ãªã¢ã¹ã§ + ãã + </simpara> <note> <simpara> - ãã®é¢æ°ã¯ã颿°<function>highlight_file</function>ã®ã¨ã¤ãªã¢ã¹ - ã§ãã + 颿° <function>show_source</function> ããã³ + <function>highlight_file</function>ã使ç¨ããå ´åã«ã¯ããã¹ã¯ã¼ + ããæ½å¨çãªã»ãã¥ãªãã£ä¸ã®å±éºãçãé¡ã®ä»ã®æ å ±ã®ãããªéè¦ãª + æ å ±ã䏿³¨æã§å ¬éãã¦ãã¾ããªãããã«æ³¨æããå¿ è¦ãããã¾ãã </simpara> </note> <simpara> Index: phpdoc/ja/functions/mysql.xml diff -u phpdoc/ja/functions/mysql.xml:1.16 phpdoc/ja/functions/mysql.xml:1.17 --- phpdoc/ja/functions/mysql.xml:1.16 Sun Feb 18 15:29:44 2001 +++ phpdoc/ja/functions/mysql.xml Sat Mar 10 21:56:43 2001 @@ -45,18 +45,44 @@ </funcsynopsis> <para> <function>mysql_affected_rows</function>ã¯ãæå®ãã - link_identifierãæããµã¼ãã¼ã«ããã¦ç´è¿ã®INSERTãUPDATEãDELETE - ã¯ã¨ãªã¼ã«ãã夿´ãããè¡ã®æ°ãè¿ãã¾ããlink_identifierãæå®ã - ããªãå ´åãæå¾ã«ãªã¼ãã³ããããªã³ã¯ãä»®å®ããã¾ãã + <parameter>link_identifier</parameter> ãæããµã¼ãã¼ã«ããã¦ç´è¿ + ã®INSERTãUPDATEãDELETEã¯ã¨ãªã¼ã«ãã夿´ãããè¡ã®æ°ãè¿ãã¾ãã + link_identifierãæå®ãããªãå ´åã + <function>mysql_connect</function> ã«ããç´è¿ã«ãªã¼ãã³ããããªã³ + ã¯ãæå®ãããã¨ä»®å®ããã¾ãã </para> + <note> + <para> + ãã©ã³ã¶ã¯ã·ã§ã³ã使ç¨ããå ´åã«ã¯ã ã³ãããå¾ã§ã¯ãªããINSERT, + UPDATE, DELETE ã¯ã¨ãªã®å¾ã« + <function>mysql_affected_rows</function> ãã³ã¼ã«ããå¿ è¦ããã + ã¾ãã + </para> + </note> <para> ç´è¿ã®ã¯ã¨ãªã¼ãWHEREç¯ã®ãªãDELETEã¯ã¨ãªã¼ã§ãã£ãå ´åãå ¨ã¬ã³ã¼ ãã¯ãã¼ãã«ããåé¤ããã¦ãã¾ããããã®é¢æ°ã¯ã¼ããè¿ãã¾ãã </para> + <note> + <para> + UPDATEã使ç¨ããå ´åãMySQL ã¯æ°ããå¤ãå¤ãå¤ã¨åãå ´åã«ã¯ã«ã© + ã ãæ´æ°ãã¾ããããã®ããã + <function>mysql_affected_rows</function> ã¯ãããããè¡ã®æ°ã«ã¯ + ä¸è´ããªãå¯è½æ§ããããåã«ã¯ã¨ãªã«ããæåã®ä¸ã§ä½ç¨ãããè¡ + ã®æ°ã¨ãªãã¾ãã + </para> + </note> + <para> + <function>mysql_affected_rows</function> ã¯ãSELECTæã«ã¯ä½¿ç¨ã§ã + ã¾ãããã¬ã³ã¼ããä¿®æ£ããæã§ã®ã¿ä½¿ç¨ã§ãã¾ããSELECTããè¿ãã + ãè¡ã®æ°ãå¾ãéã«ã¯ã<function>mysql_num_rows</function>ã使ç¨ã + ã¦ä¸ããã + </para> + <para> + ç´è¿ã®ã¯ã¨ãªã失æããå ´åããã®é¢æ°ã¯-1ãè¿ãã¾ãã + </para> <para> - ãã®ã³ãã³ãã¯ãSELECTæã«ã¯ä½¿ç¨ã§ãã¾ãããã¬ã³ã¼ããä¿®æ£ããæ - ã§ã®ã¿ä½¿ç¨ã§ãã¾ããSELECTããè¿ãããè¡ã®æ°ãå¾ãéã«ã¯ã - <function>mysql_num_rows</function>ã使ç¨ãã¦ä¸ããã + <function>mysql_num_rows</function> ãåç §ä¸ããã </para> </refsect1> </refentry> @@ -228,11 +254,13 @@ <title>MySQL ã«æ¥ç¶ããä¾</title> <programlisting role="php"> <?php - $link = mysql_connect ("kraemer", "marliesle", "secret") + + $link = mysql_connect ("localhost", "username", "secret") or die ("æ¥ç¶ã§ãã¾ããã§ãã"); print ("æ¥ç¶ã«æåãã¾ãã"); mysql_close ($link); -?> + +?> </programlisting> </example> <para> @@ -1411,28 +1439,30 @@ <para> <function>mysql_num_rows</function>ã¯çµæã»ããã«ãããè¡ã®æ°ãè¿ ãã¾ãããã®ã³ãã³ãã¯SELECTæã§ã®ã¿æå¹ã§ãã - INSERTãUPDATEãDELETEããè¿ãããè¡ã®æ°ãåå¾ããéã«ã¯ã + INSERTãUPDATEãDELETE ã¯ã¨ãªããè¿ãããè¡ã®æ°ãåå¾ããéã«ã¯ã <function>mysql_affected_rows</function>ã使ç¨ãã¦ä¸ããã <example> - <title> - crubel@trilizio.org ã«ãã <function>mysql_num_rows</function> - ã®ä¾ - </title> + <title><function>mysql_num_rows</function>ã®ä¾</title> <programlisting role="php"> <?php -$conn = mysql_connect("hostaddress", "username", "password"); -mysql_select_db("database",$conn); // è¤æ°ã®ãã¼ã¿ãã¼ã¹ãããå ´åã¯å¿ è¦ -$Resultfornummembers = mysql_query("SELECT * FROM Accounts",$conn); -$NumMembers = mysql_num_rows($Resultfornummembers); -echo "$NumMembers Members"; -?> + +$link = mysql_connect("localhost", "username", "password"); +mysql_select_db("database", $link); + +$result = mysql_query("SELECT * FROM table1", $link); +$num_rows = mysql_num_rows($result); + +echo "$num_rows è¡\n"; + +?> </programlisting> </example> </para> <para> - <function>mysql_db_query</function>ã - <function>mysql_query</function>ã - <function>mysql_fetch_row</function> ãåç §ä¸ããã + <function>mysql_affected_rows</function>, + <function>mysql_connect</function>, + <function>mysql_select_db</function>, + <function>mysql_query</function> ãåç §ä¸ããã </para> <para> ä¸ä½äºææ§ã®ç¶æã®ããã<function>mysql_numrows</function> Index: phpdoc/ja/functions/pcre.xml diff -u phpdoc/ja/functions/pcre.xml:1.18 phpdoc/ja/functions/pcre.xml:1.19 --- phpdoc/ja/functions/pcre.xml:1.18 Sat Mar 3 16:53:36 2001 +++ phpdoc/ja/functions/pcre.xml Sat Mar 10 21:56:43 2001 @@ -939,9 +939,11 @@ </literallayout> </refsect1> - <refsect1> + <refsect1 id="regexp.reference"> <title>æ£è¦è¡¨ç¾ã®è©³ç´°</title> - <literallayout> + <refsect2 id="regexp.introduction"> + <title>å°å ¥</title> + <literallayout> PCRE ã«ãããµãã¼ããããæ£è¦è¡¨ç¾ã®æ§æã以ä¸ã«ç¤ºãã¾ãã æ£è¦è¡¨ç¾ã¯ãPerl ã®ããã¥ã¡ã³ããä»ã®å¤ãã®æ¸ç±ã«ãã㦠è±å¯ãªä¾ã¨å ±ã«èª¬æããã¦ãã¾ãã @@ -958,6 +960,12 @@ The quick brown fox ã¯ãæ¤ç´¢å¯¾è±¡æååã®ããèªä½ã¨åãé¨åã«ããããã¾ãã + </literallayout> + </refsect2> + + <refsect2 id="regexp.reference.meta"> + <title>ã¡ã¿æå</title> + <literallayout> æ£è¦è¡¨ç¾ã®å¼·åãã¯ããã¿ã¼ã³ä¸ã«è¤æ°ã®é¸æè¢ãç¹°ãè¿ã ãå«ãè½åã«ãããã®ã§ãã ãããã¯ã<emphasis>ã¡ã¿</emphasis>-<emphasis>æå</emphasis> ã @@ -992,8 +1000,13 @@ ] æåã¯ã©ã¹ã®çµäº 次ã®ã»ã¯ã·ã§ã³ã§ãåã¡ã¿æåã®ä½¿ç¨æ³ã®èª¬æãè¡ãã¾ãã + + </literallayout> + </refsect2> -ããã¯ã¹ã©ãã·ã¥ + <refsect2 id="regexp.reference.backslash"> + <title>ããã¯ã¹ã©ãã·ã¥</title> + <literallayout> ããã¯ã¹ã©ãã·ã¥ã«ã¯ãããã¤ãã®ä½¿ç¨æ³ãããã¾ããã¾ãã è±åã§ãªãæåãå¾ã«ç¶ãå ´åããã¦Öåãæãã ç¹å¥ãªæå³ã¯å¤±ããã¾ãããã®ããã¯ã¹ã©ãã·ã¥ã®ä½¿ãæ¹ã¯ã @@ -1127,8 +1140,12 @@ åãã¾ããã\Z åã³ \z ã®éãã¯ã\Z ã¯ãæååã®çµç«¯ã¨åæã« æååã®æå¾ã®æåãæ¹è¡ã®å ´åã«åã®æåã«ãã£Ãããã®ã«å¯¾ãã \z ã¯çµç«¯ã«ã®ã¿ããããã¾ãã + </literallayout> + </refsect2> -ãããè¨å·åã³ãã«è¨å· + <refsect2 id="regexp.reference.circudollar"> + <title>ãããè¨å·åã³ãã«è¨å·</title> + <literallayout> æåã¯ã©ã¹ã®å¤å´ã®å ´åãããã©ã«ãã®ãããã¢ã¼ãã§ã¯ããããè¨å·ã¯ ç¾å¨ãããã³ã°ãè¡ã£ã¦ããä½ç½®ã対象æååã®å§ç«¯ã§ããå ´åã«ã®ã¿ trueã¨ãªãè¨æã§ãã @@ -1170,18 +1187,24 @@ 両æ¹ã®ã¢ã¼ãã§å¯¾è±¡ã®å§ç«¯ããã³çµç«¯ã«ããããããããã« ã·ã¼ã±ã³ã¹ \A, \Z, \z ã使ç¨åºæ¥ããã¨ã«æ³¨æãã¦ãã ããã - ãã¿ã¼ã³ã®å £fã®æã \A ãä»ãã¦å§ã¾ãå ´åã + ãã¿ã¼ã³ã®æã \A ãä»ãã¦å§ã¾ãå ´åã PCRE_MULTILINE ã®è¨å®ã«ãããã常ã«ã¢ã³ã«ã¼ä»ãã¨ãªãã¾ãã - -çµæ¢ç¬¦ (ããªãªã, ããã) + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.dot"> + <title>çµæ¢ç¬¦</title> + <literallayout> æåã¯ã©ã¹ã®å¤å´ã§ã¯ããã¿ã¼ã³ã®ä¸ã®ãããã¯éåºåæåãå«ã (ããã©ã«ãã§ã¯)æ¹è¡ä»¥å¤ã®å¯¾è±¡ã®å ¨ã¦ã®1æåã«ããããã¾ãã PCRE_DOTALL ãªãã·ã§ã³ãè¨å®ããå ´åããããã¯æ¹è¡ã«ãããã ãã¾ãããããã®å¦çã¯ããããè¨å·ããã³ãã«è¨å·ã¨ã¯å®å ¨ã«ç¬ç«ã ã¦ãã¾ããå ±éãªç¹ã¯å ±ã«æ¹è¡æåãå«ããã¨ã ãã§ãã ãããã¯ãæåã¯ã©ã¹ã®ä¸ã§ã¯ç¹å¥ãªæå³ãæã¡ã¾ããã - -ãã©ã±ãã + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.squarebrackets"> + <title>è§æ¬å¼§</title> + <literallayout> å·¦ãã©ã±ããã¯æåã¯ã©ã¹ã®éå§ã表ããå³ãã©ã±ããã«ããçµäº ãã¾ããå³ãã©ã±ããã¯ãããèªä½ç¹å¥ãªãã®ã§ã¯ããã¾ããã å³ãã©ã±ãããã¯ã©ã¹ã®ã¡ã³ãã¼ã¨ãã¦å¿ è¦ãªå ´åã(ãããã㪠@@ -1247,9 +1270,11 @@ \, -, (å§ç«¯ã®)^ 以å¤ã®å ¨ã¦ã®è±æ°åã§ãªãæåããã³çµç«¯ã® ] ã¯ã æåã¯ã©ã¹ã«ããã¦ç¹å¥ã§ãªãæåã§ãããã¨ã¹ã±ã¼ãããå ´åã§ã æªå½±é¿ã¯ããã¾ããã - - -åç´ãã¼ + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.verticalbar"> + <title>åç´ãã¼</title> + <literallayout> åç´ãã¼æåã¯ã鏿è¢ãæå®ãããã¿ã¼ã³ã§ä½¿ç¨ããã¾ããä¾ãã°ããã¿ã¼ã³ gilbert|sullivan @@ -1261,9 +1286,13 @@ ã§èª¬æãã)ãµããã¿ã¼ã³ã®ä¸ã«ããå ´åã"æåãã"ã¨ãããã¨ã¯ ãµããã¿ã¼ã³ã®é¸æè¢ã¨åæ§ã«ã¡ã¤ã³ãã¿ã¼ã³ã®æ®ãã®é¨åãããã ããã¨ãããã¨ãæ?Wã¾ãã + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.internal_options"> + <title>å é¨ãªãã·ã§ã³è¨å®</title> + <literallayout> -å é¨ãªãã·ã§ã³è¨å® PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, PCRE_EXTENDED ã® è¨å®ã¯ã"(?" ããã³ ")" ã§æ¬ã£ã Perl ãªãã·ã§ã³æåã«ãã ãã¿ã¼ã³å é¨ã§å¤æ´å¯è½ã§ãã @@ -1324,7 +1353,11 @@ å ã§ä»ã®è¨å®ããªã³ã«ããåã«æå®ããå¿ è¦ãããã¾ãã ãã®ãã©ã°ã¯ãæåã«æå®ããã®ãæåã§ãã -ãµããã¿ã¼ã³ + </literallayout> + </refsect2> + <refsect2 id="regexp.reference.subpatterns"> + <title>ãµããã¿ã¼ã³</title> + <literallayout> ãµããã¿ã¼ã³ã¯æ¬å¼§(丸æ¬å¼§)ã§åºåããããã¹ããå¯è½ã§ãã ãã¿ã¼ã³ã®ä¸é¨ããµããã¿ã¼ã³ã¨ãã¦æå®ããããã«ã¯ã2ã¤ã®ã ã¨ãè¡ãã¾ãã @@ -1378,7 +1411,13 @@ ãã®ãããä¸ã®ãã¿ã¼ã³ã¯ã"Saturday" ã¨åæ§ã«"SUNDAY" ã«ã ããããã¾ãã -ç¹°ãè¿ã + </literallayout> + </refsect2> + + <refsect2 id="regexp.reference.repetition"> + <title>ç¹°ãè¿ã</title> + <literallayout> + ç¹°ãè¿ãã¯ãå復æå®åã«ããæå®ãã¾ããæ¬¡ã®è¦ç´ ã®å¾ã«ä»ãã ãã¨ãåºæ¥ã¾ãã @@ -1502,8 +1541,13 @@ ã "aba" ã«ããããããã¨ã2çªç®ã«åå¾ãããé¨åæååã¯ã "b" ã«ãªãã¾ãã + + </literallayout> + </refsect2> -徿¹åç § + <refsect2 id="regexp.reference.back_references"> + <title>徿¹åç §</title> + <literallayout> æåã¯ã©ã¹ã®å¤ã§ãããã¯ã¹ã©ãã·ã¥ã®å¾ã« 0 ãã大ããæ°åã ä»ãããã®ã¯ãã¿ã¼ã³ã§ä»¥åã«(ããªãã¡å·¦ã«ãã)å¤ãåå¾ãã ãµããã¿ã¼ã³ã«å¯¾ãã徿¹åç §ã§ãããåã«ããå¤ã®åå¾ãè¡ã @@ -1563,8 +1607,12 @@ ããã¾ããããã¯ä¸ã®ä¾ã®ããã«é¸æã使ç¨ããããã¼ããæå°ã¨ ããå復æå®åã«ããè¡ããã¨ãã§ãã¾ãã + </literallayout> + </refsect2> -è¨æ + <refsect2 id="regexp.reference.assertions"> + <title>è¨æ</title> + <literallayout> è¨æã¯ãç¾å¨ããããè¡ã£ã¦ããä½ç½®ã®å¾ã«ç¶ããåã«ããæå㫠対ãããã¹ãã§ãããå®éã«ã¯æåã¸ã®ä½ç¨ãè¡ãã¾ããã @@ -1670,8 +1718,12 @@ è¨æã®æ¬å¼§ã§æ¬ããããµããã¿ã¼ã³ã®æ°ã¯ãæå¤§ 200 ã§ãã + </literallayout> + </refsect2> -ä¸åã ã使ç¨ãããµããã¿ã¼ã³ + <refsect2 id="regexp.reference.onlyonce"> + <title>ä¸åã ã使ç¨ãããµããã¿ã¼ã³</title> + <literallayout> å復ãæå¤§åããã³æå°åããå ´åã¯å ±ã«ãå¾ã«ç¶ããã®ã¸ã®ãã ãã失æããå ´åãå復æ°ãå¤ããå ´åã«ãã¿ã¼ã³ã®æ®ãã«ããã ãããã¨ãã§ãããã©ããã調ã¹ãããã«å復ããé ç®ãåè©ä¾¡ã @@ -1772,7 +1824,12 @@ æ°å以å¤ã®ä¸¦ã³ã«ããä¸åãçãããã¨ããªããªãã失æã¯æ©æã«çã ã¾ãã -æ¡ä»¶ä»ããµããã¿ã¼ã³ + </literallayout> + </refsect2> + + <refsect2 id="regexp.reference.conditional"> + <title>æ¡ä»¶ä»ããµããã¿ã¼ã³</title> + <literallayout> è¨æã®çµæã¾ãã¯åã®å¤ãåå¾ãããµããã¿ã¼ã³ãããããããã© ããã«ããããµããã¿ã¼ã³ã®ãããå¦çãè¡ã£ããããµããã¿ã¼ã³ã® 2ã¤ã®é¸æè¢ã鏿ããããããã¨ãå¯è½ã§ããæ¡ä»¶ä»ããµããã¿ã¼ @@ -1820,8 +1877,13 @@ ã¯ã2çªç®ã«ããããã¾ãããã®ãã¿ã¼ã³ã¯ã2ã¤ã®å½¢å¼ dd-aaa-dd ã¾ã㯠dd-dd-dd ã®ã©ã¡ããã®æååã«ããããã¾ãããã ãã aaa ã¯è±åãdd ã¯æ°åã§ãã + + </literallayout> + </refsect2> -ã³ã¡ã³ã + <refsect2 id="regexp.reference.comments"> + <title>ã³ã¡ã³ã</title> + <literallayout> (?# ã¨ãã並ã³ã¯ãéå§ãæå®ãã¾ããã³ã¡ã³ãã¯ã次ã®å³æ¬å¼§ã¾ã§ ç¶ãã¾ããæ¬å¼§ã®ãã¹ãã¯è¨±å¯ããã¾ãããã³ã¡ã³ãä¸ã®æåã¯ã ãã¿ã¼ã³ãããã³ã°ã«ã¯å ¨ãé¢ä¿ãã¾ããã @@ -1829,8 +1891,13 @@ PCRE_EXTENDED ãªãã·ã§ã³ãè¨å®ããã¦ããå ´åãæåã¯ã©ã¹ã®å¤ ã«ããã¨ã¹ã±ã¼ãããã¦ããªã # æåã¯ãã³ã¡ã³ããæå®ãã¾ãã ã³ã¡ã³ãã¯ããã¿ã¼ã³ä¸ã®æ¬¡ã®æ¹è¡æåã¾ã§ç¶ãã¾ãã + + </literallayout> + </refsect2> -å帰çãã¿ã¼ã³ + <refsect2 id="regexp.reference.recursive"> + <title>å帰çãã¿ã¼ã³</title> + <literallayout> ç¡å¶éã®ãã¹ãã許容ããæ¬å¼§ãå«ãæååã«ããããè¡ãåé¡ãèã ã¦ã¿ã¾ããããå帰ã使ç¨ããªãå ´åãå®ç¾å¯è½ãªæè¯ã®æ¹æ³ã¯ãä½ã ãã®åºå®ããæ·±ãã®ãã¹ãã¾ã§ããããè¡ããã¿ã¼ã³ã使ç¨ãããã¨ã§ @@ -1878,8 +1945,12 @@ å¾ã§ããªãå ´åãã¡ã¢ãªä¸è¶³ã¨ã©ã¼ãå帰ã®å å´ããåºåããææ®µ ã¯ãªããããæåã®15åã®åå¾ç¨æ¬å¼§ã«ã¤ãã¦ã®ã¿ãã¼ã¿ãä¿åã ãã¾ãã + </literallayout> + </refsect2> -æ§è½ + <refsect2 id="regexp.reference.performances"> + <title>æ§è½</title> + <literallayout> ãã¿ã¼ã³ã®å¹¾ã¤ãã®è¦ç´ ã¯ãä»ã®è¦ç´ ãããããå¹ççã§ãã (a|e|i|o|u) ã®ãããªé¸æè¢ã®éåããã [aeiou] ã®ãããªæå㯠ã©ã¹ã®æ¹ãããå¹ççã§ããä¸è¬ã«ãæ§æãæãç°¡åãªãã®ã @@ -1939,7 +2010,8 @@ åè ã¯ãå ¨ä½ã "a" æåã§ããè¡ã«é©ç¨ãããå ´åã«ã»ã¼ç¬éçã«å¤±æ ã¨å¤å®ãã¾ãã䏿¹ãå¾è ã§ã¯ãããã20æåããé·ãæååã§ã¯ã㪠ãã®æéããããã¾ãã - </literallayout> + </literallayout> + </refsect2> </refsect1> </refentry> </reference> Index: phpdoc/ja/functions/posix.xml diff -u phpdoc/ja/functions/posix.xml:1.5 phpdoc/ja/functions/posix.xml:1.6 --- phpdoc/ja/functions/posix.xml:1.5 Fri Oct 13 08:30:56 2000 +++ phpdoc/ja/functions/posix.xml Sat Mar 10 21:56:44 2001 @@ -545,7 +545,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>posix_getcwd</function></funcdef> + <funcdef>bool <function>posix_mkfifo</function></funcdef> <paramdef>string <parameter>pathname</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> Index: phpdoc/ja/functions/recode.xml diff -u phpdoc/ja/functions/recode.xml:1.5 phpdoc/ja/functions/recode.xml:1.6 --- phpdoc/ja/functions/recode.xml:1.5 Sat Nov 11 16:23:31 2000 +++ phpdoc/ja/functions/recode.xml Sat Mar 10 21:56:44 2001 @@ -62,7 +62,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>string <function>recode_string</function></funcdef> + <funcdef>string <function>recode</function></funcdef> <paramdef>string <parameter>request</parameter></paramdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> Index: phpdoc/ja/functions/strings.xml diff -u phpdoc/ja/functions/strings.xml:1.27 phpdoc/ja/functions/strings.xml:1.28 --- phpdoc/ja/functions/strings.xml:1.27 Sat Feb 24 17:00:02 2001 +++ phpdoc/ja/functions/strings.xml Sat Mar 10 21:56:44 2001 @@ -1668,13 +1668,14 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>setlocale</function></funcdef> - <paramdef>string <parameter>category</parameter></paramdef> + <paramdef>mixed <parameter>category</parameter></paramdef> <paramdef>string <parameter>locale</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <parameter>category</parameter>ã¯ããã±ã¼ã«è¨å®ã«ããå½±é¿ã - åãã颿°ã®ã«ãã´ãªãæå®ããæååã§ãã以ä¸ã®ãã®ãããã¾ãã + <parameter>category</parameter>ã¯ãååä»ãã®å®æ°(ã¾ãã¯æåå)ã§ + ããããã±ã¼ã«è¨å®ã«ããå½±é¿ãåãã颿°ã®ã«ãã´ãªãæå®ãã¾ãã + ã«ãã´ãªã«ã¯ã以ä¸ã®ãã®ãããã¾ãã <itemizedlist> <listitem> <simpara> @@ -1720,7 +1721,8 @@ <para> Setlocale ã¯ç¾å¨ã®æ°ãããã±ã¼ã«ãè¿ãããã±ã¼ã«æ©è½ãæªå®è£ ã æå®ããããã±ã¼ã«ãåå¨ããªããã«ãã´ãªåãç¡å¹ãªã©ã®å ´å㯠- å½ãè¿ãã¾ããã¾ããã«ãã´ãªåãç¡å¹ã®å ´åã¯è¦åã¡ãã»ã¼ã¸ãçºãããã¾ãã + å½ãè¿ãã¾ããã¾ããã«ãã´ãªåãç¡å¹ã®å ´åã¯è¦åã¡ãã»ã¼ã¸ãçºã + ããã¾ãã </para> </refsect1> </refentry> Index: phpdoc/ja/functions/yaz.xml diff -u phpdoc/ja/functions/yaz.xml:1.5 phpdoc/ja/functions/yaz.xml:1.6 --- phpdoc/ja/functions/yaz.xml:1.5 Mon Feb 19 01:57:19 2001 +++ phpdoc/ja/functions/yaz.xml Sat Mar 10 21:56:44 2001 @@ -281,7 +281,7 @@ <title>説æ</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>yaz_range</function></funcdef> + <funcdef>int <function>yaz_element</function></funcdef> <paramdef>int <parameter>id</parameter></paramdef> <paramdef>string <parameter>elementset</parameter></paramdef> </funcprototype> Index: phpdoc/ja/language/oop.xml diff -u phpdoc/ja/language/oop.xml:1.6 phpdoc/ja/language/oop.xml:1.7 --- phpdoc/ja/language/oop.xml:1.6 Sat Feb 24 17:00:02 2001 +++ phpdoc/ja/language/oop.xml Sat Mar 10 21:56:44 2001 @@ -30,7 +30,7 @@ } } } -?> +?> </programlisting> </informalexample> </para> @@ -194,6 +194,179 @@ </caution> </sect1> + <sect1 id="language.oop.newref"> + <title>ã³ã³ã¹ãã©ã¯ã¿ã®ä¸ã§ã®åç §</title> + <para> + ã³ã³ã¹ãã©ã¯ã¿ã®ä¸ã§åç §ã使ããã¨çµæãæ··ä¹±ããå¯è½æ§ãããã¾ãã + æ¬ç¯ã§ã¯ãã¥ã¼ããªã¢ã«å½¢å¼ã§èª¬æãã¾ããããã®åé¡ãé¿ããããã«å½¹ + ç«ã¤ã¯ãã§ãã + + <informalexample> + <programlisting role="php"> + +class foo { + function foo($name) { + // å é¨ã¸ã®åç §ã°ãã¼ãã«é å $globalref ã使 + global $globalref; + $globalref[] = &$this; + // name ãæå®ããå¤ã«è¨å® + $this->setName($name); + // ãããåºå + $this->echoName(); + } + + function echoName() { + echo "<br>",$this->Name; + } + + function setName($name) { + $this->Name = $name; + } +} + </programlisting> + </informalexample> + </para> + + <para> + ã³ãã¼æ¼ç®å <literal>=</literal> ã«ãã使ããã + <varname>$bar1</varname> 㨠åç §æ¼ç®å <literal>=&</literal> + ã«ãã使ããã <varname>$bar2</varname> ã®éã®å·®ç°ããããã©ãã + ã確èªãã¦ã¿ã¾ãããã + + <informalexample> + <programlisting role="php"> + + $bar1 = new foo('set in constructor'); + $bar1->echoName(); + $globalref[0]->echoName(); + + /* åºå: + set in constructor + set in constructor + set in constructor */ + + $bar2 =& new foo('set in constructor'); + $bar2->echoName(); + $globalref[1]->echoName(); + + /* åºå: + set in constructor + set in constructor + set in constructor */ + + </programlisting> + </informalexample> + </para> + <para> + æããã«éãã¯ããã¾ããããå®éã«ã¯åä½ã¯é常ã«ç°ãªã£ã¦ãã¾ãã㤠+ ã¾ãã<varname>$bar1</varname> 㨠<varname>$globalref[0]</varname> + ã¯ã åç §ããã¦ããããåã夿°ã§ãããã¾ããã + ããã¯ã"new" ãããã©ã«ãã§åç §ãè¿ããã代ããã«ã³ãã¼ãè¿ããã + ã§ãã + <note> + <simpara> + (PHP 4以éã§ã¯ãªãã¡ã¬ã³ã¹ã«ã¦ã³ãã£ã³ã°ã使ç¨ãã¦ããããã)å + ç §ã§ã¯ãªãã³ãã¼ãè¿ããã¨ã§æ§è½ãä½ä¸ãããã¨ã¯ããã¾ãããéã« + å¤ãã®å ´åãåç §ã使ããããåç´ã«ã³ãã¼ã使ã£ãæ¹ãè¯ãçµæã¨ãª + ãã¾ããããã¯ãåç §ã®ä½æã«ã¯æéããããã¾ãããã³ãã¼ã®ä½æã« + ã¯çæ³çã«ã¯æéãå ¨ãããããªãããã§ãã(ãã ãã大ããªé åã¾ + ãã¯ãªãã¸ã§ã¯ãã§ãã®ä¸ã¤ã夿´ãããã¨ã次ã ã«åç §å ã®ä»ã®è¦ç´ + ã«åç §å ã«æ³¢åããã¨ãã£ãå ´åãé¤ãã¾ã) + </simpara> + </note> + ä¸è¨ã®è¨è¿°ãæ£ãããã¨ã示ãããã«ä»¥ä¸ã®ã³ã¼ããè¦ã¦ã¿ã¾ãããã + + <informalexample> + <programlisting role="php"> +// ããã§ãname ã夿´ãã¦ã¿ã¾ããã©ããªãã§ãããã? +// $bar 㨠$globalref[0] ã®ä¸¡æ¹å ±ååãå¤ããã¨äºæ³ããããããã¾ãã... +$bar1->setName('set from outside'); + +// åè¨ã®ããã«ãã®å ´åã¯éãã¾ãã +$bar1->echoName(); +$globalref[0]->echoName(); + +/* åºå: +set on object creation set from outside */ + +// $bar2 㨠$globalref[1] ã®å·®ãè¦ã¦ã¿ã¾ããã +$bar2->setName('set from outside'); + +// ãã¾ãè¡ãã°ãå¤ãçããã ãã§ãªããåã夿°ã¨ãªãã¾ãã +// ã¤ã¾ãã$bar2->Name 㨠$globalref[1]->Name ãåãã«ãªãã¾ãã +$bar2->echoName(); +$globalref[1]->echoName(); + +/* åºå: +set from outside set from outside */ + + </programlisting> + </informalexample> + </para> + <para> + å¥ã®æå¾ã®ä¾ã«ã¤ãã¦èãã¦ã¿ã¦ä¸ããã + + <informalexample> + <programlisting role="php"> + +class a { + function a($i) { + $this->value = $i; + // ããã§åç §ã使ãå¿ è¦ããªãçç±ãèãã¦ã¿ã¦ä¸ãã + $this->b = new b($this); + } + + function createRef() { + $this->c = new b($this); + } + + function echoValue() { + echo "<br>","class ",get_class($this),': ',$this->value; + } +} + + +class b { + + function b(&$a) { + $this->a = &$a; + } + + function echoValue() { + echo "<br>","class ",get_class($this),': ',$this->a->value; + } + +} + +// 以ä¸ã®åç´ãªã³ãã¼ãã* å°ãä»ããè¡ã§æã¾ãããªãçµæãçãçç±ã +// èãã¦ã¿ã¦ä¸ããã +$a =& new a(10); +$a->createRef(); + +$a->echoValue(); +$a->b->echoValue(); +$a->c->echoValue(); + +$a->value = 11; + +$a->echoValue(); +$a->b->echoValue(); // * +$a->c->echoValue(); + +/* +åºå: +class a: 10 +class b: 10 +class b: 10 +class a: 11 +class b: 11 +class b: 11 +*/ + </programlisting> + </informalexample> + </para> + </sect1> + </chapter> <!-- Keep this comment at the end of the file Index: phpdoc/ja/pear/pear.xml diff -u phpdoc/ja/pear/pear.xml:1.1 phpdoc/ja/pear/pear.xml:1.2 --- phpdoc/ja/pear/pear.xml:1.1 Fri Mar 9 07:33:04 2001 +++ phpdoc/ja/pear/pear.xml Sat Mar 10 21:56:44 2001 @@ -12,7 +12,7 @@ <refentry id="class.pear"> <refnamediv> <refname>PEAR</refname> - <refpurpose>PEAR ãã¼ã¹ã¯ã©ã¹</refpurpose> + <refpurpose>PEARåºåºã¯ã©ã¹</refpurpose> </refnamediv> <refsynopsisdiv> <synopsis>class <replaceable>classname</replaceable> extends <classname>PEAR</classname> { ... }</synopsis> @@ -20,7 +20,7 @@ <refsect1> <title>説æ</title> <simpara> - PEARãã¼ã¹ã¯ã©ã¹ã¯ãå¤ãã®PEARã¯ã©ã¹ã§ä½¿ç¨ãããæ¨æºçãªæ©è½ãæ + PEARåºåºã¯ã©ã¹ã¯ãå¤ãã®PEARã¯ã©ã¹ã§ä½¿ç¨ãããæ¨æºçãªæ©è½ãæ ä¾ãã¾ããé常ãPEARã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãç´æ¥ä½æãããã¨ã¯ãã ã¾ããããã®ã¯ã©ã¹ã®ãµãã¯ã©ã¹åãã¦ä½¿ç¨ãã¦ä¸ããã </simpara> @@ -38,59 +38,60 @@ <refsect2> <title>PEAR "ãã¹ãã©ã¯ã¿"</title> <simpara> - If you inherit <classname>PEAR</classname> in a class called - <replaceable>ClassName</replaceable>, you can define a method in - it called called _<replaceable>ClassName</replaceable> (the - class name with an underscore prepended) that will be invoked - when the request is over. This is not a destructor in the sense - that you can "delete" an object and have the destructor called, - but in the sense that PHP gives you a callback in the object - when it is done executing. See <link - linkend="example.pear.destructors">the example</link> below. + <replaceable>ClassName</replaceable>ã¨ããååã®ã¯ã©ã¹ã§ + <classname>PEAR</classname> ãç¶æ¿ããå ´åã + _<replaceable>ClassName</replaceable> (ã¯ã©ã¹åã®åã«ã¢ã³ãã¼ã¹ + ã³ã¢ãä»ãããã®)ã¨ããã¡ã½ãããå®ç¾©ã§ãã¾ããããã¯ããªã¯ã¨ã¹ + ãã®çµäºæã«ã³ã¼ã«ããã¾ããããã¯ããªãã¸ã§ã¯ãã"åé¤"ã§ãã㨠+ ããæå³ã§ã®ãã¹ãã©ã¯ã¿ã§ã¯ãªããå®è¡ãçµäºããéã«ãªãã¸ã§ã¯ã + å ã§PHPããã®ã³ã¼ã«ããã¯ãæå®ããã¨ããæå³ã§ããã¹ãã©ã¯ã¿ã¨ + å¼ã°ãã¾ãã以ä¸ã® <link linkend="example.pear.destructors">ä¾ + </link> ãåç §ä¸ããã </simpara> </refsect2> + <refsect2> <title>PEARã®ã¨ã©ã¼å¦ç</title> <simpara> - PEAR's base class also provides a way of passing around more - complex errors than a true/false value or a numeric code. A - PEAR error is an object that is either an instance of the class - <classname>PEAR_Error</classname>, or some class inheriting - <classname>PEAR_Error</classname>. + PEARã®åºåºã¯ã©ã¹ã¯ãtrue/falseå¤ãæ°å¤ã³ã¼ããããè¤éãªã¨ã©ã¼ã + æ¸¡ãææ®µãæä¾ãã¾ããPEARã®ã¨ã©ã¼ã¯ãã¯ã©ã¹ + <classname>PEAR_Error</classname>ã¾ã㯠+ <classname>PEAR_Error</classname>ãç¶æ¿ããã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ + ã§ãã </simpara> <simpara> - One of the design criteria of PEAR's errors is that it should - not force a particular type of output on the user, it should be - possible to handle errors without any output at all if that is - desireable. This makes it possible to handle errors gracefully, - also when your output format is different from HTML (for example - WML or some other XML format). + PEARã®ã¨ã©ã¼ã®è¨è¨æéã®ä¸ã¤ã¯ãã¦ã¼ã¶ã«ç¹å®ã®åã®åºåãå¼·å¶ãã + ã¹ãã§ã¯ãªããå¿ è¦ãªãã°åºåãå ¨ãè¡ããã¨ãªãã¨ã©ã¼ãå¦çããã + ã¨ãå¯è½ã«ããã¹ãã§ããã¨ãããã®ã§ããããã«ãããã¨ã©ã¼å¦çã + æè»ã«è¡ããã¨ãå¯è½ã«ãªããã¾ããåºåå½¢å¼ãHTML以å¤ã¨ãªãå ´å + (ä¾ãã°ãWMLã¾ãã¯ä»ã®XMLå½¢å¼)ã§ãå¦çãè¡ããã¨ãå¯è½ã¨ãªãã¾ãã </simpara> <simpara> - The error object can be configured to do a number of things when - it is created, such as printing an error message, printing the - message and exiting, raising an error with PHP's - <function>trigger_error</function> function, invoke a callback, - or none of the above. This is typically specified in - <classname>PEAR_Error</classname>'s constructor, but all of the - parameters are optional, and you can set up defaults for errors - generated from each object based on the - <classname>PEAR</classname> class. See the <link - linkend="example.pear.error1">PEAR error examples</link> for how - to use it and the <classname>PEAR_Error</classname> reference - for the full details. + ã¨ã©ã¼ãªãã¸ã§ã¯ãã¯ã使æã«ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããããã¡ã + ã»ã¼ã¸ãåºåãçµäºããããPHPã® + <function>trigger_error</function>颿°ã§ã¨ã©ã¼ãçºçãã³ã¼ã«ãã + ã¯é¢æ°ãå¼ã³åºãããããããããã¨ãä½ãããªãã¨ãã£ãããã«ä½ã + ãã®åä½ãè¡ãããã«è¨å®å¯è½ã§ãããã®åä½ã¯ãé常ã + <classname>PEAR_Error</classname>ã®ã³ã³ã¹ãã©ã¯ã¿ã§æå®ããã¾ã + ããå ¨ã¦ã®ãã©ã¡ã¼ã¿ã¯ãªãã·ã§ã³ã§ããã + <classname>PEAR</classname>ã¯ã©ã¹ã«åºã¥ãåãªãã¸ã§ã¯ãããçæ + ãããã¨ã©ã¼ç¨ã«ããã©ã«ãå¤ãè¨å®å¯è½ã§ããä½¿ç¨æ³ã«ã¤ãã¦ã¯ + <link linkend="example.pear.error1">PEARã¨ã©ã¼ã®ä¾</link>ã詳細 + ã«ã¤ãã¦ã¯ã<classname>PEAR_Error</classname>ã®ãªãã¡ã¬ã³ã¹ãå + ç §ä¸ããã </simpara> </refsect2> </refsect1> + <refsect1> <title>ä¾</title> <para> - The example below shows how to use the PEAR's "poor man's kinda - emulated destructors" to implement a simple class that holds the - contents of a file, lets you append data to the object and - flushes the data back to the file at the end of the request: + 以ä¸ã®ä¾ã¯ãPEARã®ãè²§ä¹äººã®ãã¹ãã©ã¯ã¿ãã©ããã®ä½¿ç¨æ³ã示ãã + ã®ã§ã宿°ããã¡ã¤ã«ã«ä¿åããç°¡åãªã¯ã©ã¹ãå®è£ ãã¦ããããªãã¸ã§ + ã¯ãã«ãã¼ã¿ã追å ãããªã¯ã¨ã¹ãã®çµäºæã«ãã¡ã¤ã«ã«ãã¼ã¿ãæ¸ã + æ»ãã¾ãã <example id="example.pear.destructors"> - <title>PEAR: emulated destructors</title> + <title>PEAR: ãã¹ãã©ã¯ã¿ã®ã¨ãã¥ã¬ã¼ã·ã§ã³</title> <programlisting role="php"> require_once "PEAR.php"; @@ -102,7 +103,7 @@ function FileContainer($file) { - $this->PEAR(); // this calls the parent class constructor + $this->PEAR(); // ããã«ãã親ã¯ã©ã¹ã®ã³ã³ã¹ãã©ã¯ã¿ãã³ã¼ã«ãã¾ã $fp = fopen($file, "r"); if (!is_resource($fp)) { return; @@ -119,8 +120,8 @@ $this->modified++; } - // The "destructor" is named like the constructor - // but with an underscore in front. + // "destructor" ã¯ãã³ã³ã¹ãã©ã¯ã¿ã¨åæ§ãªååãä»ãããã¦ãã¾ããã + // å é ã«ã¢ã³ãã¼ã¹ã³ã¢ãä»ãã¾ãã function _FileContainer() { if ($this->modified) { @@ -137,28 +138,28 @@ $fileobj = new FileContainer("testfile"); $fileobj->append("this ends up at the end of the file\n"); -// When the request is done and PHP shuts down, $fileobj's -// "destructor" is called and updates the file on disk. +// ãªã¯ã¨ã¹ããçµäºããPHPãã·ã£ãããã¦ã³ããå ´åã$fileobjã® +// "ãã¹ãã©ã¯ã¿" ãã³ã¼ã«ããããã£ã¹ã¯ä¸ã®ãã¡ã¤ã«ãæ´æ°ããã¾ãã -</programlisting> + </programlisting> </example> <note> <simpara> - PEAR "destructors" use PHP's shutdown callbacks - (<function>register_shutdown_function</function>), and you - can't output anything from these when PHP is running in a web - server. So anything printed in a "destructor" gets lost except - when PHP is used in command-line mode. Bummer. + PEARã®"ãã¹ãã©ã¯ã¿"ã¯ãPHPã®ã·ã£ãããã¦ã³ã³ã¼ã«ãã㯠+ (<function>register_shutdown_function</function>)ã使ç¨ãã¾ãã + PHPãWebãµã¼ãä¸ã§å®è¡ãã¦ããå ´åã«ã¯ããããããåºåãè¡ãã + ã¨ã¯ã§ãã¾ããããã®ããã"ãã¹ãã©ã¯ã¿"ããåºåããããã®ã¯ã + ã³ãã³ãã©ã¤ã³ã¢ã¼ãã§PHPã使ç¨ãã¦ããå ´å以å¤ã¯å¤±ããã¾ãã </simpara> </note> </para> <simpara> - The next examples illustrate different ways of using PEAR's error - handling mechanism. + 次ã®ä¾ã¯ãPEARã®ã¨ã©ã¼å¦çæ©æ§ã使ç¨ããå¥ã®ææ³ã«ã¤ãã¦èª¬æãã + ãã®ã§ãã </simpara> <para> <example id="example.pear.error1"> - <title>PEAR error ã®ä¾ (1)</title> + <title>PEAR ã¨ã©ã¼ã®ä¾ (1)</title> <programlisting role="php"> function mysockopen($host = "localhost", $port = 8090) { @@ -173,27 +174,28 @@ if (PEAR::isError($sock)) { print "mysockopen error: ".$sock->getMessage()."<BR>\n" } -</programlisting> + </programlisting> </example> </para> <simpara> - This example shows a wrapper to <function>fsockopen</function> - that delivers the error code and message (if any) returned by - fsockopen in a PEAR error object. Notice that - <function>PEAR::isError</function> is used to detect whether a - value is a PEAR error. + ãã®ä¾ã¯ãã¨ã©ã¼ã³ã¼ãã¨ã¡ãã»ã¼ã¸ãè¿ã + <function>fsockopen</function>ã¸ã®ã©ããã¼ã®ä¾ã§ã(å¿ è¦ãªå ´åã«) + fsockopen ã«ããè¿ãããã¡ãã»ã¼ã¸ãPEARã¨ã©ã¼ãªãã¸ã§ã¯ãã«æ¸¡ã + ã¦ãã¾ããå¤ãPEARã¨ã©ã¼ãã©ããã調ã¹ãããã« + <function>PEAR::isError</function> ã使ç¨ããã¦ãããã¨ã«æ³¨æã㦠+ ä¸ããã </simpara> <simpara> - PEAR_Error's mode of operation in this example is simply - returning the error object and leaving the rest to the user - (programmer). This is the default error mode. + ãã®ä¾ã§ã®PEAR_Errorã®å¦çã¢ã¼ãã¯ãåã«ã¨ã©ã¼ãªãã¸ã§ã¯ããè¿ãã + ä»ã®å¦çã¯ã¦ã¼ã¶(ããã°ã©ã)ã«ã¾ããã¦ãã¾ãããããããã©ã«ãã® + ã¨ã©ã¼ã¢ã¼ãã§ãã </simpara> <simpara> - In the next example we're showing how to use default error modes: + 次ã®ä¾ã§ã¯ãããã©ã«ãã®ã¨ã©ã¼ã¢ã¼ãã®ä½¿ç¨æ³ã示ãã¾ãã </simpara> <para> <example id="example.pear.error2"> - <title>PEAR error example (2)</title> + <title>PEAR ã¨ã©ã¼ã®ä¾ (2)</title> <programlisting role="php"> class TCP_Socket extends PEAR { @@ -217,18 +219,19 @@ $sock->setErrorHandling(PEAR_ERROR_DIE); $sock->connect("localhost", 8090); print "still alive<BR>\n"; -</programlisting> + </programlisting> </example> </para> <simpara> - Here, we set the default error mode to - <constant>PEAR_ERROR_DIE</constant>, and since we don't specify - any error mode in the raiseError call (that'd be the third - parameter), raiseError uses the default error mode and exits if - fsockopen fails. + ããã§ã¯ãããã©ã«ãã®ã¨ã©ã¼ã¢ã¼ãã + <constant>PEAR_ERROR_DIE</constant>ã«è¨å®ãã¦ããã + raiseErrorã³ã¼ã«ã§(3çªç®ã®ãã©ã¡ã¼ã¿ã«ãã)ã¨ã©ã¼ã¢ã¼ããæå®ã㦠+ ããªããããraiseErrorã¯ããã©ã«ãã®ã¨ã©ã¼ã¢ã¼ãã使ç¨ãã + fsockopenã失æããå ´åã«çµäºãã¾ãã </simpara> </refsect1> </refentry> + <refentry id="class.pear-error"> <refnamediv> <refname>PEAR_Error</refname> @@ -240,36 +243,35 @@ <refsect1> <title>ã¨ã©ã¼ã¢ã¼ã</title> <para> - - An error object has a mode of operation that can be set with one - of the following constants: + ã¨ã©ã¼ãªãã¸ã§ã¯ãã¯å¦çã¢ã¼ããæãã¦ãããæ¬¡ã®ã©ãããè¨å®å¯è½ + ã§ãã <variablelist id="pear.error-modes"> - <varlistentry id="constant.pear-error-return"> + <varlistentry id="constant.pear-error-return"> <term>PEAR_ERROR_RETURN</term> - <listitem> - <simpara> - Just return the object, don't do anything special in - PEAR_Error's constructor. - </simpara> - </listitem> - </varlistentry> + <listitem> + <simpara> + ãªãã¸ã§ã¯ããè¿ãã ãã§ãããPEAR_Errorã®ã³ã³ã¹ãã©ã¯ã¿ã§ç¹ + å¥ãªãã¨ã¯ä½ããã¾ããã + </simpara> + </listitem> + </varlistentry> <varlistentry id="constant.pear-error-print"> <term>PEAR_ERROR_PRINT</term> <listitem> <simpara> - Print the error message in the constructor. The execution is - not interrupted. - </simpara> + ã¨ã©ã¼ã¡ãã»ã¼ã¸ãã³ã³ã¹ãã©ã¯ã¿ã§åºåãã¾ããå®è¡ã¯ä¸æãã¾ + ããã + </simpara> </listitem> </varlistentry> <varlistentry id="constant.pear-error-trigger"> <term>PEAR_ERROR_TRIGGER</term> <listitem> <simpara> - Use PHP's <function>trigger_error</function> function to - raise an internal error in PHP. The execution is aborted if - you have defined your own PHP error handler or if you set the - error severity to E_USER_ERROR. + PHPã§å é¨ã¨ã©ã¼ãçºçããããã«PHPã® + <function>trigger_error</function>颿°ã使ç¨ãã¾ããã¦ã¼ã¶ã + PHPã¨ã©ã¼ãã³ãã©ãå®ç¾©ãã¦ãããã¨ã©ã¼ã®severityã + E_USER_ERRORã«è¨å®ãã¦ããå ´åã«å®è¡ã¯çµäºãã¾ãã </simpara> </listitem> </varlistentry> @@ -277,8 +279,8 @@ <term>PEAR_ERROR_DIE</term> <listitem> <simpara> - Print the error message and exit. Execution is of course - aborted. + ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããçµäºãã¾ããå®è¡ã¯ãã¡ããçµäºãã¾ + ãã </simpara> </listitem> </varlistentry> @@ -286,18 +288,20 @@ <term>PEAR_ERROR_CALLBACK</term> <listitem> <simpara> - Use a callback function or method to handle errors. - Execution is aborted. + ã¨ã©ã¼å¦çã«ã³ã¼ã«ããã¯é¢æ°ã¾ãã¯ã¡ã½ããã使ç¨ãã¾ããå®è¡ + ã¯çµäºããã¾ãã </simpara> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1> <title>ããããã£</title> <simpara></simpara> </refsect1> + <refsect1> <title>ã¡ã½ãã</title> <funcsynopsis> @@ -315,13 +319,13 @@ <refsect2> <title>説æ</title> <para> - PEAR_Error constructor. Parameters: + PEAR_Error ã®ã³ã³ã¹ãã©ã¯ã¿ããã©ã¡ã¼ã¿: <variablelist> <varlistentry> <term>message</term> <listitem> <simpara> - error message, defaults to "unknown error" + ã¨ã©ã¼ã¡ãã»ã¼ã¸ãããã©ã«ãã¯ã"unknown error" </simpara> </listitem> </varlistentry> @@ -329,7 +333,7 @@ <term>code</term> <listitem> <simpara> - error code (optional) + ã¨ã©ã¼ã³ã¼ã (ãªãã·ã§ã³) </simpara> </listitem> </varlistentry> @@ -337,9 +341,8 @@ <term>mode</term> <listitem> <simpara> - Mode of operation. See the <link - linkend="pear.error-modes">error modes</link> section for - details. + å¦çã¢ã¼ãã詳細ã¯ã<link linkend="pear.error-modes">ã¨ã©ã¼ + ã¢ã¼ã</link> ã®ç¯ãåç §ä¸ããã </simpara> </listitem> </varlistentry> @@ -347,15 +350,15 @@ <term>options</term> <listitem> <simpara> - If the mode of can have any options specified, use this - parameter. Currently the "trigger" and "callback" modes are - the only using the options parameter. For trigger mode, - this parameter is one of <constant>E_USER_NOTICE</constant>, - <constant>E_USER_WARNING</constant> or - <constant>E_USER_ERROR</constant>. For callback mode, this - parameter should contain either the callback function name - (string), or a two-element (object, string) array - representing an object and a method name. + ãªãã·ã§ã³ãæå®å¯è½ãªã¢ã¼ãã®å ´åããã®ãã©ã¡ã¼ã¿ã使ç¨ã㦠+ ä¸ãããç¾å¨ã"trigger" 㨠"callback" ã¢ã¼ãã®ã¿ããªãã·ã§ã³ + ãã©ã¡ã¼ã¿ã使ç¨ãã¦ãã¾ããtriggerã¢ã¼ãã®å ´åããã®ãã©ã¡ã¼ + ã¿ã¯ã<constant>E_USER_NOTICE</constant>ã + <constant>E_USER_WARNING</constant>ã + <constant>E_USER_ERROR</constant>ã®ã©ããã§ããcallbackã¢ã¼ + ãã®å ´åããã®ãã©ã¡ã¼ã¿ã¯ãã³ã¼ã«ããã¯é¢æ°å(æåå)ã¾ã㯠+ ãªãã¸ã§ã¯ãã¨ã¡ã½ããåã表ãäºã¤ã®è¦ç´ (ãªãã¸ã§ã¯ããæå + å)ãããªãé åã®ã©ã¡ãããæå®ããå¿ è¦ãããã¾ãã </simpara> </listitem> </varlistentry> Index: phpdoc/ja/pear/standards.xml diff -u phpdoc/ja/pear/standards.xml:1.1 phpdoc/ja/pear/standards.xml:1.2 --- phpdoc/ja/pear/standards.xml:1.1 Fri Mar 9 07:33:04 2001 +++ phpdoc/ja/pear/standards.xml Sat Mar 10 21:56:45 2001 @@ -4,32 +4,34 @@ <sect1 id="pear.standards.indenting"> <title>ã¤ã³ãã³ã</title> <para> - Use an indent of 4 spaces, with no tabs. If you use Emacs to edit PEAR - code, you should set indent-tabs-mode to nil. Here is an example mode - hook that will set up Emacs according to these guidelines (you will - need to ensure that it is called when you are editing php files): + ã¤ã³ãã³ãã¨ãã¦ç©ºç½4ã¤ã使ç¨ããã¿ãã¯ä½¿ç¨ããªãã§ä¸ãããPEARã³ã¼ + ããç·¨éããããã«Emacsã使ç¨ãã¦ããå ´åã indent-tabs-mode ã + nil ã«è¨å®ãã¦ä¸ããã以ä¸ã«ãããã®æéã«æ²¿ã£ã¦Emacsãè¨å®ããã + ãã®ã¢ã¼ãããã¯ã®ä¾ã示ãã¾ãã(PHPãã¡ã¤ã«ãç·¨éããéã«ãã®ãã + ã¯ãã³ã¼ã«ãããããã«ããå¿ è¦ãããã¾ãã) <programlisting role="elisp"> (defun php-mode-hook () (setq tab-width 4 c-basic-offset 4 c-hanging-comment-ender-p nil indent-tabs-mode nil)) -</programlisting> + </programlisting> </para> - <para>Here are vim rules for the same thing: + <para> + åããã¨ãè¡ã vim ç¨ã®è¨å®ã示ãã¾ãã <programlisting role="vim"> set expandtab set shiftwidth=4 set tabstop=4 -</programlisting> + </programlisting> </para> </sect1> <sect1 id="pear.standards.control"> <title>å¶å¾¡æ§é </title> <para> - These include if, for, while, switch, etc. Here is an example if - statement, since it is the most complicated of them: + å¶å¾¡æ§é ã«ã¯ãif, for, while, switch, çãå«ã¾ãã¾ããå¶å¾¡æ§é ã®ä¸ + ã§æãè¤éãªifæã®ä¾ã以ä¸ã«ç¤ºãã¾ãã <programlisting role="php"> if ((condition1) || (condition2)) { action1; @@ -41,18 +43,17 @@ </programlisting> </para> <simpara> - Control statements should have one space between the control keyword - and opening parenthesis, to distinguish them from function calls. + å¶å¾¡æã¯ã颿°ã®ã³ã¼ã«ã¨åºå¥ããããã«å¶å¾¡ç¨ã®ãã¼ã¯ã¼ãã¨éãæ¬å¼§ + ã®éã«ç©ºç½ãä¸ã¤ããå¿ è¦ãããã¾ãã </simpara> <simpara> - You are strongly encouraged to always use curly braces even in - situations where they are technically optional. Having them - increases readability and decreases the likelihood of logic errors - being introduced when new lines are added. + ææ³çã«ã¯ä»ã®é¸æè¢ãããã¾ãããå¸¸ã«æ³¢æ¬å¼§ã使ç¨ãããã¨ãå¼·ãæ¨ + 奨ããã¾ãããã®ããã«ãããã¨ã«ãããå¯èªæ§ãåä¸ããæ¹è¡ã追å ã + ããéã«çºçãããããããªãè«çæ§é ä¸ã®ã¨ã©ã¼ãæ¸å°ãã¾ãã </simpara> <para> - For switch statements: - <programlisting role="php"> + switch æã®å ´åã¯æ¬¡ã®ããã«ãã¾ãã + <programlisting role="php"> switch (condition) { case 1: action1; @@ -67,38 +68,36 @@ break; } -</programlisting> + </programlisting> </para> </sect1> <sect1 id="pear.standards.funcalls"> <title>颿°ã®ã³ã¼ã«</title> <para> - Functions should be called with no spaces between the function - name, the opening parenthesis, and the first parameter; spaces - between commas and each parameter, and no space between the last - parameter, the closing parenthesis, and the semicolon. Here's an - example: + 颿°ã¯ã颿°åãéãæ¬å¼§ãæåã®ãã©ã¡ã¼ã¿ã®éã«ç©ºç½ãä»ãã¦ã³ã¼ã« + ããã¹ãã§ã¯ããã¾ãããã¾ããã«ã³ãã¨åãã©ã¡ã¼ã¿ã®éã«ã¯ã空ç½ã + ç½®ããæå¾ã®ãã©ã¡ã¼ã¿ã¨éãæ¬å¼§ããã³ã»ãã³ãã³ã®éã«ã¯ç©ºç½ãç½®ã + ãªãããã«ãã¾ãã以ä¸ã«ä¾ã示ãã¾ãã <programlisting role="php"> $var = foo($bar, $baz, $quux); </programlisting> </para> <para> - As displayed above, there should be one space on either side of an - equals sign used to assign the return value of a function to a - variable. In the case of a block of related assignments, more space - may be inserted to promote readability: + ä¸è¨ã®ããã«ã颿°ã®å¤ã夿°ã«ä»£å ¥ããããã«ä½¿ç¨ãããçå·ã®ä¸¡å´ã« + ã¯ã空ç½ãä¸ã¤ç½®ãã¾ããé¢é£ããä»£å ¥ã®ãããã¯ã®å ´åã«ã¯ãå¯èªæ§ã + åä¸ãããããã«è¤æ°ã®ç©ºç½ãæ¿å ¥ãããã¨ãå¯è½ã§ãã <programlisting role="php"> $short = foo($bar); $long_variable = foo($baz); -</programlisting> + </programlisting> </para> </sect1> <sect1 id="pear.standards.funcdef"> <title>颿°ã®å®ç¾©</title> <para> - Function declaractions follow the "one true brace" convention: + 颿°é¸è¨ã®å¾ã«ã¯ã次ã®ããã«æ³¢æ¬å¼§ãä¸ã¤ç½®ãæµåã¨ãã¾ãã <programlisting role="php"> function fooFunction($arg1, $arg2 = '') { @@ -107,12 +106,12 @@ } return $val; } -</programlisting> + </programlisting> </para> <para> - Arguments with default values go at the end of the argument list. - Always attempt to return a meaningful value from a function if one - is appropriate. Here is a slightly longer example: + ããã©ã«ãå¤ãæãã弿°ã¯ã弿°ãªã¹ãã®æå¾ã«ã¤ãã¾ãã颿°ã®åä½ + ãæ£å¸¸ã§ããå ´åã«ã¯ã常ã«ãã®é¢æ°ããæå³ã®ããå¤ãè¿ãããã«ã㦠+ ä¸ããã以ä¸ã«ããé·ãä¾ã示ãã¾ãã <programlisting role="php"> function connect(&$dsn, $persistent = false) { @@ -135,39 +134,39 @@ <sect1 id="pear.standards.comments"> <title>ã³ã¡ã³ã</title> <para> - Inline documentation for classes should follow the PHPDoc - convention, similar to Javadoc. More information about PHPDoc can - be found here: <ulink url="&url.phpdoc;">&url.phpdoc;</ulink> + ã¯ã©ã¹ç¨ã®ã¤ã³ã©ã¤ã³ããã¥ã¡ã³ãã¯ãJavadocã«ä¼¼ãPHPDocã®æµåã«æ²¿ã£ + ã¦ããå¿ è¦ãããã¾ããPHPDocã«é¢ããããè©³ç´°ãªæ å ±ã¯ã + <ulink url="&url.phpdoc;">&url.phpdoc;</ulink> ã«ããã¾ãã </para> <para> - Non-documentation comments are strongly encouraged. A general rule of - thumb is that if you look at a section of code and think "Wow, I don't - want to try and describe that", you need to comment it before you - forget how it works. + ããã¥ã¡ã³ã以å¤ã®ã³ã¡ã³ããå¼·ãæ¨å¥¨ããã¾ããä¸è¬çãªæéã¨ãã¦ã + ãã³ã¼ãã®ãããã¯ãè¦ã¦ããããã説æãããã¨ã¯æããªããã¨æã£ã + å ´åã«ã¯ãåä½å 容ãå¿ããåã«ã³ã¡ã³ããæ¸ãå¿ è¦ãããã¾ãã </para> <para> - C++ style comments (/* */) and standard C comments (// ) are both - fine. Use of perl/shell style comments (# ) is discouraged. + C å½¢å¼ã®ã³ã¡ã³ã (/* */) ã¨æ¨æºç㪠C++ ã®ã³ã¡ã³ã (// ) ã¯å ±ã«ä½¿ + ç¨å¯è½ã§ããPer/ã·ã§ã«å½¢å¼ã®ã³ã¡ã³ã (# ) ã®ä½¿ç¨ã¯æ¨å¥¨ããã¾ããã </para> </sect1> <sect1 id="pear.standards.including"> <title>ã³ã¼ãã®èªã¿è¾¼ã¿</title> <para> - Anywhere you are unconditionally including a class file, use - <function>require_once</function>. Anywhere you are conditionally - including a class file (for example, factory methods), use - <function>include_once</function>. Either of these will ensure - that class files are included only once. They share the same file - list, so you don't need to worry about mixing them - a file - included with <function>require_once</function> will not be - included again by <function>include_once</function>. + ã¯ã©ã¹ãã¡ã¤ã«ãç¡æ¡ä»¶ã«ã©ããã«èªãè¾¼ãå ´åã«ã¯ã + <function>require_once</function> ã使ç¨ãã¦ä¸ãããæ¡ä»¶ä»ãã§ã¯ã© + ã¹ãã¡ã¤ã«ãã©ããã«èªã¿è¾¼ãå ´å(ä¾ãã°ãfactoryã¡ã½ãã)ã«ã¯ã + <function>include_once</function>ã使ç¨ãã¦ä¸ãããã©ã¡ãã®å ´åã + ã¯ã©ã¹ãã¡ã¤ã«ãä¸åº¦ã ãèªã¿è¾¼ã¾ããããã«ãã¦ä¸ããããããã®ææ³ + ã¯ãåããã¡ã¤ã«ãªã¹ããå ±æãã¦ãããããããããæ··ç¨ãããã¨ãå¿ + é ããå¿ è¦ã¯ããã¾ãããã¤ã¾ãããããã¡ã¤ã«ã + <function>require_once</function> ã§èªã¿è¾¼ãã¨ã + <function>include_once</function>ã§å度èªã¿è¾¼ã¾ãããã¨ã¯ããã¾ã + ãã <note> <simpara> - <function>include_once</function> and - <function>require_once</function> are statements, not - functions. You don't <emphasis>need</emphasis> parentheses - around the filename to be included. + <function>include_once</function> 㨠+ <function>require_once</function> ã¯å½ä»¤ã§ããã颿°ã§ã¯ããã¾ã + ããèªã¿è¾¼ããã¡ã¤ã«åã®åå¾ã«æ¬å¼§ã¯å¿ è¦ããã¾ããã </simpara> </note> </para> @@ -176,18 +175,19 @@ <sect1 id="pear.standards.tags"> <title>PHPã³ã¼ãã®ã¿ã°</title> <para> - <emphasis>Always</emphasis> use <literal><?php ?></literal> to - delimit PHP code, not the <literal><? ?></literal> shorthand. - This is required for PEAR compliance and is also the most portable - way to include PHP code on differing operating systems and setups. + PHPã³ã¼ããè¨è¿°ããéã«ãç縮形㮠<literal><? ?></literal> ã§ã¯ + ãªã <emphasis>常ã«</emphasis> <literal><?php ?></literal> ã使 + ç¨ãã¦ä¸ãããããã¯ãPEARäºæã¨ããããã«å¿ è¦ã§ãããPHPã³ã¼ãã + ç°ãªã£ãã·ã¹ãã ãè¨å®ã§èªã¿è¾¼ãéã«æãç§»æ¤æ§ã®ããææ³ã§ãããã¾ + ãã </para> </sect1> <sect1 id="pear.standards.header"> <title>ãããã®ã³ã¡ã³ãé¨</title> <para> - All source code files in the core PEAR distribution should contain - the following comment block as the header: + PEARã®ã³ã¢ãªé å¸ãã¡ã¤ã«ã«ããå ¨ã¦ã®ã½ã¼ã¹ã³ã¼ããã¡ã¤ã«ã«ã¯ãä»¥ä¸ + ã®ãããªã³ã¡ã³ããããã¯ããããã¨ãã¦è¨è¿°ããã¦ãã¾ãã <programlisting role="php"> /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ @@ -211,36 +211,36 @@ </programlisting> </para> <para> - There's no hard rule to determine when a new code contributer - should be added to the list of authors for a given source file. - In general, their changes should fall into the "substantial" - category (meaning somewhere around 10% to 20% of code changes). - Exceptions could be made for rewriting functions or contributing - new logic. + æ°ããªã³ã¼ãã«è²¢ç®ãã人ããã½ã¼ã¹ãã¡ã¤ã«ä¸ã®ä½è ãªã¹ãã«è¿½å ãã + ããã©ãããå®ç¾©ããæç¢ºãªã«ã¼ã«ã¯ããã¾ãããä¸è¬ã«ãè¡ã£ã夿´ã + ãæ¬è³ªçãªãåºåã«å±ããå ´å(ããã10%ãã20%ã®ã³ã¼ã夿´ãæå³ã + ã¾ã)ã«è¡ããã¾ãã颿°ãæ¸ãç´ããããæ°ããªãã¸ãã¯ã使ããå ´ + åã«ã¯ãã®ä¾å¤ã¨ãªãå ´åãããã¾ãã </para> <para> - Simple code reorganization or bug fixes would not justify the - addition of a new individual to the list of authors. + ç°¡åãªã³ã¼ãã®åæ§æããã°ä¿®æ£ã¯ãä½è ã®ãªã¹ãã¸æ°ãã«äººã追å ãã + ã«ã¯ããããªãã¨æããã¾ãã </para> <para> - Files not in the core PEAR repository should have a similar block - stating the copyright, the license, and the authors. All files - should include the modeline comments to encourage consistency. + PEARã®ã³ã¢ãªã¬ãã¸ããªã«ãªããã¡ã¤ã«ãåæ§ã«è使¨©ãã©ã¤ã»ã³ã¹ãä½ + è ã«é¢ããè¨è¿°ãè¡ãå¿ è¦ãããã¾ããå ¨ã¦ã®ãã¡ã¤ã«ã«ã¯ãäºææ§ãä¿ + ã¤ããã«ãã¢ã¼ãæå®ç¨ã®ã³ã¡ã³ããæ¿å ¥ãã¦ããã¹ãã§ãã </para> </sect1> <sect1 id="pear.standards.cvstags"> <title>CVS ã¿ã°</title> <para> - Include the $Id$ CVS vendor tag in each file. As each file - is edited, add this tag if it's not yet present (or replace - existing forms such as "Last Modified:", etc.). + åãã¡ã¤ã«ã«ã¯ãCVSãã³ãã¼ã¿ã° $Id$ ãæ¿å ¥ãã¦ä¸ã + ããåãã¡ã¤ã«ãç·¨éããéã«ãã¾ã ãªãå ´åã«ã¯ãã®ã¿ã°ã追å ãã¦ä¸ + ããã(ãããã¯ã "Last Modified:"ã®ãããªæ¢åã®å½¢å¼ãç½®æãã¦ä¸ã + ãã) <note> <simpara> - We have a custom $Horde tag in Horde cvs to track our versions - seperately; we could do the same and make a $PEAR tag, that - would remain even if PEAR files were put into another source - control system, etc...] + Horde cvs ã«ã¯ãã¹ã¼ã¸ã§ã³ãå¥åã«ç®¡çããããã«ç¹å¥ãª $Horde ã¿ + ã°ãããã¾ããåæ§ã«$PEARã¿ã°ã使ãããã¨ãã§ãã¾ãããã®å ´åã + PEARãã¡ã¤ã«ãä»ã®ã½ã¼ã¹ã³ã¼ã管çã·ã¹ãã çã«å¦çãããå ´åã§ãã + ã¿ã°ã¯ä¿æããã¾ãã </simpara> </note> </para> @@ -249,18 +249,17 @@ <sect1 id="pear.standards.exampleurls"> <title>URLã®ä¾</title> <para> - Use "example.com" for all example URLs, per RFC 2606. + RFC 2606ã«åºã¥ããä¾ãã°"example.com" ã®ããã«ãã¦ä¸ããã </para> </sect1> <sect1 id="pear.standards.constants"> <title>宿°ã®åå</title> <para> - Constants should always be uppercase, with underscores to seperate - words. Prefix constant names with the name of the class/package - they are used in. For example, the constants used by the - <literal>DB::</literal> package all begin with - "<literal>DB_</literal>". + 宿°ã¯å¸¸ã«å¤§æåã¨ããåèªãåºåãããã«ã¯ãã¢ã³ãã¼ã¹ã³ã¢ã使ç¨ã + ã¦ä¸ãããå«ã¾ãã¦ããã¯ã©ã¹/ããã±ã¼ã¸ã®ååã宿°ã®æ¥é è¾ã¨ã㦠+ ä»ãã¦ä¸ãããä¾ãã°ã<literal>DB::</literal>ããã±ã¼ã¸ã§ä½¿ç¨ãã + ã宿°ã¯å ¨ã¦"<literal>DB_</literal>"ã§å§ã¾ãã¾ãã </para> </sect1>