From bf26d7b44035722f21b6af13c098f1bb2720eb63 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 24 Jun 2021 01:57:39 +0200 Subject: Set Database attribute in Application class --- core/namespace/Application.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'core/namespace') diff --git a/core/namespace/Application.php b/core/namespace/Application.php index 1597801..3cecf3b 100644 --- a/core/namespace/Application.php +++ b/core/namespace/Application.php @@ -44,7 +44,19 @@ class Application { $username = self::get('DATABASE.USERNAME'); $password = self::get('DATABASE.PASSWORD'); - self::$Database = new Database($hostname, $basename, $username, $password); + $Database = new Database($hostname, $basename, $username, $password); + + $Database->setAttribute( + $Database::ATTR_DEFAULT_FETCH_MODE, + $Database::FETCH_ASSOC + ); + + $Database->setAttribute( + $Database::ATTR_ERRMODE, + $Database::ERRMODE_EXCEPTION + ); + + self::$Database = $Database; } return self::$Database; -- cgit v1.2.3