From ec04a9bd831b4cdc9fbf6041b2532ff3bf458383 Mon Sep 17 00:00:00 2001 From: rylon Date: Wed, 15 Oct 2014 01:09:42 +0200 Subject: [PATCH] Errormessage fix for Connections, since they might be written to db - could result in loop --- db/connection/Connection.php | 2 +- db/connection/ConnectionMYS.php | 4 ++-- db/connection/ConnectionPG.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/connection/Connection.php b/db/connection/Connection.php index fc4e869..b6bf43c 100644 --- a/db/connection/Connection.php +++ b/db/connection/Connection.php @@ -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');} diff --git a/db/connection/ConnectionMYS.php b/db/connection/ConnectionMYS.php index 2dc4bc1..8cb69af 100644 --- a/db/connection/ConnectionMYS.php +++ b/db/connection/ConnectionMYS.php @@ -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(){ diff --git a/db/connection/ConnectionPG.php b/db/connection/ConnectionPG.php index aaa0e73..58190f3 100644 --- a/db/connection/ConnectionPG.php +++ b/db/connection/ConnectionPG.php @@ -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(){}