2014-01-04 06:28:33 +08:00
|
|
|
<?php
|
|
|
|
|
2024-02-09 12:15:09 +08:00
|
|
|
use yii\db\Connection;
|
2024-03-05 13:32:12 +08:00
|
|
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
|
|
|
$dotenv->load();
|
2014-01-04 06:28:33 +08:00
|
|
|
return [
|
2024-02-09 12:15:09 +08:00
|
|
|
'class' => Connection::class,
|
2024-02-27 15:40:19 +08:00
|
|
|
'dsn' => 'mysql:host='.$_ENV['DB_HOST'].';dbname='.$_ENV['DB_NAME'],
|
|
|
|
'username' => $_ENV['DB_USERNAME'],
|
|
|
|
'password' => $_ENV['DB_PASSWORD'],
|
2014-03-16 12:46:16 +08:00
|
|
|
'charset' => 'utf8',
|
2024-02-09 12:15:09 +08:00
|
|
|
'schemaMap' => [
|
|
|
|
'mysql' => SamIT\Yii2\MariaDb\Schema::class
|
2024-06-14 16:23:24 +08:00
|
|
|
],
|
2017-06-30 23:00:32 +08:00
|
|
|
|
|
|
|
// Schema cache options (for production environment)
|
2024-06-14 16:23:24 +08:00
|
|
|
'enableSchemaCache' => true,
|
|
|
|
'schemaCacheDuration' => 60,
|
|
|
|
'schemaCache' => 'cache',
|
2014-01-04 06:28:33 +08:00
|
|
|
];
|