webman_ad/config/database.php
2024-12-11 18:30:32 +08:00

52 lines
1.6 KiB
PHP

<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
// 默认数据库
'default' => 'pgsql',
// 各种数据库配置
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => getenv('DB_HOST'),
'port' => getenv('DB_PORT'),
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASSWORD'),
'unix_socket' => '',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'options' => [
\PDO::ATTR_TIMEOUT => 3
]
],
'pgsql' => [
'driver' => getenv('DB_PG_CONNECTION'),
'hostname' => getenv('DB_PG_HOST'),
'hostport' => getenv('DB_PG_PORT'),
'database' => getenv('DB_PG_NAME'),
'username' => getenv('DB_PG_USER'),
'password' => getenv('DB_PG_PASSWORD'),
'unix_socket' => '',
'charset' => 'utf8',
'prefix' => 'ad_', // 数据表前缀
'debug' => true,
]
],
];