swoole-framwork/app/config/db.php
2024-05-23 10:42:45 +08:00

25 lines
769 B
PHP

<?php
$env = parse_ini_file(ROOT_PATH . "/.env");
return [
'default' => [
'driver' => 'mysql',
'host' => $env['dataurl'] ?? '127.0.0.1',
'database' => $env['database'] ?? 'blog',
'username' => $env['datauser'] ?? 'root',
'password' => $env['datapwd'] ?? '123456',
'port' => $env['dataport'] ?? 3306,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'prefix' => 'eb_',
],
'db2' => [
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'test',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
],
];