summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/configuration.rst
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/database/configuration.rst')
-rw-r--r--user_guide_src/source/database/configuration.rst43
1 files changed, 43 insertions, 0 deletions
diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst
index 687f0d920..4f88c25ab 100644
--- a/user_guide_src/source/database/configuration.rst
+++ b/user_guide_src/source/database/configuration.rst
@@ -28,6 +28,48 @@ prototype::
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
+You can also specify failovers for the situation when the main connection cannot connect for some reason.
+These failovers can be specified by setting the failover for a connection like this::
+
+ $db['default']['failover'] = array(
+ array(
+ 'hostname' => 'localhost1',
+ 'username' => '',
+ 'password' => '',
+ 'database' => '',
+ 'dbdriver' => 'mysql',
+ 'dbprefix' => '',
+ 'pconnect' => TRUE,
+ 'db_debug' => TRUE,
+ 'cache_on' => FALSE,
+ 'cachedir' => '',
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_general_ci',
+ 'swap_pre' => '',
+ 'autoinit' => TRUE,
+ 'stricton' => FALSE
+ ),
+ array(
+ 'hostname' => 'localhost2',
+ 'username' => '',
+ 'password' => '',
+ 'database' => '',
+ 'dbdriver' => 'mysql',
+ 'dbprefix' => '',
+ 'pconnect' => TRUE,
+ 'db_debug' => TRUE,
+ 'cache_on' => FALSE,
+ 'cachedir' => '',
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_general_ci',
+ 'swap_pre' => '',
+ 'autoinit' => TRUE,
+ 'stricton' => FALSE
+ )
+ );
+
+You can specify as many failovers as you like.
+
The reason we use a multi-dimensional array rather than a more simple
one is to permit you to optionally store multiple sets of connection
values. If, for example, you run multiple environments (development,
@@ -116,6 +158,7 @@ Explanation of Values:
while developing an application.
**port** The database port number. To use this value you have to add a line to the database config array.
::
+
$db['default']['port'] = 5432;
====================== ==================================================================================================