cvs: peardoc /ja/package/fileformats/file-marc formatting.xml /ja/package/http/http-upload examples.xml

From: Date: Wed, 21 Mar 2007 11:37:28 +0000
Subject: cvs: peardoc /ja/package/fileformats/file-marc formatting.xml /ja/package/http/http-upload examples.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9528@lists.php.net to get a copy of this message
takagi Wed Mar 21 11:37:28 2007 UTC Modified files: /peardoc/ja/package/http/http-upload examples.xml /peardoc/ja/package/fileformats/file-marc formatting.xml Log: sync with en.

http://cvs.php.net/viewvc.cgi/peardoc/ja/package/http/http-upload/examples.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/ja/package/http/http-upload/examples.xml diff -u peardoc/ja/package/http/http-upload/examples.xml:1.1 peardoc/ja/package/http/http-upload/examples.xml:1.2 --- peardoc/ja/package/http/http-upload/examples.xml:1.1 Sat Dec 31 03:56:04 2005 +++ peardoc/ja/package/http/http-upload/examples.xml Wed Mar 21 11:37:28 2007 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: takagi Status: ready --> <sect2 id="package.http.http-upload.examples"> <title>例</title> @@ -8,10 +8,35 @@ 以下の例では、ファイルをアップロードするために <acronym>HTML</acronym> フォームフィールド <literal>&lt;input type="file" name="f" /&gt;</literal> - を用いることを想定しています。 + を用いることを想定しています。たとえばこのようなフォームです。 </para> <example> + <title>単純なファイルアップロード用の HTML フォーム</title> + <para> + 単一ファイルのアップロードのサンプルを試してみるには、このようなフォームを使用します。 + </para> + <programlisting role="html"> +<![CDATA[ +<?php +// 以下のサンプルコードを、ここに書きます +?> +<html> + <head> + </head> + <body> + <form name="fileuploadexample" method="POST" enctype="multipart/form-data" + action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>"> + <input type="file" name="f" /> + <input type="submit" name="submit" value="Submit" /> + </form> + </body> +</html> +]]> + </programlisting> + </example> + + <example> <title>単純なファイルのアップロード</title> <para> @@ -21,6 +46,7 @@ </para> <programlisting role="php"> +<![CDATA[ require_once "HTTP/Upload.php"; $upload = new HTTP_Upload("en"); @@ -30,11 +56,45 @@ $moved = $file->moveTo("uploads/"); if (!PEAR::isError($moved)) { echo "ファイルが uploads/ に移動されました。"; + } else { + echo $moved->getMessage(); } +} elseif ($file->isMissing()) { + echo "ファイルがありません。"; +} elseif ($file->isError()) { + echo $file->errorMsg(); } +]]> </programlisting> </example> + + <example> + <title>複数のファイルをアップロードするための HTML フォーム</title> + <para> + 複数ファイルのアップロードのサンプルを試してみるには、このようなフォームを使用します。 + </para> + <programlisting role="html"> +<![CDATA[ +<?php +// 以下のサンプルコードを、ここに書きます +?> +<html> + <head> + </head> + <body> + <form name="fileuploadexample2" method="POST" enctype="multipart/form-data" + action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>"> + <input type="file" name="f1" /> + <input type="file" name="f2" /> + <input type="submit" name="submit" value="Submit" /> + </form> + </body> +</html> +]]> + </programlisting> + </example> + <example id="package.http.http-upload.examples.multiple"> <title>複数のファイル、より進んだチェック</title> @@ -46,6 +106,7 @@ </para> <programlisting role="php"> +<![CDATA[ $upload = new HTTP_Upload("en"); $files = $upload->getFiles(); @@ -72,6 +133,7 @@ print_r($file->getProp()); } +]]> </programlisting> </example> </sect2> http://cvs.php.net/viewvc.cgi/peardoc/ja/package/fileformats/file-marc/formatting.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/ja/package/fileformats/file-marc/formatting.xml diff -u peardoc/ja/package/fileformats/file-marc/formatting.xml:1.1 peardoc/ja/package/fileformats/file-marc/formatting.xml:1.2 --- peardoc/ja/package/fileformats/file-marc/formatting.xml:1.1 Sat Feb 24 01:36:03 2007 +++ peardoc/ja/package/fileformats/file-marc/formatting.xml Wed Mar 21 11:37:28 2007 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.2 Maintainer: takagi Status: ready --> <refentry id="package.fileformats.file-marc.formatting"> <refnamediv> <refname>MARC データのフォーマット</refname> @@ -25,7 +25,7 @@ <para> レコードを MARC 21 形式で返すには、 <classname>File_MARC_Record</classname> オブジェクトの - <function>toRaw()</function> メソッドをコールします。 + <function>toRaw</function> メソッドをコールします。 </para> <example> @@ -37,7 +37,7 @@ このデータを MARC 21 形式でファイルに書き込むには、 まずファイルをバイナリモードでオープンします。 そして配列内のレコードの内容をファイルに書き込むために - <function>toRaw()</function> メソッドをコールします。 + <function>toRaw</function> メソッドをコールします。 これをレコードごとに繰り返します。 </para> @@ -69,17 +69,17 @@ <para> 可読形式で MARC 21 あるいは MARCXML レコードを返すには、 <classname>File_MARC_Record</classname> オブジェクトの - <function>__toString()</function> メソッドをコールします。 + <function>__toString</function> メソッドをコールします。 <classname>File_MARC_Record</classname> オブジェクトの - <function>print()</function> 関数をコールした際には、暗黙的に - <function>__toString()</function> メソッドをコールしていることに注意しましょう。 + <function>print</function> 関数をコールした際には、暗黙的に + <function>__toString</function> メソッドをコールしていることに注意しましょう。 </para> <example> <title>MARC の可読形式を返す</title> <para> この例では、各 MARC レコードの内容を可読形式で表示します。 - また、明示的に <function>__toString()</function> メソッドをコールし、 + また、明示的に <function>__toString</function> メソッドをコールし、 可読形式でファイルに書き込みます。入力形式が MARC あるいは MARCXML のどちらであっても、出力用にデータを整形するメソッドは同じであることに注意しましょう。 </para> @@ -115,11 +115,11 @@ <para> レコードを MARCXML 形式で返すには、 <classname>File_MARC_Record</classname> オブジェクトの - <function>toXML()</function> メソッドをコールします。 + <function>toXML</function> メソッドをコールします。 </para> <warning> - <title><function>toXML()</function> メソッドの重要な制約</title> + <title><function>toXML</function> メソッドの重要な制約</title> <itemizedlist> <listitem> <para> @@ -139,11 +139,11 @@ </listitem> <listitem> <para> - <function>toXML()</function> メソッドは、現在は + <function>toXML</function> メソッドは、現在は ひとつの <classname>File_MARC_Record</classname> オブジェクトに対して ひとつの妥当な XML MARCXML ドキュメントを作成します。 ふたつの <classname>File_MARC_Record</classname> オブジェクトで - <function>toXML()</function> をコールした結果を単純に連結することはできません。 + <function>toXML</function> をコールした結果を単純に連結することはできません。 そうすると、出来上がった XML ドキュメントが妥当な形式ではなくなるからです。 複数のレコードを含む MARCXML ドキュメントを作成したい場合、 現状では開発者自身でそれを行う必要があります。つまり、各 MARCXML @@ -163,7 +163,7 @@ このデータを MARCXML 形式でファイルに書き込むには、 まずファイルをバイナリモードでオープンします。 そして配列内のレコードの内容をファイルに書き込むために - <function>toXML()</function> メソッドをコールします。 + <function>toXML</function> メソッドをコールします。 </para> <programlisting role="php"><![CDATA[
« previous php.pear.doc (#9528) next »