diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 15:41:40 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 15:41:40 +0200 |
commit | c217e77f2540085922b4483c99670eca06923799 (patch) | |
tree | 0476b8eb54b666e28905978b8cb3b00a73bd18b0 /Db.php | |
parent | 1038b52baf3e67c024527eb27f7493d9cbcae438 (diff) | |
download | main-c217e77f2540085922b4483c99670eca06923799.tar.gz main-c217e77f2540085922b4483c99670eca06923799.tar.bz2 main-c217e77f2540085922b4483c99670eca06923799.zip |
Bug fixes
Diffstat (limited to 'Db.php')
-rw-r--r-- | Db.php | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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); } |