Skip to content

Commit f1744e1

Browse files
committed
docs: add sub sections and fix section level
1 parent e09a5fe commit f1744e1

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

user_guide_src/source/database/configuration.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Database Configuration
66
:local:
77
:depth: 2
88

9+
***********
10+
Config File
11+
***********
12+
913
CodeIgniter has a config file that lets you store your database
1014
connection values (username, password, database name, etc.). The config
1115
file is located at **app/Config/Database.php**. You can also set
@@ -22,6 +26,9 @@ while connecting to specify a group name.
2226
.. note:: The default location of the SQLite3 database is in the ``writable`` folder.
2327
If you want to change the location, you must set the full path to the new folder.
2428

29+
DSN
30+
===
31+
2532
Some database drivers (such as PDO, PostgreSQL, Oracle, ODBC) might
2633
require a full DSN string to be provided. If that is the case, you
2734
should use the 'DSN' configuration setting, as if you're using the
@@ -45,6 +52,9 @@ add the config variables as a query string:
4552
database character set), which are present in the rest of the configuration
4653
fields, CodeIgniter will append them.
4754

55+
Failovers
56+
=========
57+
4858
You can also specify failovers for the situation when the main connection cannot connect for some reason.
4959
These failovers can be specified by setting the failover for a connection like this:
5060

@@ -69,14 +79,18 @@ variable located in the config file:
6979
default we've used the word "default" for the primary connection,
7080
but it too can be renamed to something more relevant to your project.
7181

82+
defaultGroup
83+
============
84+
7285
You could modify the config file to detect the environment and automatically
7386
update the `defaultGroup` value to the correct one by adding the required logic
7487
within the class' constructor:
7588

7689
.. literalinclude:: configuration/008.php
7790

78-
Configuring With .env File
79-
--------------------------
91+
**************************
92+
Configuring with .env File
93+
**************************
8094

8195
You can also save your configuration values within a **.env** file with the current server's
8296
database settings. You only need to enter the values that change from what is in the
@@ -89,8 +103,9 @@ default group's configuration settings. The values should be name following this
89103

90104
As with all other
91105

106+
**********************
92107
Explanation of Values:
93-
----------------------
108+
**********************
94109

95110
============== ===========================================================================================================
96111
Name Config Description

0 commit comments

Comments
 (0)