Add MariaDB container; add PDO connection; add error middleware

This commit is contained in:
Lexi / Zoe 2021-07-26 23:14:14 +02:00
parent 114a67dbe4
commit 2bb7ea54a2
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
6 changed files with 76 additions and 9 deletions

View file

@ -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') ?: '',
];
}
}