From b8a5fde84629cdc4885016b76c90d9836c4f65b0 Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 5 Sep 2008 01:24:01 +0000 Subject: - better management of fatal errors (instead of die or trigger_error rather use fatal_error ...) git-svn-id: http://piwigo.org/svn/trunk@2502 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_html.inc.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'include/functions_html.inc.php') diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index ff03675b1..ca07a1e16 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -650,6 +650,44 @@ function page_not_found($msg, $alternate_url=null) 5 ); } +/** + * exits the current script with 500 http code + * this method can be called at any time (does not use template/language/user etc...) + * @param string msg a message to display + */ +function fatal_error($msg) +{ + $btrace_msg = ''; + if (function_exists('debug_backtrace')) + { + $bt = debug_backtrace(); + for ($i=1; $i