asdasd
This commit is contained in:
30
custom/apps/boersenchecker/config/module.php
Normal file
30
custom/apps/boersenchecker/config/module.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\ConfigLoader;
|
||||
|
||||
$projectRoot = dirname(__DIR__, 3);
|
||||
$baseDb = ConfigLoader::load($projectRoot, 'base_db');
|
||||
$baseDbConfig = (bool) ($baseDb['enabled'] ?? false) && is_array($baseDb['db'] ?? null)
|
||||
? $baseDb['db']
|
||||
: ConfigLoader::load($projectRoot, 'db_settings_basic');
|
||||
|
||||
return [
|
||||
'use_separate_db' => filter_var(getenv('BOERSENCHECKER_USE_SEPARATE_DB') ?: 'false', FILTER_VALIDATE_BOOL),
|
||||
'db' => [
|
||||
'driver' => getenv('BOERSENCHECKER_DB_DRIVER') ?: (string) ($baseDbConfig['driver'] ?? 'pgsql'),
|
||||
'host' => getenv('BOERSENCHECKER_DB_HOST') ?: (string) ($baseDbConfig['host'] ?? 'localhost'),
|
||||
'port' => (int) (getenv('BOERSENCHECKER_DB_PORT') ?: (int) ($baseDbConfig['port'] ?? 5432)),
|
||||
'dbname' => getenv('BOERSENCHECKER_DB_NAME') ?: (string) ($baseDbConfig['dbname'] ?? ''),
|
||||
'schema' => getenv('BOERSENCHECKER_DB_SCHEMA') ?: (string) ($baseDbConfig['schema'] ?? 'public'),
|
||||
'user' => getenv('BOERSENCHECKER_DB_USER') ?: (string) ($baseDbConfig['user'] ?? ''),
|
||||
'password' => getenv('BOERSENCHECKER_DB_PASSWORD') ?: (string) ($baseDbConfig['password'] ?? ''),
|
||||
],
|
||||
'report_currency' => getenv('BOERSENCHECKER_REPORT_CURRENCY') ?: 'EUR',
|
||||
'fx_max_age_hours' => (float) (getenv('BOERSENCHECKER_FX_MAX_AGE_HOURS') ?: 6),
|
||||
'alpha_vantage_api_key' => getenv('BOERSENCHECKER_ALPHA_VANTAGE_API_KEY') ?: (getenv('ALPHA_VANTAGE_API_KEY') ?: ''),
|
||||
'alpha_vantage_timeout_sec' => (int) (getenv('BOERSENCHECKER_ALPHA_VANTAGE_TIMEOUT_SEC') ?: 12),
|
||||
'alpha_vantage_min_interval_minutes' => (int) (getenv('BOERSENCHECKER_ALPHA_VANTAGE_MIN_INTERVAL_MINUTES') ?: 60),
|
||||
'auto_refresh_quotes_enabled' => filter_var(getenv('BOERSENCHECKER_AUTO_REFRESH_QUOTES_ENABLED') ?: 'false', FILTER_VALIDATE_BOOL),
|
||||
'auto_refresh_quotes_interval_hours' => (int) (getenv('BOERSENCHECKER_AUTO_REFRESH_QUOTES_INTERVAL_HOURS') ?: 6),
|
||||
];
|
||||
Reference in New Issue
Block a user