openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 78096751d4cccb1c0a3f0d59ab6ef96179053b20
parent c068e3b2c805cd95789d4f6cb263c0ed19d25eed
Author: Jan Dankert <devnull@localhost>
Date:   Wed,  8 Nov 2017 23:46:50 +0100

Fehlerhandling bei der Datenbankverbindung mit Exceptions

Diffstat:
db/Database.class.php | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/db/Database.class.php b/db/Database.class.php @@ -84,14 +84,15 @@ class DB { global $conf; - $this->conf = $dbconf + $conf['database']['defaults']; // linksstehender Operator hat Priorität! + $this->conf = $dbconf + $conf['database-default']['defaults']; // linksstehender Operator hat Priorität! if ( $admin ) { // Bevorzugung der Unter-Konfiguration 'update' if ( isset($this->conf['update']) ) $this->conf = $this->conf['update'] + $this->conf; // linksstehender Operator hat Priorität! - } + } + $this->connect(); } @@ -126,9 +127,8 @@ class DB if ( ! class_exists($classname) ) { - $this->error = 'Database type "'.$type.'" is not available'; $this->available = false; - return false; + throw new OpenRatException( 'ERROR_DATABASE_CONNECTION','Database type "'.$type.'" is not available'); } // Client instanziieren