commit 6212fda0ea72917cd37bd392e0c15b8e63a1f50b
parent 5437c07e5cba325da0cba43b8d208e161626b036
Author: dankert <devnull@localhost>
Date: Thu, 17 Dec 2009 10:15:42 +0100
Vor Verbindung prüfen, ob Datenbank-Zugriffsklasse vorhanden ist.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/db/db.class.php b/db/db.class.php
@@ -122,6 +122,13 @@ class DB
$type = $this->conf['type'];
$classname = 'db_'.$type;
+ if ( ! class_exists($classname) )
+ {
+ $this->error = 'Database type "'.$type.'" is not available';
+ $this->available = false;
+ return false;
+ }
+
$this->client = & new $classname;
$ok = $this->client->connect( $this->conf );