cvs: phpdoc-ja /reference/array/functions array-filter.xml /reference/filesystem/functions file-put-contents.xml /reference/ftp/functions
ftp-exec.xml /reference/imap/functions imap-reopen.xml /reference/misc/functions exit.xml /reference/pcre/functions preg-replace-callback.xml
preg-replace.xml /reference/pdo configure.xml
| From: | TAKAGI Masahiro | Date: | Fri, 23 Jun 2006 21:02:13 +0000 |
| Subject: | cvs: phpdoc-ja /reference/array/functions array-filter.xml /reference/filesystem/functions file-put-contents.xml /reference/ftp/functions ftp-exec.xml /reference/imap/functions imap-reopen.xml /reference/misc/functions exit.xml /reference/pcre/functions preg-replace-callback.xml preg-replace.xml /reference/pdo configure.xml |
||
| Groups: | php.doc.ja | ||
| Request: | Send a blank email to doc-ja+get-1575@lists.php.net to get a copy of this message | ||
takagi Fri Jun 23 21:02:13 2006 UTC
Modified files:
/phpdoc-ja/reference/pdo configure.xml
/phpdoc-ja/reference/pcre/functions preg-replace.xml
preg-replace-callback.xml
/phpdoc-ja/reference/misc/functions exit.xml
/phpdoc-ja/reference/imap/functions imap-reopen.xml
/phpdoc-ja/reference/ftp/functions ftp-exec.xml
/phpdoc-ja/reference/filesystem/functions file-put-contents.xml
/phpdoc-ja/reference/array/functions array-filter.xml
Log:
sync with en.
http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/pdo/configure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc-ja/reference/pdo/configure.xml diff -u phpdoc-ja/reference/pdo/configure.xml:1.1 phpdoc-ja/reference/pdo/configure.xml:1.2 --- phpdoc-ja/reference/pdo/configure.xml:1.1 Thu Apr 27 03:50:17 2006 +++ phpdoc-ja/reference/pdo/configure.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='utf-8'?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.2 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: takagi Status: ready --> <section id="pdo.installation"> &reftitle.install; <procedure id='pdo.install.unix51up'> @@ -14,7 +14,7 @@ PDO ã¯ãå ±æã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ããããã¨ãæ¨å¥¨ãã¾ãã ãªããªããPECL ããã¢ãããã¼ãçãå°å ¥ããéã«ãã®ã»ããæå©ã ããã§ãã PHP ã PDO ãµãã¼ãè¾¼ã¿ã§ãã«ãããéã®æ¨å¥¨è¨å®ã¯ã - zlib ãµãã¼ããæå¹ã«ãã (pear ã¤ã³ã¹ãã¼ã©ã使ç¨ãããã) ãã¨ã§ãã + zlib ãµãã¼ããæå¹ã«ãã (pecl ã¤ã³ã¹ãã¼ã©ã使ç¨ãããã) ãã¨ã§ãã ã¾ããããªãã鏿ãããã¼ã¿ãã¼ã¹ã«ã¤ãã¦ã® PDO ãã©ã¤ããæå¹ã«ããå¿ è¦ãããã¾ãã 詳細ã«ã¤ãã¦ã¯<link linkend="pdo.drivers">ãã¼ã¿ãã¼ã¹åºæã® PDO ãã©ã¤ã</link> ãåç §ãã ãããPDO ãå ±æã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ãããå ´åã¯ã @@ -49,7 +49,7 @@ <step> <para> PDO ãå ±æã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ãããã¨ãæ°ãããã¼ã¸ã§ã³ã® PDO - ãå ¬éãããéã« <command>pear upgrade pdo</command> + ãå ¬éãããéã« <command>pecl upgrade pdo</command> ã³ãã³ãã§æ´æ°ãããã¨ãã§ããããã«ãªãã¾ãã ãã®éã« PHP èªä½ãåãã«ãããå¿ è¦ã¯ããã¾ãããæ³¨æãã¹ãç¹ã¨ãã¦ã PDO ããã®æ¹æ³ã§æ´æ°ããéã¯ãã¼ã¿ãã¼ã¹åºæã®ãã©ã¤ããåæã«æ´æ°ããããã«ãã¦ãã ããã @@ -63,9 +63,9 @@ PDO ã¯ã <ulink url='&url.pecl.package;pdo'>&url.pecl.package;pdo</ulink> ãã PECL æ¡å¼µã¢ã¸ã¥ã¼ã«ã¨ãã¦ä½¿ç¨å¯è½ã§ãã - <command>pear</command> ãã¼ã«ã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã + <command>pecl</command> ãã¼ã«ã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã ãã®ãã¼ã«ã¯ãPHP ã® configure æã«èªåçã«ä½¿ç¨å¯è½ã«ãªãã¾ãã - <command>pear</command> ãå§ç¸®ãããããã±ã¼ã¸ãåãæ±ããããã + <command>pecl</command> ãå§ç¸®ãããããã±ã¼ã¸ãåãæ±ããããã PHP ã --with-zlib ãå«ã㦠confiure ããã¦ãããã¨ã 確èªãã¦ããã¾ãããã </para> @@ -76,14 +76,14 @@ ããã¦ã³ãã¼ããã¦ãã«ããè¡ããããã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã <screen> <![CDATA[ -pear install pdo +pecl install pdo ]]> </screen> </para> </step> <step> <para> - <command>pear</command> ã³ãã³ãã¯ãPDO ã¢ã¸ã¥ã¼ã«ãèªåçã« + <command>pecl</command> ã³ãã³ãã¯ãPDO ã¢ã¸ã¥ã¼ã«ãèªåçã« PHP ã®ã¨ã¯ã¹ãã³ã·ã§ã³ãã£ã¬ã¯ããªã«ã¤ã³ã¹ãã¼ã«ãã¾ãã Linux ã Unix ä¸ã§ PDO ãæå¹ã«ããã«ã¯ã以ä¸ã®è¡ã &php.ini; ã«è¿½å ããå¿ è¦ãããã¾ãã http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/pcre/functions/preg-replace.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-ja/reference/pcre/functions/preg-replace.xml diff -u phpdoc-ja/reference/pcre/functions/preg-replace.xml:1.8 phpdoc-ja/reference/pcre/functions/preg-replace.xml:1.9 --- phpdoc-ja/reference/pcre/functions/preg-replace.xml:1.8 Sun Aug 28 15:00:41 2005 +++ phpdoc-ja/reference/pcre/functions/preg-replace.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.16 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.17 Maintainer: hirokawa Status: ready --> <!-- Credits: haruki --> <refentry id="function.preg-replace"> <refnamediv> @@ -174,50 +174,6 @@ &reftitle.examples; <para> <example> - <title>HTML ãããã¹ãã«å¤æ</title> - <programlisting role="php"> -<![CDATA[ -<?php -// $document ã¯ãHTML æç« ã§ããã -// ãã®ã® HTML ã¿ã°ããã³ javascript ã®é¨åã¨ç©ºç½æåã -// åé¤ãããããã«ãHTML ã¨ã³ãã£ãã£ãç価ãªããã¹ãã« -// 夿ããã -$search = array ('@<script[^>]*?>.*?</script>@si', // javascript ãåé¤ - '@<[\/\!]*?[^<>]*?>@si', // html ã¿ã°ãåé¤ - '@([\r\n])[\s]+@', // ç©ºç½æåãåé¤ - '@&(quot|#34);@i', // HTML ã¨ã³ãã£ãã£ãç½® - '@&(amp|#38);@i', - '@&(lt|#60);@i', - '@&(gt|#62);@i', - '@&(nbsp|#160);@i', - '@&(iexcl|#161);@i', - '@&(cent|#162);@i', - '@&(pound|#163);@i', - '@&(copy|#169);@i', - '@&#(\d+);@e'); // php ã¨ãã¦è©ä¾¡ - -$replace = array ('', - '', - '\1', - '"', - '&', - '<', - '>', - ' ', - chr(161), - chr(162), - chr(163), - chr(169), - 'chr(\1)'); - -$text = preg_replace($search, $replace, $document); -?> -]]> - </programlisting> - </example> - </para> - <para> - <example> <title>æ°åãªãã©ã«ãå¾ã«ç¶ã徿¹åç §</title> <programlisting role="php"> <![CDATA[ http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml diff -u phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml:1.7 phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml:1.8 --- phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml:1.7 Thu Apr 6 21:06:16 2006 +++ phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.8 $ --> <!-- splitted from ./ja/functions/pcre.xml, last change in rev 1.20 --> -<!-- EN-Revision: 1.12 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: hirokawa Status: ready --> <!-- Credits: haruki --> <refentry id="function.preg-replace-callback"> <refnamediv> @@ -33,16 +34,16 @@ <programlisting role='php'> <![CDATA[ <?php - // this text was used in 2002 - // we want to get this up to date for 2003 - $text = "April fools day is 04/01/2002\n"; - $text.= "Last christmas was 12/24/2001\n"; + // ãã®ããã¹ã㯠2002 ã«ä½¿ããã¦ãããã®ãªã®ã§ããã + // ããã 2003 年対å¿ã®æ¥ä»ã«å¤æ´ãããã®ã§ã + $text = "ã¨ã¤ããªã«ãã¼ã«ã®æ¥ä»ã¯ 04/01/2002 ã§ã\n"; + $text.= "ãã®åã®ã¯ãªã¹ãã¹ã®æ¥ä»ã¯ 12/24/2001 ã§ãã\n"; - // the callback function + // ã³ã¼ã«ããã¯é¢æ° function next_year($matches) { - // as usual: $matches[0] is the complete match - // $matches[1] the match for the first subpattern - // enclosed in '(...)' and so on + // é常ã¯ã$matches[0] ããããããå ¨ä½ã表ãã¾ãã + // $matches[1] ã¯ããããããä¸ã§ããã¿ã¼ã³å ã®æåã® '(...)' + // ã«ãã¦ã¯ã¾ãé¨åã表ãã¾ãããã以éãåæ§ã§ãã return $matches[1].($matches[2]+1); } @@ -51,9 +52,9 @@ "next_year", $text); - // result is: - // April fools day is 04/01/2003 - // Last christmas was 12/24/2002 + // çµæã¯ãããªãã¾ãã + // ã¨ã¤ããªã«ãã¼ã«ã®æ¥ä»ã¯ 04/01/2003 ã§ã + // ãã®åã®ã¯ãªã¹ãã¹ã®æ¥ä»ã¯ 12/24/2002 ã§ãã ?> ]]> </programlisting> @@ -77,16 +78,16 @@ <programlisting role='php'> <![CDATA[ <?php -/* a unix-style command line filter to convert uppercase - * letters at the beginning of paragraphs to lowercase */ -$fp = fopen("php://stdin", "r") or die("can't read stdin"); +/* Unix æ¹å¼ã®ã³ãã³ãã©ã¤ã³ãã£ã«ã¿ã§ãã + * 段è½ã®åé ã®å¤§æåããå°æåã«å¤æãã¾ãã*/ +$fp = fopen("php://stdin", "r") or die("æ¨æºå ¥åããèªã¿è¾¼ãã¾ãã"); while (!feof($fp)) { $line = fgets($fp); $line = preg_replace_callback( '|<p>\s*\w|', create_function( - // single quotes are essential here, - // or alternative escape all $ as \$ + // ããã§ã¯åä¸å¼ç¨ç¬¦ã®ä½¿ç¨ãä¸å¯æ¬ ã§ãã + // ããã§ãªãå ´åã¯ã$ ããã¹ã¦ \$ ã¨ã¨ã¹ã±ã¼ããã¾ãã '$matches', 'return strtolower($matches[0]);' ), @@ -99,6 +100,35 @@ ]]> </programlisting> </example> + <example> + <title> + ã«ãã»ã«åããã BB code ãå¦çããããã®ã + <function>preg_replace_callback</function> ã§ã®å帰æ§é ã®ä½¿ç¨ + </title> + <programlisting role='php'> +<![CDATA[ +<?php +$input = "é常ã®ä½ç½® [indent] åä¸ã [indent] ãã£ã¨åä¸ã [/indent] åä¸ã [/indent] é常ã®ä½ç½®"; + +function parseTagsRecursive($input) +{ + + $regex = '#\[indent]((?:[^[]|\[(?!/?indent])|(?R))+)\[/indent]#'; + + if (is_array($input)) { + $input = '<div style="margin-left: 10px">'.$input[1].'</div>'; + } + + return preg_replace_callback($regex, 'parseTagsRecursive', $input); +} + +$output = parseTagsRecursive($input); + +echo $output; +?> +]]> + </programlisting> + </example> <note> <para> <parameter>count</parameter> 弿°ã¯ PHP 5.1.0 以éã§ä½¿ç¨å¯è½ã§ãã http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/misc/functions/exit.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-ja/reference/misc/functions/exit.xml diff -u phpdoc-ja/reference/misc/functions/exit.xml:1.5 phpdoc-ja/reference/misc/functions/exit.xml:1.6 --- phpdoc-ja/reference/misc/functions/exit.xml:1.5 Sat Aug 13 07:06:04 2005 +++ phpdoc-ja/reference/misc/functions/exit.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.10 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.11 Maintainer: hirokawa Status: ready --> <!-- CREDITS: takagi --> <refentry id="function.exit"> <refnamediv> @@ -74,8 +74,7 @@ </para> <note> <simpara> - 颿° <function>die</function> ã¯ã<function>exit</function> ã® - ã¨ã¤ãªã¢ã¹ã§ãã + ãã®è¨èªæ§é ã¯ã<function>die</function> ã¨ç価ã§ãã </simpara> </note> <para> http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/imap/functions/imap-reopen.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-ja/reference/imap/functions/imap-reopen.xml diff -u phpdoc-ja/reference/imap/functions/imap-reopen.xml:1.6 phpdoc-ja/reference/imap/functions/imap-reopen.xml:1.7 --- phpdoc-ja/reference/imap/functions/imap-reopen.xml:1.6 Tue Jan 24 03:12:07 2006 +++ phpdoc-ja/reference/imap/functions/imap-reopen.xml Fri Jun 23 21:02:13 2006 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./ja/functions/imap.xml, last change in rev 1.14 --> -<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: hirokawa Status: ready --> <refentry id="function.imap-reopen"> <refnamediv> <refname>imap_reopen</refname> @@ -56,9 +56,9 @@ <programlisting role="php"> <![CDATA[ <?php -$mbox = imap_open("{imap.example.org:143}INBOX", "username", "password") or die(join(", ", imap_errors())); +$mbox = imap_open("{imap.example.org:143}INBOX", "username", "password") or die(implode(", ", imap_errors())); // ... -imap_reopen($mbox, "{imap.example.org:143}INBOX.Sent") or die(join(", ", imap_errors())); +imap_reopen($mbox, "{imap.example.org:143}INBOX.Sent") or die(implode(", ", imap_errors())); // .. ?> ]]> http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/ftp/functions/ftp-exec.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-ja/reference/ftp/functions/ftp-exec.xml diff -u phpdoc-ja/reference/ftp/functions/ftp-exec.xml:1.5 phpdoc-ja/reference/ftp/functions/ftp-exec.xml:1.6 --- phpdoc-ja/reference/ftp/functions/ftp-exec.xml:1.5 Tue Apr 18 03:38:47 2006 +++ phpdoc-ja/reference/ftp/functions/ftp-exec.xml Fri Jun 23 21:02:13 2006 @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.13 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.14 Maintainer: hirokawa Status: ready --> <!-- CREDITS: takagi --> <refentry id='function.ftp-exec'> <refnamediv> <refname>ftp_exec</refname> - <refpurpose>FTP ãµã¼ãä¸ã§ã®ããã°ã©ã ã®å®è¡ããªã¯ã¨ã¹ããã</refpurpose> + <refpurpose>FTP ãµã¼ãä¸ã§ã®ã³ãã³ãã®å®è¡ããªã¯ã¨ã¹ããã</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/filesystem/functions/file-put-contents.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-ja/reference/filesystem/functions/file-put-contents.xml diff -u phpdoc-ja/reference/filesystem/functions/file-put-contents.xml:1.4 phpdoc-ja/reference/filesystem/functions/file-put-contents.xml:1.5 --- phpdoc-ja/reference/filesystem/functions/file-put-contents.xml:1.4 Fri Jul 22 18:03:53 2005 +++ phpdoc-ja/reference/filesystem/functions/file-put-contents.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.7 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.9 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka --> <refentry id="function.file-put-contents"> <refnamediv> @@ -23,7 +23,7 @@ <para> <parameter>data</parameter> ãã©ã¡ã¼ã¿ã«é åãæå®ãããã¨ãå¯è½ã§ã (夿¬¡å é åã¯ä¸å¯) ããã®é¢æ°ã¯ - <literal>file_put_contents($filename, join('', $array))</literal> + <literal>file_put_contents($filename, implode('', $array))</literal>. ã¨åçã§ãã </para> <para> http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/array/functions/array-filter.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-ja/reference/array/functions/array-filter.xml diff -u phpdoc-ja/reference/array/functions/array-filter.xml:1.6 phpdoc-ja/reference/array/functions/array-filter.xml:1.7 --- phpdoc-ja/reference/array/functions/array-filter.xml:1.6 Tue May 3 08:48:56 2005 +++ phpdoc-ja/reference/array/functions/array-filter.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.16 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.17 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka --> <refentry id="function.array-filter"> <refnamediv> @@ -33,12 +33,12 @@ <?php function odd($var) { - return($var % 2 == 1); + return($var & 1); } function even($var) { - return($var % 2 == 0); + return(!($var & 1)); } $array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/pdo/configure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc-ja/reference/pdo/configure.xml diff -u phpdoc-ja/reference/pdo/configure.xml:1.1 phpdoc-ja/reference/pdo/configure.xml:1.2 --- phpdoc-ja/reference/pdo/configure.xml:1.1 Thu Apr 27 03:50:17 2006 +++ phpdoc-ja/reference/pdo/configure.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='utf-8'?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.2 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: takagi Status: ready --> <section id="pdo.installation"> &reftitle.install; <procedure id='pdo.install.unix51up'> @@ -14,7 +14,7 @@ PDO ã¯ãå ±æã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ããããã¨ãæ¨å¥¨ãã¾ãã ãªããªããPECL ããã¢ãããã¼ãçãå°å ¥ããéã«ãã®ã»ããæå©ã ããã§ãã PHP ã PDO ãµãã¼ãè¾¼ã¿ã§ãã«ãããéã®æ¨å¥¨è¨å®ã¯ã - zlib ãµãã¼ããæå¹ã«ãã (pear ã¤ã³ã¹ãã¼ã©ã使ç¨ãããã) ãã¨ã§ãã + zlib ãµãã¼ããæå¹ã«ãã (pecl ã¤ã³ã¹ãã¼ã©ã使ç¨ãããã) ãã¨ã§ãã ã¾ããããªãã鏿ãããã¼ã¿ãã¼ã¹ã«ã¤ãã¦ã® PDO ãã©ã¤ããæå¹ã«ããå¿ è¦ãããã¾ãã 詳細ã«ã¤ãã¦ã¯<link linkend="pdo.drivers">ãã¼ã¿ãã¼ã¹åºæã® PDO ãã©ã¤ã</link> ãåç §ãã ãããPDO ãå ±æã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ãããå ´åã¯ã @@ -49,7 +49,7 @@ <step> <para> PDO ãå ±æã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã«ãããã¨ãæ°ãããã¼ã¸ã§ã³ã® PDO - ãå ¬éãããéã« <command>pear upgrade pdo</command> + ãå ¬éãããéã« <command>pecl upgrade pdo</command> ã³ãã³ãã§æ´æ°ãããã¨ãã§ããããã«ãªãã¾ãã ãã®éã« PHP èªä½ãåãã«ãããå¿ è¦ã¯ããã¾ãããæ³¨æãã¹ãç¹ã¨ãã¦ã PDO ããã®æ¹æ³ã§æ´æ°ããéã¯ãã¼ã¿ãã¼ã¹åºæã®ãã©ã¤ããåæã«æ´æ°ããããã«ãã¦ãã ããã @@ -63,9 +63,9 @@ PDO ã¯ã <ulink url='&url.pecl.package;pdo'>&url.pecl.package;pdo</ulink> ãã PECL æ¡å¼µã¢ã¸ã¥ã¼ã«ã¨ãã¦ä½¿ç¨å¯è½ã§ãã - <command>pear</command> ãã¼ã«ã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã + <command>pecl</command> ãã¼ã«ã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã ãã®ãã¼ã«ã¯ãPHP ã® configure æã«èªåçã«ä½¿ç¨å¯è½ã«ãªãã¾ãã - <command>pear</command> ãå§ç¸®ãããããã±ã¼ã¸ãåãæ±ããããã + <command>pecl</command> ãå§ç¸®ãããããã±ã¼ã¸ãåãæ±ããããã PHP ã --with-zlib ãå«ã㦠confiure ããã¦ãããã¨ã 確èªãã¦ããã¾ãããã </para> @@ -76,14 +76,14 @@ ããã¦ã³ãã¼ããã¦ãã«ããè¡ããããã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã <screen> <![CDATA[ -pear install pdo +pecl install pdo ]]> </screen> </para> </step> <step> <para> - <command>pear</command> ã³ãã³ãã¯ãPDO ã¢ã¸ã¥ã¼ã«ãèªåçã« + <command>pecl</command> ã³ãã³ãã¯ãPDO ã¢ã¸ã¥ã¼ã«ãèªåçã« PHP ã®ã¨ã¯ã¹ãã³ã·ã§ã³ãã£ã¬ã¯ããªã«ã¤ã³ã¹ãã¼ã«ãã¾ãã Linux ã Unix ä¸ã§ PDO ãæå¹ã«ããã«ã¯ã以ä¸ã®è¡ã &php.ini; ã«è¿½å ããå¿ è¦ãããã¾ãã http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/pcre/functions/preg-replace.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-ja/reference/pcre/functions/preg-replace.xml diff -u phpdoc-ja/reference/pcre/functions/preg-replace.xml:1.8 phpdoc-ja/reference/pcre/functions/preg-replace.xml:1.9 --- phpdoc-ja/reference/pcre/functions/preg-replace.xml:1.8 Sun Aug 28 15:00:41 2005 +++ phpdoc-ja/reference/pcre/functions/preg-replace.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.16 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.17 Maintainer: hirokawa Status: ready --> <!-- Credits: haruki --> <refentry id="function.preg-replace"> <refnamediv> @@ -174,50 +174,6 @@ &reftitle.examples; <para> <example> - <title>HTML ãããã¹ãã«å¤æ</title> - <programlisting role="php"> -<![CDATA[ -<?php -// $document ã¯ãHTML æç« ã§ããã -// ãã®ã® HTML ã¿ã°ããã³ javascript ã®é¨åã¨ç©ºç½æåã -// åé¤ãããããã«ãHTML ã¨ã³ãã£ãã£ãç価ãªããã¹ãã« -// 夿ããã -$search = array ('@<script[^>]*?>.*?</script>@si', // javascript ãåé¤ - '@<[\/\!]*?[^<>]*?>@si', // html ã¿ã°ãåé¤ - '@([\r\n])[\s]+@', // ç©ºç½æåãåé¤ - '@&(quot|#34);@i', // HTML ã¨ã³ãã£ãã£ãç½® - '@&(amp|#38);@i', - '@&(lt|#60);@i', - '@&(gt|#62);@i', - '@&(nbsp|#160);@i', - '@&(iexcl|#161);@i', - '@&(cent|#162);@i', - '@&(pound|#163);@i', - '@&(copy|#169);@i', - '@&#(\d+);@e'); // php ã¨ãã¦è©ä¾¡ - -$replace = array ('', - '', - '\1', - '"', - '&', - '<', - '>', - ' ', - chr(161), - chr(162), - chr(163), - chr(169), - 'chr(\1)'); - -$text = preg_replace($search, $replace, $document); -?> -]]> - </programlisting> - </example> - </para> - <para> - <example> <title>æ°åãªãã©ã«ãå¾ã«ç¶ã徿¹åç §</title> <programlisting role="php"> <![CDATA[ http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml diff -u phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml:1.7 phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml:1.8 --- phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml:1.7 Thu Apr 6 21:06:16 2006 +++ phpdoc-ja/reference/pcre/functions/preg-replace-callback.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.8 $ --> <!-- splitted from ./ja/functions/pcre.xml, last change in rev 1.20 --> -<!-- EN-Revision: 1.12 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: hirokawa Status: ready --> <!-- Credits: haruki --> <refentry id="function.preg-replace-callback"> <refnamediv> @@ -33,16 +34,16 @@ <programlisting role='php'> <![CDATA[ <?php - // this text was used in 2002 - // we want to get this up to date for 2003 - $text = "April fools day is 04/01/2002\n"; - $text.= "Last christmas was 12/24/2001\n"; + // ãã®ããã¹ã㯠2002 ã«ä½¿ããã¦ãããã®ãªã®ã§ããã + // ããã 2003 年対å¿ã®æ¥ä»ã«å¤æ´ãããã®ã§ã + $text = "ã¨ã¤ããªã«ãã¼ã«ã®æ¥ä»ã¯ 04/01/2002 ã§ã\n"; + $text.= "ãã®åã®ã¯ãªã¹ãã¹ã®æ¥ä»ã¯ 12/24/2001 ã§ãã\n"; - // the callback function + // ã³ã¼ã«ããã¯é¢æ° function next_year($matches) { - // as usual: $matches[0] is the complete match - // $matches[1] the match for the first subpattern - // enclosed in '(...)' and so on + // é常ã¯ã$matches[0] ããããããå ¨ä½ã表ãã¾ãã + // $matches[1] ã¯ããããããä¸ã§ããã¿ã¼ã³å ã®æåã® '(...)' + // ã«ãã¦ã¯ã¾ãé¨åã表ãã¾ãããã以éãåæ§ã§ãã return $matches[1].($matches[2]+1); } @@ -51,9 +52,9 @@ "next_year", $text); - // result is: - // April fools day is 04/01/2003 - // Last christmas was 12/24/2002 + // çµæã¯ãããªãã¾ãã + // ã¨ã¤ããªã«ãã¼ã«ã®æ¥ä»ã¯ 04/01/2003 ã§ã + // ãã®åã®ã¯ãªã¹ãã¹ã®æ¥ä»ã¯ 12/24/2002 ã§ãã ?> ]]> </programlisting> @@ -77,16 +78,16 @@ <programlisting role='php'> <![CDATA[ <?php -/* a unix-style command line filter to convert uppercase - * letters at the beginning of paragraphs to lowercase */ -$fp = fopen("php://stdin", "r") or die("can't read stdin"); +/* Unix æ¹å¼ã®ã³ãã³ãã©ã¤ã³ãã£ã«ã¿ã§ãã + * 段è½ã®åé ã®å¤§æåããå°æåã«å¤æãã¾ãã*/ +$fp = fopen("php://stdin", "r") or die("æ¨æºå ¥åããèªã¿è¾¼ãã¾ãã"); while (!feof($fp)) { $line = fgets($fp); $line = preg_replace_callback( '|<p>\s*\w|', create_function( - // single quotes are essential here, - // or alternative escape all $ as \$ + // ããã§ã¯åä¸å¼ç¨ç¬¦ã®ä½¿ç¨ãä¸å¯æ¬ ã§ãã + // ããã§ãªãå ´åã¯ã$ ããã¹ã¦ \$ ã¨ã¨ã¹ã±ã¼ããã¾ãã '$matches', 'return strtolower($matches[0]);' ), @@ -99,6 +100,35 @@ ]]> </programlisting> </example> + <example> + <title> + ã«ãã»ã«åããã BB code ãå¦çããããã®ã + <function>preg_replace_callback</function> ã§ã®å帰æ§é ã®ä½¿ç¨ + </title> + <programlisting role='php'> +<![CDATA[ +<?php +$input = "é常ã®ä½ç½® [indent] åä¸ã [indent] ãã£ã¨åä¸ã [/indent] åä¸ã [/indent] é常ã®ä½ç½®"; + +function parseTagsRecursive($input) +{ + + $regex = '#\[indent]((?:[^[]|\[(?!/?indent])|(?R))+)\[/indent]#'; + + if (is_array($input)) { + $input = '<div style="margin-left: 10px">'.$input[1].'</div>'; + } + + return preg_replace_callback($regex, 'parseTagsRecursive', $input); +} + +$output = parseTagsRecursive($input); + +echo $output; +?> +]]> + </programlisting> + </example> <note> <para> <parameter>count</parameter> 弿°ã¯ PHP 5.1.0 以éã§ä½¿ç¨å¯è½ã§ãã http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/misc/functions/exit.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-ja/reference/misc/functions/exit.xml diff -u phpdoc-ja/reference/misc/functions/exit.xml:1.5 phpdoc-ja/reference/misc/functions/exit.xml:1.6 --- phpdoc-ja/reference/misc/functions/exit.xml:1.5 Sat Aug 13 07:06:04 2005 +++ phpdoc-ja/reference/misc/functions/exit.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.10 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.11 Maintainer: hirokawa Status: ready --> <!-- CREDITS: takagi --> <refentry id="function.exit"> <refnamediv> @@ -74,8 +74,7 @@ </para> <note> <simpara> - 颿° <function>die</function> ã¯ã<function>exit</function> ã® - ã¨ã¤ãªã¢ã¹ã§ãã + ãã®è¨èªæ§é ã¯ã<function>die</function> ã¨ç価ã§ãã </simpara> </note> <para> http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/imap/functions/imap-reopen.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-ja/reference/imap/functions/imap-reopen.xml diff -u phpdoc-ja/reference/imap/functions/imap-reopen.xml:1.6 phpdoc-ja/reference/imap/functions/imap-reopen.xml:1.7 --- phpdoc-ja/reference/imap/functions/imap-reopen.xml:1.6 Tue Jan 24 03:12:07 2006 +++ phpdoc-ja/reference/imap/functions/imap-reopen.xml Fri Jun 23 21:02:13 2006 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./ja/functions/imap.xml, last change in rev 1.14 --> -<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: hirokawa Status: ready --> <refentry id="function.imap-reopen"> <refnamediv> <refname>imap_reopen</refname> @@ -56,9 +56,9 @@ <programlisting role="php"> <![CDATA[ <?php -$mbox = imap_open("{imap.example.org:143}INBOX", "username", "password") or die(join(", ", imap_errors())); +$mbox = imap_open("{imap.example.org:143}INBOX", "username", "password") or die(implode(", ", imap_errors())); // ... -imap_reopen($mbox, "{imap.example.org:143}INBOX.Sent") or die(join(", ", imap_errors())); +imap_reopen($mbox, "{imap.example.org:143}INBOX.Sent") or die(implode(", ", imap_errors())); // .. ?> ]]> http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/ftp/functions/ftp-exec.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-ja/reference/ftp/functions/ftp-exec.xml diff -u phpdoc-ja/reference/ftp/functions/ftp-exec.xml:1.5 phpdoc-ja/reference/ftp/functions/ftp-exec.xml:1.6 --- phpdoc-ja/reference/ftp/functions/ftp-exec.xml:1.5 Tue Apr 18 03:38:47 2006 +++ phpdoc-ja/reference/ftp/functions/ftp-exec.xml Fri Jun 23 21:02:13 2006 @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.13 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.14 Maintainer: hirokawa Status: ready --> <!-- CREDITS: takagi --> <refentry id='function.ftp-exec'> <refnamediv> <refname>ftp_exec</refname> - <refpurpose>FTP ãµã¼ãä¸ã§ã®ããã°ã©ã ã®å®è¡ããªã¯ã¨ã¹ããã</refpurpose> + <refpurpose>FTP ãµã¼ãä¸ã§ã®ã³ãã³ãã®å®è¡ããªã¯ã¨ã¹ããã</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/filesystem/functions/file-put-contents.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-ja/reference/filesystem/functions/file-put-contents.xml diff -u phpdoc-ja/reference/filesystem/functions/file-put-contents.xml:1.4 phpdoc-ja/reference/filesystem/functions/file-put-contents.xml:1.5 --- phpdoc-ja/reference/filesystem/functions/file-put-contents.xml:1.4 Fri Jul 22 18:03:53 2005 +++ phpdoc-ja/reference/filesystem/functions/file-put-contents.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.7 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.9 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka --> <refentry id="function.file-put-contents"> <refnamediv> @@ -23,7 +23,7 @@ <para> <parameter>data</parameter> ãã©ã¡ã¼ã¿ã«é åãæå®ãããã¨ãå¯è½ã§ã (夿¬¡å é åã¯ä¸å¯) ããã®é¢æ°ã¯ - <literal>file_put_contents($filename, join('', $array))</literal> + <literal>file_put_contents($filename, implode('', $array))</literal>. ã¨åçã§ãã </para> <para> http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/array/functions/array-filter.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-ja/reference/array/functions/array-filter.xml diff -u phpdoc-ja/reference/array/functions/array-filter.xml:1.6 phpdoc-ja/reference/array/functions/array-filter.xml:1.7 --- phpdoc-ja/reference/array/functions/array-filter.xml:1.6 Tue May 3 08:48:56 2005 +++ phpdoc-ja/reference/array/functions/array-filter.xml Fri Jun 23 21:02:13 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.16 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.17 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka --> <refentry id="function.array-filter"> <refnamediv> @@ -33,12 +33,12 @@ <?php function odd($var) { - return($var % 2 == 1); + return($var & 1); } function even($var) { - return($var % 2 == 0); + return(!($var & 1)); } $array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);