Skip to content

Commit 7501477

Browse files
committed
docs: update sample code
1 parent c92ae74 commit 7501477

5 files changed

Lines changed: 26 additions & 6 deletions

File tree

user_guide_src/source/database/configuration/001.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Database extends Config
2323
'compress' => false,
2424
'strictOn' => false,
2525
'failover' => [],
26+
'port' => 3306,
2627
];
2728

2829
// ...
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<?php
22

33
// PDO
4-
$default['DSN'] = 'pgsql:host=localhost;port=5432;dbname=database_name';
4+
$default = [
5+
'DSN' => 'pgsql:host=localhost;port=5432;dbname=database_name',
6+
// ...
7+
];
58

69
// Oracle
7-
$default['DSN'] = '//localhost/XE';
10+
$default = [
11+
'DSN' => '//localhost/XE',
12+
// ...
13+
];
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
<?php
22

3-
$default['DSN'] = 'DBDriver://username:password@hostname:port/database';
3+
$default = [
4+
'DSN' => 'DBDriver://username:password@hostname:port/database',
5+
// ...
6+
];
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<?php
22

33
// MySQLi
4-
$default['DSN'] = 'MySQLi://username:password@hostname:3306/database?charset=utf8&DBCollat=utf8_general_ci';
4+
$default = [
5+
'DSN' => 'MySQLi://username:password@hostname:3306/database?charset=utf8&DBCollat=utf8_general_ci',
6+
// ...
7+
];
8+
59
// Postgre
6-
$default['DSN'] = 'Postgre://username:password@hostname:5432/database?charset=utf8&connect_timeout=5&sslmode=1';
10+
$default = [
11+
'DSN' => 'Postgre://username:password@hostname:5432/database?charset=utf8&connect_timeout=5&sslmode=1',
12+
// ...
13+
];
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
<?php
22

3-
$default['port'] = 5432;
3+
$default = [
4+
// ...
5+
'port' => 5432,
6+
];

0 commit comments

Comments
 (0)