mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Огромный рефакторинг в пользу отказа от механизма environment и использования .env файла
Найдено и удалено немного мусора
This commit is contained in:
1
common/config/.gitignore
vendored
1
common/config/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
main-local.php
|
||||
params-local.php
|
||||
|
43
common/config/config-loader.php
Normal file
43
common/config/config-loader.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
$rootPath = __DIR__ . '/../..';
|
||||
|
||||
$toMerge = [
|
||||
require __DIR__ . '/main.php',
|
||||
];
|
||||
|
||||
// Общие окружение-зависимые настройки
|
||||
$path = __DIR__ . '/common-' . YII_ENV . '.php';
|
||||
if (file_exists($path)) {
|
||||
$toMerge[] = require $path;
|
||||
}
|
||||
|
||||
// Общие локальные настройки
|
||||
$path = __DIR__ . '/common-local.php';
|
||||
if (file_exists($path)) {
|
||||
$toMerge[] = require $path;
|
||||
}
|
||||
|
||||
// Настройки конкретного приложения
|
||||
$path = $rootPath . '/' . YII_APPLICATION_MODULE . '/config/main.php';
|
||||
if (file_exists($path)) {
|
||||
$toMerge[] = require $path;
|
||||
}
|
||||
|
||||
// Настройки конкретного приложения для действующего окружения
|
||||
$path = $rootPath . '/' . YII_APPLICATION_MODULE . '/config/main-' . YII_ENV . '.php';
|
||||
if (file_exists($path)) {
|
||||
$toMerge[] = require $path;
|
||||
}
|
||||
|
||||
// Локальные настройки конкретного приложения
|
||||
$path = $rootPath . '/' . YII_APPLICATION_MODULE . '/config/main-local.php';
|
||||
if (file_exists($path)) {
|
||||
$toMerge[] = require $path;
|
||||
}
|
||||
|
||||
// не оставляем глобальных переменных, ну кроме $toMerge, хех
|
||||
unset($path, $rootPath);
|
||||
|
||||
return ArrayHelper::merge(...$toMerge);
|
8
common/config/main-dev.php
Normal file
8
common/config/main-dev.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
return [
|
||||
'components' => [
|
||||
'mailer' => [
|
||||
'useFileTransport' => true,
|
||||
],
|
||||
],
|
||||
];
|
@@ -8,6 +8,9 @@ return [
|
||||
],
|
||||
'db' => [
|
||||
'class' => yii\db\Connection::class,
|
||||
'dsn' => 'mysql:host=db;dbname=' . getenv('MYSQL_DATABASE'),
|
||||
'username' => getenv('MYSQL_USER'),
|
||||
'password' => getenv('MYSQL_PASSWORD'),
|
||||
'charset' => 'utf8',
|
||||
],
|
||||
'mailer' => [
|
||||
@@ -19,12 +22,21 @@ return [
|
||||
],
|
||||
'redis' => [
|
||||
'class' => yii\redis\Connection::class,
|
||||
'hostname' => 'redis',
|
||||
'password' => null,
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
],
|
||||
'amqp' => [
|
||||
'class' => \common\components\RabbitMQ\Component::class,
|
||||
'class' => common\components\RabbitMQ\Component::class,
|
||||
'host' => 'rabbitmq',
|
||||
'port' => 5672,
|
||||
'user' => getenv('RABBITMQ_DEFAULT_USER'),
|
||||
'password' => getenv('RABBITMQ_DEFAULT_PASS'),
|
||||
'vhost' => getenv('RABBITMQ_DEFAULT_VHOST'),
|
||||
],
|
||||
'guzzle' => [
|
||||
'class' => \GuzzleHttp\Client::class,
|
||||
'class' => GuzzleHttp\Client::class,
|
||||
],
|
||||
],
|
||||
'aliases' => [
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
'supportEmail' => 'support@example.com',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'fromEmail' => 'account@ely.by',
|
||||
'supportEmail' => 'support@ely.by',
|
||||
];
|
||||
|
Reference in New Issue
Block a user