dev/patrick #1

Merged
lukas.uptmoor merged 69 commits from dev/patrick into main 2026-04-20 16:32:31 +02:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit 250ca9909d - Show all commits

View File

@@ -1,5 +1,5 @@
# Example Environment Configfile
POSTGRES_HOST=postgres_host
POSTGRES_HOSTNAME=postgres_host
POSTGRES_PORT=postgres_port
POSTGRES_DB=postgres_database
POSTGRES_USER=postgres_user

View File

@@ -16,8 +16,8 @@ if (file_exists($envFile)) {
}
// Defines Environment Variables
$host = getenv('POSTGRES_HOST');
$port = getenv('POSTGRES_PORT');
$host = getenv('POSTGRES_HOSTNAME');
$port = 5432;
$db = getenv('POSTGRES_DB');
$user = getenv('POSTGRES_USER');
$pass = getenv('POSTGRES_PASSWORD');
@@ -36,6 +36,13 @@ try {
$dsn = "pgsql:host=$host;dbname=$db;port=$port";
$pdo = new PDO($dsn, $user, $pass, $opt);
$pdo = new PDO($dsn, $user, $pass, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
// Creates Error Message
} catch(PDOException $e) {
echo "Error: ".$e->getMessage();