diff --git a/include/dba.php b/include/dba.php index 705676f0..89f141d8 100644 --- a/include/dba.php +++ b/include/dba.php @@ -137,12 +137,16 @@ function q($sql) $args = func_get_args(); unset($args[0]); + $ret = null; + if ($db) { $ret = $db->q(vsprintf($sql, $args)); if ($db->db->errno) { logger('dba: ' . $db->db->error); } + } else { + error_log(__FILE__ . ':' . __LINE__ . ' $db has gone'); } return $ret; diff --git a/index.php b/index.php index 857424b9..082f0c0e 100644 --- a/index.php +++ b/index.php @@ -75,6 +75,8 @@ if ($a->module_loaded) { if ((!$a->error) && (function_exists($a->module . '_content'))) { $func = $a->module . '_content'; $a->page['content'] = $func($a); + + killme(); } } @@ -113,7 +115,4 @@ $template = 'view/' require_once $template; -session_write_close(); - - -exit; +killme(); diff --git a/src/Rendering/View.php b/src/Rendering/View.php index eae0f6fa..9d7e9862 100644 --- a/src/Rendering/View.php +++ b/src/Rendering/View.php @@ -9,7 +9,6 @@ use \Closure; */ class View { - exit; #TODO: Replace this with better code. protected $layout;