Просмотр исходного кода

[DOCUMENTATION] French: sync manual

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20790 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 лет назад
Родитель
Сommit
72396e1a13

+ 23 - 45
documentation/manual/fr/module_specs/Zend_Validate-Set.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17172 -->
+<!-- EN-Revision: 20229 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.validate.set" xmlns:xi="http://www.w3.org/2001/XInclude">
     <title>Classes de validation standard</title>
@@ -38,19 +38,9 @@
         </note>
     </sect2>
 
-    <sect2 id="zend.validate.set.barcode">
-        <title>Barcode</title>
-
-        <para>
-            Ce validateur est instancié avec le type de code-barres suivant lequel vous
-            souhaitez valider une valeur. Il supporte actuellement les types de code-barres
-            "<code>UPC-A</code>" (Universal Product Code) et "<code>EAN-13</code>" (European Article
-            Number), et la méthode <methodname>isValid()</methodname> retourne <constant>TRUE</constant> si et seulement
-            si la valeur fournie est validée par l'algorithme de validation du code-barres. Vous
-            devez retirer tous les caractères exceptés les nombres compris entre zéro et neuf (0-9)
-            de la valeur à tester avant de la fournir au validateur.
-        </para>
-    </sect2>
+    <xi:include href="Zend_Validate-Barcode.xml">
+        <xi:fallback><xi:include href="../../en/module_specs/Zend_Validate-Barcode.xml" /></xi:fallback>
+    </xi:include>
 
     <sect2 id="zend.validate.set.between">
         <title>Between</title>
@@ -64,6 +54,9 @@
         </para>
     </sect2>
 
+    <xi:include href="Zend_Validate-Callback.xml" />
+    <xi:include href="Zend_Validate-CreditCard.xml" />
+
     <sect2 id="zend.validate.set.ccnum">
         <title>Ccnum</title>
 
@@ -72,6 +65,14 @@
             url="http://fr.wikipedia.org/wiki/Luhn">l'algorithme de Luhn ("module 10")</ulink> pour
             les numéros de cartes de crédits.
         </para>
+
+        <note>
+            <para>
+                Le validateur <classname>Ccnum</classname> a été déprécié en faveur du validateur
+                <classname>CreditCard</classname>. Pour des raisons de sécurité, vous devriez
+                utiliser CreditCard au lieu de Ccnum.
+            </para>
+        </note>
     </sect2>
 
     <sect2 id="zend.validate.set.date">
@@ -87,9 +88,7 @@
         </para>
     </sect2>
 
-    <xi:include href="Zend_Validate-Db.xml">
-        <xi:fallback><xi:include href="../../en/module_specs/Zend_Validate-Db.xml" /></xi:fallback>
-    </xi:include>
+    <xi:include href="Zend_Validate-Db.xml" />
 
     <sect2 id="zend.validate.set.digits">
         <title>Digits</title>
@@ -190,15 +189,8 @@ if ($validator->isValid($iban)) {
         </para>
     </sect2>
 
-    <sect2 id="zend.validate.set.in_array">
-        <title>InArray</title>
-
-        <para>
-            Retourne <constant>TRUE</constant> si et seulement si <varname>$value</varname> est contenue
-            dans un tableau. Si l'option stricte est à <constant>TRUE</constant>, alors le type de
-            <varname>$value</varname> est aussi vérifié.
-        </para>
-    </sect2>
+    <xi:include href="Zend_Validate-Identical.xml" />
+    <xi:include href="Zend_Validate-InArray.xml" />
 
     <sect2 id="zend.validate.set.int">
         <title>Int</title>
@@ -212,14 +204,8 @@ if ($validator->isValid($iban)) {
         </para>
     </sect2>
 
-    <sect2 id="zend.validate.set.ip">
-        <title>Ip</title>
-
-        <para>
-            Retourne <constant>TRUE</constant> si et seulement si <varname>$value</varname> est une adresse
-            IP valide.
-        </para>
-    </sect2>
+    <xi:include href="Zend_Validate-Ip.xml" />
+    <xi:include href="Zend_Validate-Isbn.xml" />
 
     <sect2 id="zend.validate.set.less_than">
         <title>LessThan</title>
@@ -230,14 +216,8 @@ if ($validator->isValid($iban)) {
         </para>
     </sect2>
 
-    <sect2 id="zend.validate.set.not_empty">
-        <title>NotEmpty</title>
-
-        <para>
-            Retourne <constant>TRUE</constant> si et seulement si <varname>$value</varname> est une valeur
-            non vide.
-        </para>
-    </sect2>
+    <xi:include href="Zend_Validate-NotEmpty.xml" />
+    <xi:include href="Zend_Validate-PostCode.xml" />
 
     <sect2 id="zend.validate.set.regex">
         <title>Regex</title>
@@ -248,9 +228,7 @@ if ($validator->isValid($iban)) {
         </para>
     </sect2>
 
-    <xi:include href="Zend_Validate-Sitemap.xml">
-        <xi:fallback><xi:include href="../../en/module_specs/Zend_Validate-Sitemap.xml" /></xi:fallback>
-    </xi:include>
+    <xi:include href="Zend_Validate-Sitemap.xml" />
 
     <sect2 id="zend.validate.set.string_length">
         <title>StringLength</title>

+ 54 - 20
documentation/manual/fr/module_specs/Zend_XmlRpc_Client.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17178 -->
+<!-- EN-Revision: 19606 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.xmlrpc.client">
     <title>Zend_XmlRpc_Client</title>
@@ -121,36 +121,46 @@ $result = $client->call('test.sayHello', array($arg1, $arg2));
                             <entry>integer</entry>
                             <entry>int</entry>
                         </row>
-
+                        <row>
+                            <entry>Zend_Crypt_Math_BigInteger</entry>
+                            <entry>i8</entry>
+                        </row>
                         <row>
                             <entry>double</entry>
                             <entry>double</entry>
                         </row>
-
                         <row>
                             <entry>boolean</entry>
                             <entry>boolean</entry>
                         </row>
-
                         <row>
                             <entry>string</entry>
                             <entry>string</entry>
                         </row>
-
+                        <row>
+                            <entry>null</entry>
+                            <entry>nil</entry>
+                        </row>
                         <row>
                             <entry>array</entry>
                             <entry>array</entry>
                         </row>
-
                         <row>
                             <entry>associative array</entry>
                             <entry>struct</entry>
                         </row>
-
                         <row>
                             <entry>object</entry>
                             <entry>array</entry>
                         </row>
+                        <row>
+                            <entry>Zend_Date</entry>
+                            <entry>dateTime.iso8601</entry>
+                        </row>
+                        <row>
+                            <entry>DateTime</entry>
+                            <entry>dateTime.iso8601</entry>
+                        </row>
                     </tbody>
                 </tgroup>
             </table>
@@ -249,49 +259,73 @@ $result = $client->call('foo.bar', array(array()));
                     <tbody>
                         <row>
                             <entry>int</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_INTEGER</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_INTEGER</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_Integer</classname></entry>
                         </row>
 
                         <row>
+                            <entry>i8</entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_I8</constant></entry>
+                            <entry><classname>Zend_XmlRpc_Value_BigInteger</classname></entry>
+                        </row>
+
+                        <row>
+                            <entry>ex:i8</entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_APACHEI8</constant></entry>
+                            <entry><classname>Zend_XmlRpc_Value_BigInteger</classname></entry>
+                        </row>
+
+                        <row>
                             <entry>double</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_DOUBLE</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_DOUBLE</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_Double</classname></entry>
                         </row>
 
                         <row>
                             <entry>boolean</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_BOOLEAN</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_BOOLEAN</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_Boolean</classname></entry>
                         </row>
 
                         <row>
                             <entry>string</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_STRING</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_STRING</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_String</classname></entry>
                         </row>
 
                         <row>
+                            <entry>nil</entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_NIL</constant></entry>
+                            <entry><classname>Zend_XmlRpc_Value_Nil</classname></entry>
+                        </row>
+
+                        <row>
+                            <entry>ex:nil</entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_APACHENIL</constant></entry>
+                            <entry><classname>Zend_XmlRpc_Value_Nil</classname></entry>
+                        </row>
+
+                        <row>
                             <entry>base64</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_BASE64</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_BASE64</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_Base64</classname></entry>
                         </row>
 
                         <row>
                             <entry>dateTime.iso8601</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_DATETIME</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_DATETIME</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_DateTime</classname></entry>
                         </row>
 
                         <row>
                             <entry>array</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_ARRAY</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_ARRAY</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_Array</classname></entry>
                         </row>
 
                         <row>
                             <entry>struct</entry>
-                            <entry><classname>Zend_XmlRpc_Value::XMLRPC_TYPE_STRUCT</classname></entry>
+                            <entry><constant>Zend_XmlRpc_Value::XMLRPC_TYPE_STRUCT</constant></entry>
                             <entry><classname>Zend_XmlRpc_Value_Struct</classname></entry>
                         </row>
                     </tbody>
@@ -300,7 +334,7 @@ $result = $client->call('foo.bar', array(array()));
 
             <para>
                 <note>
-                        <title>Conversion automatique</title>
+                    <title>Conversion automatique</title>
 
                     <para>
                         Lorsque vous créez un objet <classname>Zend_XmlRpc_Value</classname>,
@@ -338,10 +372,10 @@ $result = $client->call('foo.bar', array(array()));
             <programlisting language="php"><![CDATA[
 $client = new Zend_XmlRpc_Client('http://framework.zend.com/xmlrpc');
 
-$server = $client->getProxy();
+$service = $client->getProxy();
 // Proxy l'espace de nom par défaut
 
-$hello = $server->test->sayHello(1, 2);
+$hello = $service->test->sayHello(1, 2);
 // test.Hello(1, 2) retourne "hello"
 ]]></programlisting>
         </example>
@@ -514,8 +548,8 @@ $request->setParams(array('foo', 'bar'));
 
 $client->doRequest($request);
 
-// $server->getLastRequest() retoure instanceof Zend_XmlRpc_Request
-// $server->getLastResponse() retourne instanceof Zend_XmlRpc_Response
+// $client->getLastRequest() retoure instanceof Zend_XmlRpc_Request
+// $client->getLastResponse() retourne instanceof Zend_XmlRpc_Response
 ]]></programlisting>
         </example>
 

+ 243 - 20
documentation/manual/fr/module_specs/Zend_XmlRpc_Server.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17409 -->
+<!-- EN-Revision: 20763 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.xmlrpc.server">
     <title>Zend_XmlRpc_Server</title>
@@ -57,6 +57,55 @@ echo $server->handle();
         </para>
     </sect2>
 
+    <sect2 id="zend.xmlrpc.server.anatomy">
+        <title>Anatomy of a webservice</title>
+
+        <sect3 id="zend.xmlrpc.server.anatomy.general">
+            <title>General considerations</title>
+
+            <para>
+                For maximum performance it is recommended to use a simple
+                bootstrap file for the server component. Using
+                <classname>Zend_XmlRpc_Server</classname> inside a
+                <link linkend="zend.controller"><classname>Zend_Controller</classname></link>
+                is strongly discouraged to avoid the overhead.
+            </para>
+
+            <para>
+                Services change over time and while webservices are generally
+                less change intense as code-native <acronym>APIs</acronym>, it
+                is recommended to version your service. Do so to lay grounds to
+                provide compatibility for clients using older versions of your
+                service and manage your service lifecycle including deprecation
+                timeframes.To do so just include a version number into your
+                <acronym>URI</acronym>. It is also recommended to include the
+                remote protocol name in the <acronym>URI</acronym> to allow easy
+                integration of upcoming remoting technologies.
+                http://myservice.ws/<emphasis>1.0/XMLRPC/</emphasis>.
+            </para>
+        </sect3>
+
+        <sect3 id="zend.xmlrpc.server.anatomy.expose">
+            <title>What to expose?</title>
+
+            <para>
+                Most of the time it is not sensible to expose business objects
+                directly. Business objects are usually small and under heavy
+                change, because change is cheap in this layer of your
+                application. Once deployed and adopted, web services are hard to
+                change. Another concern is <acronym>I/O</acronym> and latency:
+                the best webservice calls are those not happening. Therefore
+                service calls need to be more coarse-grained than usual business
+                logic is. Often an additional layer in front of your business
+                objects makes sense. This layer is sometimes referred to as
+                <ulink url="http://martinfowler.com/eaaCatalog/remoteFacade.html">Remote Facade.</ulink>.
+                Such a service layer adds a coarse grained interface on top of
+                your business logic and groups verbose operations into smaller
+                ones.
+            </para>
+        </sect3>
+    </sect2>
+
     <sect2 id="zend.xmlrpc.server.conventions">
         <title>Conventions</title>
 
@@ -130,11 +179,13 @@ function myFunc($val1, $val2, $val3)
 {}
 ]]></programlisting>
 
-        <para>
-            Attention toutefois, une signature multiple peut prêter à confusion au regard des
-            personnes utilisant votre service. En général une fonction ne devrait posséder qu'une
-            seule signature.
-        </para>
+        <note>
+            <para>
+                Attention toutefois, une signature multiple peut prêter à confusion au regard des
+                personnes utilisant votre service. En général une fonction ne devrait posséder qu'une
+                seule signature.
+            </para>
+        </note>
     </sect2>
 
     <sect2 id="zend.xmlrpc.server.namespaces">
@@ -309,7 +360,7 @@ echo $server->handle();
             serveur XML-RPC.
         </para>
 
-        <sect3 id="zend.xmlrpc.server.use.case1">
+        <example id="zend.xmlrpc.server.use.attach-function">
             <title>Utilisation basique</title>
 
             <para>L'exemple ci dessous attache une fonction au service XML-RPC.</para>
@@ -330,9 +381,9 @@ $server = new Zend_XmlRpc_Server();
 $server->addFunction('md5Value');
 echo $server->handle();
 ]]></programlisting>
-        </sect3>
+        </example>
 
-        <sect3 id="zend.xmlrpc.server.use.case2">
+        <example id="zend.xmlrpc.server.use.attach-class">
             <title>Attacher une classe</title>
 
             <para>
@@ -345,9 +396,107 @@ $server = new Zend_XmlRpc_Server();
 $server->setClass('Services_Comb');
 echo $server->handle();
 ]]></programlisting>
-        </sect3>
+        </example>
+
+        <example id="zend.xmlrpc.server.use.attach-class-with-arguments">
+            <title>Attaching a class with arguments</title>
+
+            <para>
+                The following example illustrates how to attach a class' public
+                methods and passing arguments to its methods. This can be used to specify certain
+                defaults when registering service classes.
+            </para>
+            <programlisting language="php"><![CDATA[
+class Services_PricingService
+{
+    /**
+     * Calculate current price of product with $productId
+     *
+     * @param ProductRepository $productRepository
+     * @param PurchaseRepository $purchaseRepository
+     * @param integer $productId
+     */
+    public function calculate(ProductRepository $productRepository,
+                              PurchaseRepository $purchaseRepository,
+                              $productId)
+    {
+        ...
+    }
+}
+
+$server = new Zend_XmlRpc_Server();
+$server->setClass('Services_PricingService',
+                  'pricing',
+                  new ProductRepository(),
+                  new PurchaseRepository());
+]]></programlisting>
+
+            <para>
+                The arguments passed at <methodname>setClass()</methodname> at server construction time are
+                injected into the method call <command>pricing.calculate()</command> on remote invokation.
+                In the example above, only the argument <code>$purchaseId</code> is expected from the client.
+            </para>
+        </example>
+
+        <example id="zend.xmlrpc.server.use.attach-class-with-arguments-constructor">
+            <title>Passing arguments only to constructor</title>
+
+            <para>
+                <classname>Zend_XmlRpc_Server</classname> allows to restrict argument passing to
+                constructors only. This can be used for constructor dependency injection.
+                To limit injection to constructors, call <methodname>sendArgumentsToAllMethods</methodname>
+                and pass <code>false</code> as an argument. This disables the default behavior of all arguments
+                being injected into the remote method. In the example below the instance of
+                <classname>ProductRepository</classname> and <classname>PurchaseRepository</classname> is only
+                injected into the constructor of <classname>Services_PricingService2</classname>.
+            </para>
+
+            <programlisting language="php"><![CDATA[
+class Services_PricingService2
+{
+    /**
+     * @param ProductRepository $productRepository
+     * @param PurchaseRepository $purchaseRepository
+     */
+    public function __construct(ProductRepository $productRepository,
+                                PurchaseRepository $purchaseRepository)
+    {
+        ...
+    }
+
+    /**
+     * Calculate current price of product with $productId
+     *
+     * @param integer $productId
+     * @return double
+     */
+    public function calculate($productId)
+    {
+        ...
+    }
+}
+
+$server = new Zend_XmlRpc_Server();
+$server->sendArgumentsToAllMethods(false);
+$server->setClass('Services_PricingService2',
+                  'pricing',
+                  new ProductRepository(),
+                  new PurchaseRepository());
+]]></programlisting>
+        </example>
+
+        <example id="zend.xmlrpc.server.use.attach-instance">
+            <title>Attaching a class instance</title>
 
-        <sect3 id="zend.xmlrpc.server.use.case3">
+            <para>
+                <methodname>setClass()</methodname> allows to register a previously instantiated
+                object at the server. Just pass an instance instead of the class name. Obviously
+                passing arguments to the constructor is not possible with pre-instantiated
+                objects.
+            </para>
+        </example>
+
+        <example id="zend.xmlrpc.server.use.attach-several-classes-namespaces">
             <title>Attacher plusieurs classes grâce aux espaces de noms</title>
 
             <para>
@@ -369,9 +518,9 @@ $server->setClass('Services_Pick', 'pick');
 // méthodes appelées sous la forme pick.*
 echo $server->handle();
 ]]></programlisting>
-        </sect3>
+        </example>
 
-        <sect3 id="zend.xmlrpc.server.use.case4">
+        <example id="zend.xmlrpc.server.use.exceptions-faults">
             <title>Spécifier les exceptions à utiliser en cas d'erreurs dans les réponses
             XML-RPC</title>
 
@@ -398,11 +547,21 @@ $server->setClass('Services_Pick', 'pick');
 // méthodes appelées sous la forme pick.*
 echo $server->handle();
 ]]></programlisting>
-        </sect3>
+        </example>
 
-        <sect3 id="zend.xmlrpc.server.use.case5">
+        <example id="zend.xmlrpc.server.use.custom-request-object">
             <title>Utiliser un objet de requête personnalisé</title>
 
+             <para>
+                Some use cases require to utilize a custom request object.
+                For example, <acronym>XML/RPC</acronym> is not bound to
+                <acronym>HTTP</acronym> as a transfer protocol. It is possible to use
+                other transfer protocols like <acronym>SSH</acronym> or telnet to send
+                the request and response data over the wire. Another use case is
+                authentication and authorization. In case of a different transfer
+                protocol, one need to change the implementation to read request data.
+            </para>
+
             <para>
                 L'exemple suivant montre comment utiliser un objet de requête
                 personnalisé.
@@ -431,9 +590,9 @@ $request = new Services_Request();
 
 echo $server->handle($request);
 ]]></programlisting>
-        </sect3>
+        </example>
 
-        <sect3 id="zend.xmlrpc.server.use.case6">
+        <example id="zend.xmlrpc.server.use.custom-response-object">
             <title>Utiliser un objet de réponse personnalisé</title>
 
             <para>
@@ -468,9 +627,13 @@ $server->setResponseClass('Services_Response');
 
 echo $server->handle($request);
 ]]></programlisting>
-        </sect3>
+        </example>
+    </sect2>
+     
+    <sect2 id="zend.xmlrpc.server.performance">
+        <title>Optimisation des performances</title>
 
-        <sect3 id="zend.xmlrpc.server.use.case7">
+        <example id="zend.xmlrpc.server.performance.caching">
             <title>Cache entre les requêtes</title>
 
             <para>
@@ -515,6 +678,66 @@ $server->setResponseClass('Services_Response');
 
 echo $server->handle($request);
 ]]></programlisting>
-        </sect3>
+        </example>
+
+        <note>
+            <para>
+                The server cache file should be located outside the document root.
+            </para>
+        </note>
+
+        <example id="zend.xmlrpc.server.performance.xmlgen">
+
+            <title>Optimizing XML generation</title>
+
+            <para>
+                <classname>Zend_XmlRpc_Server</classname> uses
+                <classname>DOMDocument</classname> of <acronym>PHP</acronym>
+                extension <code>ext/dom</code> to generate it's
+                <acronym>XML</acronym> output. While <code>ext/dom</code> is
+                available on a lot of hosts it is is not exactly the fastest.
+                Benchmarks have shown, that <classname>XMLWriter</classname>
+                from <code>ext/xmlwriter</code> performs better.
+            </para>
+
+            <para>
+                If <code>ext/xmlwriter</code> is available on your host, you can
+                select a the <classname>XMLWriter</classname>-based generator
+                to leaverage the performance differences.
+            </para>
+
+            <programlisting language="php"><![CDATA[
+require_once 'Zend/XmlRpc/Server.php';
+require_once 'Zend/XmlRpc/Generator/XMLWriter.php';
+
+Zend_XmlRpc_Value::setGenerator(new Zend_XmlRpc_Generator_XMLWriter());
+
+$server = new Zend_XmlRpc_Server();
+...
+]]></programlisting>
+        </example>
+
+        <note>
+            <title>Benchmark your application</title>
+
+            <para>
+                Performance is determined by a lot of parameters and
+                benchmarks only apply for the specific test case. Differences
+                come from PHP version, installed extensions, webserver and
+                operating system just to name a few. Please make sure to
+                benchmark your application on your own and decide which
+                generator to use based on <emphasis>your</emphasis> numbers.
+            </para>
+        </note>
+
+        <note>
+            <title>Benchmark your client</title>
+
+            <para>
+                This optimization makes sense for the client side too. Just
+                select the alternate <acronym>XML</acronym> generator before
+                doing any work with <classname>Zend_XmlRpc_Client</classname>.
+            </para>
+        </note>
     </sect2>
 </sect1>