openrat-cms

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

commit 06a9ec2281acb014e016244ab0c760504b0f74bb
parent ec0322965cd75272cff96bdfcc65008de80ef890
Author: dankert <devnull@localhost>
Date:   Sat, 26 Sep 2009 02:21:30 +0200

 SQL, welches beim Verbindungsaufbau ausgeführt wird.

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

diff --git a/db/db.class.php b/db/db.class.php @@ -47,14 +47,14 @@ class DB var $conf; /** - * Kennzeichen, ob die Datenbank verfügbar ist. + * Kennzeichen, ob die Datenbank verf�gbar ist. * * @var Boolean */ var $available; /** - * Enthält eine Fehlermeldung (sofern verfügbar). + * Enth�lt eine Fehlermeldung (sofern verf�gbar). * * @var String */ @@ -93,7 +93,7 @@ class DB */ function connect() { - // Ausführen des Systemkommandos. + // Ausf�hren des Systemkommandos. if ( !empty($this->conf['cmd'])) { $ausgabe = array(); @@ -129,13 +129,28 @@ class DB // $this->error = 'Error while connecting to database.'; } + + // SQL bei Verbindungsaufbau ausführen. + $cmd = $this->conf['connection_sql']; + if ( ! empty($cmd) ) + { + $ok = $this->client->query($cmd); + + if ( ! $ok ) + { + $this->error = $this->client->error; + $this->available = false; + return false; + } + } + $this->available = true; return true; } /** - * Ausführen einer Datenbankanfrage. + * Ausf�hren einer Datenbankanfrage. * * @param String $query * @return Object (Result)