This commit is contained in:
2026-03-02 22:07:39 +01:00
parent 6232afdc4e
commit e819673015
2 changed files with 12 additions and 3 deletions

View File

@@ -5,4 +5,4 @@
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY); define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
define('APP_API_BASE', 'https://api.' . APP_DOMAIN_PRIMARY); define('APP_API_BASE', 'https://api.' . APP_DOMAIN_PRIMARY);
define('APP_DB_ENABLED', true); // set true to enable DB connection define('APP_DB_ENABLED', true); // set true to enable DB connection
define('APP_DB_DEBUG', true);

View File

@@ -45,9 +45,18 @@ final class Database
return $pdo; return $pdo;
} catch (\PDOException $e) { } catch (\PDOException $e) {
// In Prod würdest du loggen; hier minimal
http_response_code(500); http_response_code(500);
echo 'Database connection error.';
$env = defined('APP_ENV') ? APP_ENV : 'prod';
$dbDebug = defined('APP_DB_DEBUG') && APP_DB_DEBUG;
$details = 'Database connection error.';
if ($env !== 'prod' || $dbDebug) {
$details .= ' ' . $e->getMessage();
}
error_log('[DB] ' . $e->getMessage());
echo $details;
exit; exit;
} }
} }