Browse Source

sync 22769,22797,22821,23148

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23152 44c647ce-9c0f-0410-b52a-842ac1e357ba
yoshida@zend.co.jp 15 years ago
parent
commit
a3ceac0894

+ 78 - 1
documentation/manual/ja/module_specs/Zend_Cache-Backends.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 23014 -->
+<!-- EN-Revision: 23148 -->
 <sect1 id="zend.cache.backends">
     <title><classname>Zend_Cache</classname> のバックエンド</title>
     <para>
@@ -246,6 +246,83 @@
               </tgroup>
           </table>
     </sect2>
+
+    <sect2 id="zend.cache.backends.libmemcached">
+        <title>Zend_Cache_Backend_Libmemcached</title>
+
+        <para>
+            This (extended) backend stores cache records into a memcached server. <ulink
+                url="http://www.danga.com/memcached/">memcached</ulink> is a high-performance,
+            distributed memory object caching system. To use this backend, you need a memcached
+            daemon and <ulink url="http://pecl.php.net/package/memcached">the memcached
+                <acronym>PECL</acronym> extension</ulink>.
+        </para>
+
+        <para>
+            Be careful : with this backend, "tags" are not supported for the moment as
+            the "doNotTestCacheValidity=true" argument.
+        </para>
+
+        <para>
+            Available options are :
+        </para>
+
+        <table id="zend.cache.backends.libmemcached.table">
+            <title>Libmemcached Backend Options</title>
+
+            <tgroup cols="4">
+                <thead>
+                    <row>
+                        <entry>Option</entry>
+                        <entry>Data Type</entry>
+                        <entry>Default Value</entry>
+                        <entry>Description</entry>
+                    </row>
+                </thead>
+
+                <tbody>
+                    <row>
+                        <entry><emphasis>servers</emphasis></entry>
+                        <entry><type>Array</type></entry>
+
+                        <entry>
+                            <command>array(array('host' => 'localhost', 'port' => 11211,
+                            'weight' => 1))</command>
+                        </entry>
+
+                        <entry>
+                            An array of memcached servers ; each memcached server is described by
+                            an associative array:
+                            'host' => (string) : the name of the memcached server,
+                            'port' => (int) : the port of the memcached server,
+                            'weight' => (int) :the weight of the memcached server
+                        </entry>
+                    </row>
+                    <row>
+                        <entry><emphasis>client</emphasis></entry>
+                        <entry><type>Array</type></entry>
+
+                        <entry>
+                            <command>array(
+                                Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
+                                Memcached::OPT_HASH => Memcached::HASH_MD5,
+                                Memcached::OPT_LIBKETAMA_COMPATIBLE => true
+                            )</command>
+                        </entry>
+
+                        <entry>
+                            An associative array of memcached client options ;
+                            The array key can be the name of the memcached option constant
+                            (without 'OPT_') or the integer value of it.
+                            See <ulink url="http://php.net/manual/memcached.constants.php">
+                                Memcached constants on <acronym>PHP</acronym> manual</ulink>
+                        </entry>
+                    </row>
+                </tbody>
+            </tgroup>
+        </table>
+    </sect2>
+
     <sect2 id="zend.cache.backends.apc">
         <title>Zend_Cache_Backend_Apc</title>
         <para>

+ 66 - 31
documentation/manual/ja/module_specs/Zend_Filter-Callback.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 20774 -->
+<!-- EN-Revision: 22821 -->
 <sect2 id="zend.filter.set.callback">
     <title>Callback</title>
 
@@ -9,23 +9,51 @@
         機能を果たすメソッドすでにあるとき、新しいフィルタを生成する必要はありません。
     </para>
 
-    <para>
-        文字列を逆にするフィルタを生成したいとしましょう。
-    </para>
+    <sect3 id="zend.filter.set.callback.options">
+        <title>Supported options for Zend_Filter_Callback</title>
+
+        <para>
+            The following options are supported for <classname>Zend_Filter_Callback</classname>:
+        </para>
 
-    <programlisting language="php"><![CDATA[
+        <itemizedlist>
+            <listitem>
+                <para>
+                    <emphasis><property>callback</property></emphasis>: This sets the callback
+                    which should be used.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <emphasis><property>options</property></emphasis>: This property sets the
+                    options which are used when the callback is processed.
+                </para>
+            </listitem>
+        </itemizedlist>
+    </sect3>
+
+    <sect3 id="zend.filter.set.callback.basic">
+        <title>Basic usage</title>
+
+        <para>
+            The usage of this filter is quite simple.
+            文字列を逆にするフィルタを生成したいとしましょう。
+        </para>
+
+        <programlisting language="php"><![CDATA[
 $filter = new Zend_Filter_Callback('strrev');
 
 print $filter->filter('Hello!');
 // "!olleH"を返します
 ]]></programlisting>
 
-    <para>
-        おわかりのように、自分自身のフィルタを定義するために本当に簡単にコールバックを使えます。
-        メソッド(それはクラス内で定義されます)をコールバックとして配列を与えることによって使うこともできます。
-    </para>
+        <para>
+            おわかりのように、自分自身のフィルタを定義するために本当に簡単にコールバックを使えます。
+            メソッド(それはクラス内で定義されます)をコールバックとして配列を与えることによって使うこともできます。
+        </para>
 
-    <programlisting language="php"><![CDATA[
+        <programlisting language="php"><![CDATA[
 // クラスの定義
 class MyClass
 {
@@ -37,18 +65,31 @@ $filter = new Zend_Filter_Callback(array('MyClass', 'Reverse'));
 print $filter->filter('Hello!');
 ]]></programlisting>
 
-    <para>
-        実際に設定されているコールバックを取得するには <methodname>getCallback()</methodname> を使い、
-        他のコールバックを設定するには <methodname>setCallback()</methodname> を使います。
-    </para>
+        <para>
+            実際に設定されているコールバックを取得するには <methodname>getCallback()</methodname> を使い、
+            他のコールバックを設定するには <methodname>setCallback()</methodname> を使います。
+        </para>
 
-    <para>
-        フィルタが実行されるとき、
-        呼ばれるメソッドに配列として与えられるデフォルト・パラメータを定義できます。
-        この配列は、フィルターされた値で結合されます。
-    </para>
+        <note>
+            <title>起こりうる例外</title>
+
+            <para>
+                呼ばれることができないコールバック・メソッドを定義すると、
+                例外が発生する点に注意しなければなりません。
+            </para>
+        </note>
+    </sect3>
+
+    <sect3 id="zend.filter.set.callback.parameters">
+        <title>Default parameters within a callback</title>
+
+        <para>
+            フィルタが実行されるとき、
+            呼ばれるメソッドに配列として与えられるデフォルト・パラメータを定義できます。
+            この配列は、フィルターされた値で結合されます。
+        </para>
 
-    <programlisting language="php"><![CDATA[
+        <programlisting language="php"><![CDATA[
 $filter = new Zend_Filter_Callback(
     array(
         'callback' => 'MyMethod',
@@ -58,19 +99,13 @@ $filter = new Zend_Filter_Callback(
 $filter->filter(array('value' => 'Hello'));
 ]]></programlisting>
 
-    <para>
-        手動で上記のメソッド定義を呼ぶと、それはこのように見えます:
-    </para>
+        <para>
+            手動で上記のメソッド定義を呼ぶと、それはこのように見えます:
+        </para>
 
-    <programlisting language="php"><![CDATA[
+        <programlisting language="php"><![CDATA[
 $value = MyMethod('Hello', 'param1', 'param2');
 ]]></programlisting>
 
-    <note>
-        <para>
-            呼ばれることができないコールバック・メソッドを定義すると、
-            例外が発生する点に注意しなければなりません。
-        </para>
-    </note>
-
+    </sect3>
 </sect2>

+ 54 - 24
documentation/manual/ja/module_specs/Zend_Filter-StringToLower.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 17891 -->
+<!-- EN-Revision: 22821 -->
 <sect2 id="zend.filter.set.stringtolower">
     <title>StringToLower</title>
 
@@ -8,25 +8,54 @@
         Tこのフィルタは、入力を全て小文字に変換します。
     </para>
 
-    <programlisting language="php"><![CDATA[
+    <sect3 id="zend.filter.set.stringtolower.options">
+        <title>Supported options for Zend_Filter_StringToLower</title>
+
+        <para>
+            The following options are supported for
+            <classname>Zend_Filter_StringToLower</classname>:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    <emphasis><property>encoding</property></emphasis>: This option can be used to
+                    set an encoding which has to be used.
+                </para>
+            </listitem>
+        </itemizedlist>
+    </sect3>
+
+    <sect3 id="zend.filter.set.stringtolower.basic">
+        <title>Basic usage</title>
+
+        <para>
+            This is a basic example:
+        </para>
+
+        <programlisting language="php"><![CDATA[
 $filter = new Zend_Filter_StringToLower();
 
 print $filter->filter('SAMPLE');
 // "sample" を返します
 ]]></programlisting>
+    </sect3>
 
-    <para>
-        デフォルトでは、それはサーバの現時点のロケールで、文字を取り扱うだけです。
-        他のcharset由来の文字は、無視されます。
-        さらに、mbstring拡張が環境で利用できるとき、
-        それらを小文字にすることもできます。
-        <classname>StringToLower</classname>フィルタを初期化するときは、
-        希望のエンコーディングを設定するだけです。
-        または、後でエンコーディングを変更するために、
-        <methodname>setEncoding()</methodname>メソッドを使います。
-    </para>
+    <sect3 id="zend.filter.set.stringtolower.encoding">
+        <title>Different encoded strings</title>
+
+        <para>
+            デフォルトでは、それはサーバの現時点のロケールで、文字を取り扱うだけです。
+            他のcharset由来の文字は、無視されます。
+            さらに、mbstring拡張が環境で利用できるとき、
+            それらを小文字にすることもできます。
+            <classname>StringToLower</classname>フィルタを初期化するときは、
+            希望のエンコーディングを設定するだけです。
+            または、後でエンコーディングを変更するために、
+            <methodname>setEncoding()</methodname>メソッドを使います。
+        </para>
 
-    <programlisting language="php"><![CDATA[
+        <programlisting language="php"><![CDATA[
 // UTF-8 を使用
 $filter = new Zend_Filter_StringToLower('UTF-8');
 
@@ -37,17 +66,18 @@ $filter = new Zend_Filter_StringToLower(array('encoding' => 'UTF-8'));
 $filter->setEncoding('ISO-8859-1');
 ]]></programlisting>
 
-    <note>
-        <title>間違ったエンコーディングの設定</title>
+        <note>
+            <title>間違ったエンコーディングの設定</title>
 
-        <para>
-            あるエンコーディングを設定したくて、mbstring拡張が環境で利用できないとき、
-            例外を得ることに注意してください。
-        </para>
+            <para>
+                あるエンコーディングを設定したくて、mbstring拡張が環境で利用できないとき、
+                例外を得ることに注意してください。
+            </para>
 
-        <para>
-            また、mbstring拡張でサポートされないエンコーディングを設定しようとしているとき、
-            例外を得ます。
-        </para>
-    </note>
+            <para>
+                また、mbstring拡張でサポートされないエンコーディングを設定しようとしているとき、
+                例外を得ます。
+            </para>
+        </note>
+    </sect3>
 </sect2>

+ 10 - 10
documentation/manual/ja/module_specs/Zend_Http_Client-Advanced.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 22466 -->
+<!-- EN-Revision: 22769 -->
 <sect1 id="zend.http.client.advanced">
     <title>Zend_Http_Client - 高度な使用法</title>
 
@@ -16,11 +16,11 @@
             指定された場所に同じリクエストを再送する必要があります。
             この際には同じリクエストメソッドを使用しなければなりません。
             しかし、ほとんどのクライアントはこの機能を実装しておらず、
-            リダイレクトの際には常に GET メソッドを使用するようになっています。
+            リダイレクトの際には常に <constant>GET</constant> メソッドを使用するようになっています。
             デフォルトでは、<classname>Zend_Http_Client</classname> も同じように動作します。
             つまり、301 や 302 によるリダイレクト指示を受けると、
-            GET パラメータや POST パラメータをすべてリセットした上で新しい場所に
-            GET リクエストを送信します。この振る舞いを変更するには、設定パラメータ
+            <constant>GET</constant> パラメータや POST パラメータをすべてリセットした上で新しい場所に
+            <constant>GET</constant> リクエストを送信します。この振る舞いを変更するには、設定パラメータ
             'strictredirects' を <constant>TRUE</constant> に設定します。
             <example id="zend.http.client.redirections.example-1">
                 <title>301 や 302 のレスポンスに対する RFC 2616 準拠のリダイレクト</title>
@@ -60,8 +60,8 @@ $cookie = Zend_Http_Cookie::fromString('flavor=chocolate%20chips');
 $client->setCookie($cookie);
 ]]></programlisting>
             </example>
-            <classname>Zend_Http_Cookie</classname> オブジェクトについての詳細
-            <xref linkend="zend.http.cookies" /> を参照ください。
+            <classname>Zend_Http_Cookie</classname> オブジェクトについて詳しく
+            <link linkend="zend.http.cookies">このセクション</link> をご覧ください。
         </para>
         <para>
             <classname>Zend_Http_Client</classname> は、クッキーの持続性 (stickiness) も提供しています。
@@ -90,8 +90,8 @@ $client->setUri('http://example.com/read_member_news.php');
 $client->request('GET');
 ]]></programlisting>
             </example>
-            <classname>Zend_Http_CookieJar</classname> クラスについての詳細
-            <xref linkend="zend.http.cookies.cookiejar" /> を参照ください。
+            <classname>Zend_Http_CookieJar</classname> クラスについて詳しく
+            <link linkend="zend.http.cookies.cookiejar">このセクション</link> をご覧ください。
         </para>
     </sect2>
 
@@ -272,7 +272,7 @@ $client->setUri('http://christer:secret@example.com');
         <para>
             同一クライアントから複数のリクエストを送信が、
             各リクエストのパラメータは完全に区別したいといった場合は、
-            resetParameters() メソッドを使用します。これにより、GET や
+            resetParameters() メソッドを使用します。これにより、<constant>GET</constant>
             POST のパラメータ、リクエストの本文そしてリクエスト固有のヘッダがリセットされ、
             次のリクエストには持ち越されなくなります。
         </para>
@@ -399,7 +399,7 @@ copy($response->getStreamName(), "my/downloads/file");
 $fp = fopen("my/downloads/file2", "w");
 stream_copy_to_stream($response->getStream(), $fp);
 // 既知のファイルに書き出すこともできます
-$client->setStream("my/downloads/myfile)->request('GET');
+$client->setStream("my/downloads/myfile")->request('GET');
 ]]></programlisting>
             </example>
         </para>

+ 56 - 14
documentation/manual/ja/module_specs/Zend_Pdf-Pages.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 20872 -->
+<!-- EN-Revision: 22797 -->
 <sect1 id="zend.pdf.pages">
     <title>ページの操作</title>
     <sect2 id="zend.pdf.pages.creation">
@@ -21,16 +21,8 @@
             メソッドをコールします。このメソッドは <classname>Zend_Pdf_Page</classname>
             オブジェクトを返します。<methodname>Zend_Pdf::newPage()</methodname>
             の場合は、すでにドキュメントにアタッチされているページを作成するという点が異なります。
-            こうするとそのページを複数の <acronym>PDF</acronym> ドキュメントで使いまわすことができませんが、
-            多少高速になります
-            <footnote>
-                <para>
-                これは現在のバージョンの Zend Framework の制限事項であり、
-                将来のバージョンではなくなる予定です。
-                しかし、ドキュメント間でページを共有するには、
-                アタッチされていないページのほうが常によい結果となるでしょう。
-                </para>
-            </footnote>。どちらの手法を使用するかはあなたしだいです。
+            アタッチされたページは複製されない限り、他の <acronym>PDF</acronym> で使用できません。
+            詳しくは <link linkend="zend.pdf.pages.cloning">ページの複製</link> セクションをご覧ください。
         </para>
 
         <para>
@@ -85,12 +77,12 @@ unset($pdf->pages[$id]);
     <sect2 id="zend.pdf.pages.cloning">
         <title>ページの複製</title>
         <para>
-            既存の <acronym>PDF</acronym> ページを複製するには、新しい <classname>Zend_Pdf_Page</classname>
+            既存の <acronym>PDF</acronym> ページを繰り返すには、新しい <classname>Zend_Pdf_Page</classname>
             オブジェクトを作成する際に既存のページをパラメータとして指定します。
         </para>
 
         <example id="zend.pdf.pages.example-2">
-            <title>既存のページの複製</title>
+            <title>既存のページを繰り返す</title>
             <programlisting language="php"><![CDATA[
 ...
 // テンプレートページを別の変数に格納します
@@ -98,11 +90,13 @@ $template = $pdf->pages[$templatePageIndex];
 ...
 // 新しいページを追加します
 $page1 = new Zend_Pdf_Page($template);
+$page1->drawText('Some text...', $x, $y);
 $pdf->pages[] = $page1;
 ...
 
 // 別のページを追加します
 $page2 = new Zend_Pdf_Page($template);
+$page2->drawText('Another text...', $x, $y);
 $pdf->pages[] = $page2;
 ...
 
@@ -119,12 +113,60 @@ unset($pdf->pages[$templatePageIndex]);
 
         <caution>
             <para>
-                注意! 複製されたページは、テンプレートページと同じ
+                注意! 繰り返されたページは、テンプレートページと同じ
                 <acronym>PDF</acronym> リソースを共有します。つまり、
                 テンプレートページと同じドキュメントしか使用できません。
                 ドキュメントを修正したら、新しいページとして保存できます。
             </para>
         </caution>
+
+        <para>
+            <code>clone</code> operator may be used to create page which is not attached to any document.
+            It takes more time than duplicating page since it needs to copy all dependent objects
+            (used fonts, images and other resources), but it allows to use pages from different source
+            documents to create new one: 
+        </para>
+
+        <example id="zend.pdf.pages.example-3">
+            <title>既存のページを複製</title>
+
+            <programlisting language="php"><![CDATA[
+$page1 = clone $pdf1->pages[$templatePageIndex1];
+$page2 = clone $pdf2->pages[$templatePageIndex2];
+$page1->drawText('Some text...', $x, $y);
+$page2->drawText('Another text...', $x, $y);
+...
+$pdf = new Zend_Pdf();
+$pdf->pages[] = $page1;
+$pdf->pages[] = $page2;
+]]></programlisting>
+        </example>
+
+        <para>
+            If several template pages are planned to be used as templates then it could be more efficient 
+            to utilize <classname>Zend_Pdf_Resource_Extractor</classname> class which gives an ability 
+            to share resources between cloned pages - fonts, images, etc. (otherwise new resource copy 
+            will be created for each cloned page):  
+        </para>
+
+        <example id="zend.pdf.pages.example-4">
+            <title>
+                Cloning existing page using <classname>Zend_Pdf_Resource_Extractor</classname> class
+            </title>
+
+            <programlisting language="php"><![CDATA[
+$extractor = new Zend_Pdf_Resource_Extractor();
+....
+$page1 = $extractor->clonePage($pdf->pages[$templatePageIndex1]);
+$page2 = $extractor->clonePage($pdf->pages[$templatePageIndex2]);
+$page1->drawText('Some text...', $x, $y);
+$page2->drawText('Another text...', $x, $y);
+...
+$pdf = new Zend_Pdf();
+$pdf->pages[] = $page1;
+$pdf->pages[] = $page2;
+]]></programlisting>
+        </example>
     </sect2>
 </sect1>
 <!--