Browse Source

[DOCUMENTATION] French: sync manual

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20082 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 years ago
parent
commit
959ba9500d

+ 35 - 1
documentation/manual/fr/module_specs/Zend_Http_Client-Adapters.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17405 -->
+<!-- EN-Revision: 19419 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.http.client.adapters">
     <title>Zend_Http_Client - Adaptateurs de connexion</title>
@@ -560,6 +560,40 @@ $adapter->addResponse(
             l'injecter dans votre application à tester, et voir le résultat et les
             comportements.
         </para>
+
+        <para>
+            If you need the adapter to fail on demand you can use
+            <methodname>setNextRequestWillFail($flag)</methodname>. The method will cause the next
+            call to <methodname>connect()</methodname> to throw an
+            <classname>Zend_Http_Client_Adapter_Exception</classname> exception. This can be useful
+            when your application caches content from an external site (in case the site goes down)
+            and you want to test this feature.
+        </para>
+
+        <example id="zend.http.client.adapters.test.example-3">
+            <title>Forcing the adapter to fail</title>
+
+            <programlisting language="php"><![CDATA[
+// Instantiate a new adapter and client
+$adapter = new Zend_Http_Client_Adapter_Test();
+$client = new Zend_Http_Client('http://www.example.com', array(
+    'adapter' => $adapter
+));
+
+// Force the next request to fail with an exception
+$adapter->nextRequestWillFail(true);
+
+try {
+    // This call will result in a Zend_Http_Client_Adapter_Exception
+    $client->request();
+} catch (Zend_Http_Client_Adapter_Exception $e) {
+    // ...
+}
+
+// Further requests will work as expected until
+// you call setNextRequestWillFail(true) again
+]]></programlisting>
+        </example>
     </sect2>
 
     <sect2 id="zend.http.client.adapters.extending">

+ 26 - 2
documentation/manual/fr/module_specs/Zend_Json-Basics.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17166 -->
+<!-- EN-Revision: 19911 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.json.basics">
     <title>Utilisation de base</title>
@@ -14,4 +14,28 @@ $phpNatif = Zend_Json::decode($valeurCodee);
 // Codage pour renvoi au client :
 $json = Zend_Json::encode($phpNatif);
 ]]></programlisting></para>
-    </sect1>
+
+    <sect2 id="zend.json.basics.prettyprint">
+        <title>Pretty-printing JSON</title>
+
+        <para>
+            Sometimes, it may be hard to explore <acronym>JSON</acronym>  data generated by
+            <methodname>Zend_Json::encode()</methodname>,
+            since it has no spacing or indentation. In order to make it easier, <classname>Zend_Json</classname>
+            allows you to pretty-print <acronym>JSON</acronym> data in the human-readable format 
+            with <methodname>Zend_Json::prettyPrint()</methodname>.
+        </para>
+        
+        <programlisting language="php"><![CDATA[
+    // Encode it to return to the client:
+    $json = Zend_Json::encode($phpNative);
+    if($debug) {
+    echo Zend_Json::prettyPrint($json, array("indent" => " "));
+    }
+    ]]></programlisting>
+        <para>
+            Second optional argument of <methodname>Zend_Json::prettyPrint()</methodname> is an option array. 
+            Option <code>indent</code> allows to set indentation string - by default it's a single tab character.
+        </para>
+    </sect2>
+</sect1>

+ 166 - 1
documentation/manual/fr/module_specs/Zend_Loader-Autoloader.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17175 -->
+<!-- EN-Revision: 18840 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.loader.autoloader">
     <title>L'autoloader</title>
@@ -130,6 +130,171 @@ $autoloader->setFallbackAutoloader(true);
 ]]></programlisting>
     </sect2>
 
+    <sect2 id="zend.loader.autoloader.zf-version">
+        <title>Selecting a Zend Framework version</title>
+
+        <para>
+            Typically, you will use the version of Zend Framework that the autoloader you
+            instantiate came with. However, when developing a project, it's often useful to track
+            specific versions, major or minor branches, or just the latest version.
+            <classname>Zend_Loader_Autoloader</classname>, as of version 1.10, offers some features
+            to help manage this task.
+        </para>
+
+        <para>
+            Imagine the following scenario:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    During <emphasis>development</emphasis>, you want to track the latest version of
+                    Zend Framework you have installed, so that you can ensure the application works
+                    when you upgrade between versions.
+                </para>
+
+                <para>
+                    When pushing to <emphasis>Quality Assurance</emphasis>, however, you need to
+                    have slightly more stability, so you want to use the latest installed revision
+                    of a specific minor version.
+                </para>
+
+                <para>
+                    Finally, when you push to <emphasis>production</emphasis>, you want to pin to a
+                    specific installed version, to ensure no breakage occurs if or when you add new
+                    versions of Zend Framework to you server.
+                </para>
+            </listitem>
+        </itemizedlist>
+
+        <para>
+            The autoloader allows you to do this with the method
+            <methodname>setZfPath()</methodname>. This method takes two arguments, a
+            <emphasis>path</emphasis> to a set of Zend Framework installations, and a
+            <emphasis>version</emphasis> to use. Once invoked, it prepends a path to the
+            <constant>include_path</constant> pointing to the appropriate Zend Framework
+            installation library.
+        </para>
+
+        <para>
+            The directory you specify as your <emphasis>path</emphasis> should have a tree such as
+            the following:
+        </para>
+
+        <programlisting language="text"><![CDATA[
+ZendFramework/
+|-- 1.9.2/
+|   |-- library/
+|-- ZendFramework-1.9.1-minimal/
+|   |-- library/
+|-- 1.8.4PL1/
+|   |-- library/
+|-- 1.8.4/
+|   |-- library/
+|-- ZendFramework-1.8.3/
+|   |-- library/
+|-- 1.7.8/
+|   |-- library/
+|-- 1.7.7/
+|   |-- library/
+|-- 1.7.6/
+|   |-- library/
+]]></programlisting>
+
+        <para>
+            (where <emphasis>path</emphasis> points to the directory "ZendFramework" in the above
+            example)
+        </para>
+
+        <para>
+            Note that each subdirectory should contain the directory <filename>library</filename>,
+            which contains the actual Zend Framework library code. The individual subdirectory names
+            may be version numbers, or simply be the untarred contents of a standard Zend Framework
+            distribution tarball/zipfile.
+        </para>
+
+        <para>
+            Now, let's address the use cases. In the first use case, in
+            <emphasis>development</emphasis>, we want to track the latest source install. We can do
+            that by passing "latest" as the version:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+$autoloader->setZfPath($path, 'latest');
+]]></programlisting>
+
+        <para>
+            In the example from above, this will map to the directory
+            <filename>ZendFramework/1.9.2/library/</filename>; you can verify this by checking the
+            return value of <methodname>getZfPath()</methodname>.
+        </para>
+
+        <para>
+            In the second situation, for <emphasis>quality assurance</emphasis>, let's say we want
+            to pin to the 1.8 minor release, using the latest install you have for that release. You
+            can do so as follows:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+$autoloader->setZfPath($path, '1.8');
+]]></programlisting>
+
+        <para>
+            In this case, it will find the directory
+            <filename>ZendFramework/1.8.4PL1/library/</filename>.
+        </para>
+
+        <para>
+            In the final case, for <emphasis>production</emphasis>, we'll pin to a specific version
+            -- 1.7.7, since that was what was available when Quality Assurance tested prior to our
+            release.
+        </para>
+
+        <programlisting language="php"><![CDATA[
+$autoloader->setZfPath($path, '1.7.7');
+]]></programlisting>
+
+        <para>
+            Predictably, it finds the directory <filename>ZendFramework/1.7.7/library/</filename>.
+        </para>
+
+        <para>
+            You can also specify these values in the configuration file you use with
+            <filename>Zend_Application</filename>. To do so, you'd specify the following
+            information:
+        </para>
+
+        <programlisting language="ini"><![CDATA[
+[production]
+autoloaderZfPath = "path/to/ZendFramework"
+autoloaderZfVersion = "1.7.7"
+
+[qa]
+autoloaderZfVersion = "1.8"
+
+[development]
+autoloaderZfVersion = "latest"
+]]></programlisting>
+
+        <para>
+            Note the different environment sections, and the different version specified in each
+            environment; these factors will allow <classname>Zend_Application</classname> to
+            configure the autoloader appropriately.
+        </para>
+
+        <warning>
+            <title>Performance implications</title>
+
+            <para>
+                For best performance, either do not use this feature, or specify a specific Zend
+                Framework version (i.e., not "latest", a major revision such as "1", or a minor
+                revision such as "1.8"). Otherwise, the autoloader will need to scan the provided
+                path for directories matching the criteria -- a somewhat expensive operation to
+                perform on each request.
+            </para>
+        </warning>
+    </sect2>
+
     <sect2 id="zend.loader.autoloader.interface">
         <title>L'interface de l'autoloader</title>
 

+ 1 - 1
documentation/manual/fr/module_specs/Zend_Log-Writers.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17173 -->
+<!-- EN-Revision: 19493 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.log.writers" xmlns:xi="http://www.w3.org/2001/XInclude">
     <title>Rédacteurs (Writers)</title>

+ 36 - 7
documentation/manual/fr/module_specs/Zend_Mail-AdditionalHeaders.xml

@@ -1,9 +1,44 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17133 -->
+<!-- EN-Revision: 19450 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.mail.additional-headers">
     <title>En-têtes additionnels</title>
 
+     <para>
+        <classname>Zend_Mail</classname> provides several methods to set additional Mail Headers:
+        <itemizedlist>
+            <listitem>
+                <para>
+                    <methodname>setReplyTo($email, $name=null)</methodname>: sets the Reply-To: header.
+                </para>
+            </listitem>
+            <listitem>
+                <para>
+                    <methodname>setDate($date = null)</methodname>: sets the Date: header.
+                    This method uses current time stamp by default. Or You can pass time stamp,
+                    date string or <classname>Zend_Date</classname> instance to this method.
+                </para>
+            </listitem>
+            <listitem>
+                <para>
+                    <methodname>setMessageId($id = true)</methodname>: sets the Message-Id: header.
+                    This method can generate message ID automatically by default. Or You can pass
+                    your message ID string to this method.
+                    This method call <methodname>createMessageId()</methodname> internally.
+                </para>
+            </listitem>
+        </itemizedlist>
+     </para>
+    <note>
+        <title>Return-Path</title>
+        <para>
+            If you set Return-Path on your mail, see <link
+                linkend="zend.mail.introduction.sendmail">Configuring sendmail transport</link>.
+            Unfortunately, <methodname>setReturnPath($email)</methodname> method does not perform
+            this purpose.
+        </para>
+    </note>
+
     <para>
         Des en-têtes arbitraires peuvent être définis en utilisant la méthode
         <methodname>addHeader()</methodname>. Elle a besoin de deux paramètres contenant le nom et la valeur du
@@ -21,10 +56,4 @@ $mail->addHeader('X-greetingsTo', 'Maman', true); // plusieurs valeurs
 $mail->addHeader('X-greetingsTo', 'Papa', true);
 ]]></programlisting>
     </example>
-
-    <para>
-        Pour spécifier l'en-tête "Reply-To", il existe la méthode
-        <methodname>setReplyTo($email, $name=null)</methodname>, car il requiert des échappements
-        additionnels spéciaux pour les différentes parties (émail et nom).
-    </para>
 </sect1>