Agregar métodos para obtener la configuración de la base de datos y el nivel de registro

This commit is contained in:
David Vargas 2024-11-10 03:08:11 -06:00
parent 49999c964f
commit 50bde319a7

View File

@ -11,4 +11,21 @@ class Config
$dotenv = Dotenv::createImmutable(__DIR__ . '/../../../'); $dotenv = Dotenv::createImmutable(__DIR__ . '/../../../');
$dotenv->load(); $dotenv->load();
} }
public static function getDatabaseConfig(): array
{
return [
'database_type' => getenv('DB_TYPE'),
'database_name' => getenv('DB_NAME'),
'server' => getenv('DB_HOST'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASS'),
'port' => getenv('DB_PORT')
];
}
public static function getLogLevel(): string
{
return getenv('LOG_LEVEL') ?: 'info';
}
} }