docs: update sample code

This commit is contained in:
kenjis 2022-05-30 17:08:03 +09:00
parent c92ae74900
commit 7501477180
No known key found for this signature in database
GPG Key ID: BD254878922AF198
5 changed files with 26 additions and 6 deletions

View File

@ -23,6 +23,7 @@ class Database extends Config
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
// ...

View File

@ -1,7 +1,13 @@
<?php
// PDO
$default['DSN'] = 'pgsql:host=localhost;port=5432;dbname=database_name';
$default = [
'DSN' => 'pgsql:host=localhost;port=5432;dbname=database_name',
// ...
];
// Oracle
$default['DSN'] = '//localhost/XE';
$default = [
'DSN' => '//localhost/XE',
// ...
];

View File

@ -1,3 +1,6 @@
<?php
$default['DSN'] = 'DBDriver://username:password@hostname:port/database';
$default = [
'DSN' => 'DBDriver://username:password@hostname:port/database',
// ...
];

View File

@ -1,6 +1,13 @@
<?php
// MySQLi
$default['DSN'] = 'MySQLi://username:password@hostname:3306/database?charset=utf8&DBCollat=utf8_general_ci';
$default = [
'DSN' => 'MySQLi://username:password@hostname:3306/database?charset=utf8&DBCollat=utf8_general_ci',
// ...
];
// Postgre
$default['DSN'] = 'Postgre://username:password@hostname:5432/database?charset=utf8&connect_timeout=5&sslmode=1';
$default = [
'DSN' => 'Postgre://username:password@hostname:5432/database?charset=utf8&connect_timeout=5&sslmode=1',
// ...
];

View File

@ -1,3 +1,6 @@
<?php
$default['port'] = 5432;
$default = [
// ...
'port' => 5432,
];