Generalize the use of killme()

- Add fail condition to q()
This commit is contained in:
Hypolite Petovan 2017-05-12 00:05:06 -04:00
parent 381e68edc7
commit 2cabf7f37b
3 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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();

View File

@ -9,7 +9,6 @@ use \Closure;
*/
class View
{
exit;
#TODO: Replace this with better code.
protected $layout;