Errormessage fix for Connections, since they might be written to db - could result in loop

This commit is contained in:
Ulf Gebhardt 2014-10-15 01:09:42 +02:00
parent a9cf661f4d
commit ec04a9bd83
3 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ class Connection extends ConnectionAbstr{
$this->connection = new \SYSTEM\DB\ConnectionPG($dbinfo);
} else if ($dbinfo instanceof \SYSTEM\DB\DBInfoMYS){
$this->connection = new \SYSTEM\DB\ConnectionMYS($dbinfo);
} else if ($dbinfo instanceof \SYSTEM\DB\DBInfoAMQP){
} else if ($dbinfo instanceof \SYSTEM\DB\DBInfoAMQP){
$this->connection = new \SYSTEM\DB\ConnectionAMQP($dbinfo);
} else {
throw new \Exception('Could not understand Database Settings. Check ur Database Settings');}

View File

@ -11,11 +11,11 @@ class ConnectionMYS extends ConnectionAbstr {
$this->connection = @mysqli_connect($dbinfo->m_host, $dbinfo->m_user, $dbinfo->m_password, $new_link, $client_flag);
if(!$this->connection){
throw new \SYSTEM\LOG\ERROR('Could not connect to Database. Check ur Database Settings');}
throw new \Exception('Could not connect to Database. Check ur Database Settings');}
if(!mysqli_select_db($this->connection, $dbinfo->m_database)){
mysqli_close($this->connection);
throw new \SYSTEM\LOG\ERROR('Could not select Database. Check ur Database Settings: '.mysqli_error($this->connection));}
throw new \Exception('Could not select Database. Check ur Database Settings: '.mysqli_error($this->connection));}
}
public function __destruct(){

View File

@ -13,7 +13,7 @@ class ConnectionPG extends ConnectionAbstr {
$this->connection = pg_connect("host=".$dbinfo->m_host." port=".$dbinfo->m_port." dbname=".$dbinfo->m_database."
user=".$dbinfo->m_user." password=".$dbinfo->m_password."");
if(!$this->connection){
throw new \SYSTEM\LOG\ERROR('Could not connect to Database. Check ur Database Settings');}
throw new \Exception('Could not connect to Database. Check ur Database Settings');}
}
public function __destruct(){}