From 98e7acc5292221bd1ad232ba6e6cf0ce0f6323f0 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 24 Jun 2012 00:27:53 +0100 Subject: [PATCH] let database class handle transactions, index.php need not know about database->db --- index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index e8e6323c..662637a6 100644 --- a/index.php +++ b/index.php @@ -75,7 +75,6 @@ try { ctx_log_start("Connecting to DB"); // connect to the database $database = new Database(); - $database->db->beginTransaction(); $config = new DatabaseConfig($database); ctx_log_endok(); @@ -102,11 +101,11 @@ try { // saving cache data and profiling data to disk can happen later if(function_exists("fastcgi_finish_request")) fastcgi_finish_request(); - $database->db->commit(); + $database->commit(); ctx_log_endok(); } catch(Exception $e) { - if($database && $database->db) $database->db->rollback(); + if($database) $database->rollback(); _fatal_error($e); ctx_log_ender(); }