Browse Source

[DOCUMENTATION] French: sync manual

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20201 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 năm trước cách đây
mục cha
commit
785d7a662e

+ 6 - 4
documentation/manual/fr/module_specs/Zend_Application-AvailableResources-Db.xml

@@ -1,14 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 16845 -->
+<!-- EN-Revision: 20111 -->
 <!-- Reviewed: no -->
 <sect2 id="zend.application.available-resources.db">
     <title>Zend_Application_Resource_Db</title>
 
     <para>
         <classname>Zend_Application_Resource_Db</classname> initialisera un adaptateur
-        <classname>Zend_Db</classname> basé sur les options qui lui seront fournis. Par défaut, il
-        spécifiera aussi cet adaptateur comme adaptateur par défaut à utiliser avec
-        <classname>Zend_Db_Table</classname>.
+        <classname>Zend_Db</classname> basé sur les options qui lui seront fournis. Par
+        défaut, il spécifiera aussi cet adaptateur comme adaptateur par défaut à utiliser
+        avec <classname>Zend_Db_Table</classname>. Si vous souhaitez utiliser simultanément
+        de multiples bases de données, vous pouvez utiliser la <link
+        linkend="zend.application.available-resources.multidb">plugin de ressource Multidb</link>.
     </para>
 
     <para>

+ 86 - 0
documentation/manual/fr/module_specs/Zend_Application-AvailableResources-Multidb.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- EN-Revision: 20176 -->
+<!-- Reviewed: no -->
+<sect2 id="zend.application.available-resources.multidb">
+    <title>Zend_Application_Resource_Multidb</title>
+
+    <para>
+        <classname>Zend_Application_Resource_Multidb</classname> is used to initialize
+        multiple Database connections. You can use the same options as you can with
+        the <link linkend="zend.application.available-resources.db">Db Resource Plugin</link>.
+        However, for specifying a default connection, you can also use the 'default' directive.
+    </para>
+
+    <example id="zend.application.available-resources.multidb.configexample">
+        <title>Setting up multiple Db Connections</title>
+
+        <para>
+            Below is an example <acronym>INI</acronym> configuration that can be used to initialize
+            two Db Connections.
+        </para>
+
+        <programlisting language="ini"><![CDATA[
+[production]
+resources.multidb.db1.adapter = "pdo_mysql"
+resources.multidb.db1.host = "localhost"
+resources.multidb.db1.username = "webuser"
+resources.multidb.db1.password = "XXXX"
+resources.multidb.db1.dbname = "db1"
+
+resources.multidb.db2.adapter = "pdo_pgsql"
+resources.multidb.db2.host = "example.com"
+resources.multidb.db2.username = "dba"
+resources.multidb.db2.password = "notthatpublic"
+resources.multidb.db2.dbname = "db2"
+resources.multidb.db2.default = true
+]]></programlisting>
+    </example>
+
+    <example id="zend.application.available-resources.multidb.retrieveSpecificDb">
+        <title>Retrieving a specific database adapter</title>
+
+        <para>
+            When using this resource plugin you usually will want to retrieve
+            a specific database. This can be done by using the resource's
+            <methodname>getDb()</methodname>. The method
+            <methodname>getDb()</methodname> returns an instance of a class that
+            extends <classname>Zend_Db_Adapter_Abstract</classname>. If you have not
+            set a default database, an exception will be thrown when this method
+            is called without specifying a parameter.
+         </para>
+
+        <programlisting language="php"><![CDATA[
+$resource = $bootstrap->getPluginResource('multidb');
+$db1 = $resource->getDb('db1');
+$db2 = $resource->getDb('db2');
+$defaultDb = $resource->getDb();
+]]></programlisting>
+    </example>
+
+    <example id="zend.application.available-resources.multidb.retrieveDefaultDb">
+        <title>Retrieving the default database adapter</title>
+
+        <para>
+            Additionally, you can retrieve the default database adapter
+            by using the method <methodname>getDefaultDb()</methodname>.
+            If you have not set a default adapter, the first configured db
+            adapter will be returned. Unless you specify <constant>FALSE</constant>
+            as first parameter, then <constant>NULL</constant>
+            will be returned when no default database adapter was set.
+         </para>
+
+        <para>
+            Below is an example that assumes the Multidb resource plugin has been configured
+            with the <acronym>INI</acronym> sample above:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+$resource = $bootstrap->getPluginResource('multidb');
+$db2 = $resource->getDefaultDb();
+
+// Same config, but now without a default db:
+$db1 = $resource->getDefaultDb();
+$null = $resource->getDefaultDb(false); // null
+]]></programlisting>
+    </example>
+</sect2>

+ 2 - 1
documentation/manual/fr/module_specs/Zend_Application-AvailableResources.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 20076 -->
+<!-- EN-Revision: 20111 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.application.available-resources" xmlns:xi="http://www.w3.org/2001/XInclude">
     <title>Plugins de ressources disponibles</title>
@@ -15,6 +15,7 @@
     <xi:include href="Zend_Application-AvailableResources-Layout.xml" />
     <xi:include href="Zend_Application-AvailableResources-Locale.xml" />
     <xi:include href="Zend_Application-AvailableResources-Log.xml" />
+    <xi:include href="Zend_Application-AvailableResources-Multidb.xml" />
     <xi:include href="Zend_Application-AvailableResources-Mail.xml" />
     <xi:include href="Zend_Application-AvailableResources-Modules.xml" />
     <xi:include href="Zend_Application-AvailableResources-Navigation.xml" />

+ 1 - 1
documentation/manual/fr/module_specs/Zend_Config_Xml.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 16945 -->
+<!-- EN-Revision: 20101 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.config.adapters.xml">
     <title>Zend_Config_Xml</title>

+ 1 - 1
documentation/manual/fr/module_specs/Zend_Controller-Router-Route-Rest.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 20078 -->
+<!-- EN-Revision: 20176 -->
 <!-- Reviewed: no -->
 <sect3 id="zend.controller.router.routes.rest">
     <title>Zend_Rest_Route</title>