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: 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);
« previous php.doc.ja (#1575) next »