From 40ec07fbb1cca4e7b5dc385939495ed7481784e7 Mon Sep 17 00:00:00 2001 From: Angelo Sleebos Date: Mon, 7 Apr 2025 01:11:17 +0200 Subject: [PATCH] Make environment variables compatible for other platforms Make environment variables compatible for other platforms --- src/config/environment.php | 41 +++++++++++--------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/src/config/environment.php b/src/config/environment.php index add1fc3..007d3af 100644 --- a/src/config/environment.php +++ b/src/config/environment.php @@ -1,35 +1,18 @@ https://api.qrserver.com/v1/create-qr-code/?data= // internal-chillerlan.qrcode => https://github.com/chillerlan/php-qrcode -} -/* -|-------------------------------------------------------------------------- -| INSTALLATION WITHOUT CONTAINER -|-------------------------------------------------------------------------- - */ +define('DATABASE_HOST', getenv('DATABASE_HOST') ?: 'localhost'); +define('DATABASE_PORT', filter_var(getenv('DATABASE_PORT'), FILTER_VALIDATE_INT) ?: 3306); +define('DATABASE_NAME', getenv('DATABASE_NAME') ?: 'qrcode'); +define('DATABASE_USER', getenv('DATABASE_USER') ?: 'root'); +define('DATABASE_PASSWORD', getenv('DATABASE_PASSWORD') ?: 'root'); +define('DATABASE_PREFIX', getenv('DATABASE_PREFIX') !== false ? getenv('DATABASE_PREFIX') : 'qr_'); +define('DATABASE_CHARSET', getenv('DATABASE_CHARSET') ?: 'utf8'); -?> +define('TYPE', getenv('TYPE') ?: 'local'); +define('BASE_URL', getenv('BASE_URL') ?: 'http://localhost'); +define('QRCODE_GENERATOR', getenv('QRCODE_GENERATOR') ?: 'external-api.qrserver.com'); // opties: external-api.qrserver.com of internal-chillerlan.qrcode