swoole-framwork/app/config/db.php

26 lines
785 B
PHP
Raw Normal View History

2024-05-20 11:51:07 +08:00
<?php
2024-05-23 10:31:16 +08:00
$env = parse_ini_file(ROOT_PATH . "/.env");
var_dump($env);
2024-05-20 11:51:07 +08:00
return [
'default' => [
2024-05-21 14:33:56 +08:00
'driver' => 'mysql',
2024-05-23 10:31:16 +08:00
'host' => $env['dataurl'] ?? '127.0.0.1',
'database' => $env['database'] ?? 'blog',
'username' => $env['datauser'] ?? 'root',
'password' => $env['datapwd'] ?? '123456',
'port' => $env['dataport'] ?? 3306,
2024-05-21 14:33:56 +08:00
'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' => '',
],
2024-05-20 11:51:07 +08:00
];