From c217e77f2540085922b4483c99670eca06923799 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 26 Oct 2009 15:41:40 +0200 Subject: Bug fixes --- Db.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Db.php') diff --git a/Db.php b/Db.php index f72ba4b..4e5fe8a 100644 --- a/Db.php +++ b/Db.php @@ -22,8 +22,7 @@ class Db { $c = App::conf(); - if (!self::$instance) - { + if (!self::$instance) { try { self::$instance = new PDO( "{$c['db.driver']}:host={$c['db.host']};dbname={$c['db.name']}", @@ -47,7 +46,7 @@ class Db */ public function __clone() { - trigger_error("Hello, ich name was Singleton. Cloning is not allowed", E_USER_ERROR); + trigger_error("Cloning not work is", E_USER_ERROR); } /** @@ -72,13 +71,12 @@ class Db if (!$result) { $e = $stmt->errorInfo(); - exit(App::error($e[2])); + App::error($e[2]); } } catch (PDOException $e) { $error = $e->getMessage() . $sql; - App::log($error); - exit(App::error($error)); + App::error($error); } // Select statements need the query results @@ -96,7 +94,7 @@ class Db public function fetch($sql, $data = null) { - $stmt = DB::query($sql, $data); + $stmt = self::query($sql, $data); return $stmt->fetchAll(PDO::FETCH_ASSOC); } -- cgit v1.2.3