Skip to content

Commit 5eeb988

Browse files
committed
docs: fix incorrect description
We don't have PDO and ODBC drivers. Some driver uses DSN to connect, but it is not a must because CI builds it from other settings.
1 parent bceb19e commit 5eeb988

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

user_guide_src/source/database/configuration.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ while connecting to specify a group name.
3535
DSN
3636
---
3737

38-
Some database drivers (such as PDO, PostgreSQL, Oracle, ODBC) might
39-
require a full DSN string to be provided. If that is the case, you
40-
should use the 'DSN' configuration setting, as if you're using the
41-
driver's underlying native PHP extension, like this:
38+
Some database drivers (such as Postgre, OCI8) requires a full DSN string to connect.
39+
But if you do not specify a DSN string for a driver that requires it, CodeIgniter
40+
will try to build it with the rest of the provided settings.
4241

43-
.. literalinclude:: configuration/002.php
42+
If you specify a DSN, you should use the ``'DSN'`` configuration setting, as if
43+
you're using the driver's underlying native PHP extension, like this:
4444

45-
.. note:: If you do not specify a DSN string for a driver that requires it, CodeIgniter
46-
will try to build it with the rest of the provided settings.
45+
.. literalinclude:: configuration/002.php
46+
:lines: 11-15
4747

4848
DSN in Universal Manner
4949
^^^^^^^^^^^^^^^^^^^^^^^
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<?php
22

3-
// PDO
4-
$default = [
5-
'DSN' => 'pgsql:host=localhost;port=5432;dbname=database_name',
3+
namespace Config;
4+
5+
use CodeIgniter\Database\Config;
6+
7+
class Database extends Config
8+
{
69
// ...
7-
];
810

9-
// Oracle
10-
$default = [
11-
'DSN' => '//localhost/XE',
11+
// OCI8
12+
public array $default = [
13+
'DSN' => '//localhost/XE',
14+
// ...
15+
];
16+
1217
// ...
13-
];
18+
}

0 commit comments

Comments
 (0)