Add MariaDB container; add PDO connection; add error middleware
This commit is contained in:
parent
114a67dbe4
commit
2bb7ea54a2
6 changed files with 76 additions and 9 deletions
|
|
@ -5,12 +5,27 @@ namespace MailAccountAdmin;
|
|||
|
||||
class Settings
|
||||
{
|
||||
public function isDebugMode(): bool
|
||||
{
|
||||
return getenv('APP_DEBUG') === 'true';
|
||||
}
|
||||
|
||||
public function getTwigSettings(): array
|
||||
{
|
||||
$cacheDir = getenv('TWIG_CACHE_DIR');
|
||||
|
||||
return [
|
||||
'cache' => !empty($cacheDir) ? $cacheDir : false,
|
||||
'cache' => getenv('TWIG_CACHE_DIR') ?: false,
|
||||
'strict_variables' => getenv('TWIG_STRICT') === 'true',
|
||||
];
|
||||
}
|
||||
|
||||
public function getDatabaseSettings(): array
|
||||
{
|
||||
return [
|
||||
'host' => getenv('DB_HOST') ?: 'localhost',
|
||||
'port' => getenv('DB_PORT') ?: 3306,
|
||||
'dbname' => getenv('DB_DATABASE') ?: '',
|
||||
'username' => getenv('DB_USERNAME') ?: '',
|
||||
'password' => getenv('DB_PASSWORD') ?: '',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue