From: Janusz Dobrowolski Date: Tue, 7 Dec 2010 12:08:19 +0000 (+0000) Subject: Improved error handling. X-Git-Tag: v2.4.2~19^2~424 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=1d8ca637beb25da5f36084fdecb6c24dc5d61eab;p=fa-stable.git Improved error handling. --- diff --git a/admin/inst_module.php b/admin/inst_module.php index e19523f1..0e7cb534 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -42,13 +42,14 @@ function local_extension($id) 'active' => false ); - @include_once($path_to_root.'/modules/'.$id.'/hooks.php'); + if (file_exists($path_to_root.'/modules/'.$id.'/hooks.php')) { + include_once($path_to_root.'/modules/'.$id.'/hooks.php'); + } $hooks_class = 'hooks_'.$id; - if (class_exists($hooks_class)) { + if (class_exists($hooks_class, false)) { $hooks = new $hooks_class; $hooks->install_extension(false); } - $Ajax->activate('ext_tbl'); // refresh settings display if (!update_extensions($exts)) return false; diff --git a/includes/main.inc b/includes/main.inc index 3d94aeb6..161911c6 100644 --- a/includes/main.inc +++ b/includes/main.inc @@ -11,7 +11,6 @@ ***********************************************************************/ include_once($path_to_root . "/includes/db/connect_db.inc"); -include_once($path_to_root . "/includes/errors.inc"); include_once($path_to_root . "/includes/types.inc"); include_once($path_to_root . "/includes/systypes.inc"); include_once($path_to_root . "/includes/references.inc"); diff --git a/includes/session.inc b/includes/session.inc index 5620c78d..4a50596f 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -168,6 +168,10 @@ if (!isset($path_to_root)) if (isset($_GET['path_to_root']) || isset($_POST['path_to_root'])) die("Restricted access"); +include_once($path_to_root . "/includes/errors.inc"); +// colect all error msgs +set_error_handler('error_handler' /*, errtypes */); + include_once($path_to_root . "/includes/current_user.inc"); include_once($path_to_root . "/frontaccounting.php"); include_once($path_to_root . "/admin/db/security_db.inc"); @@ -229,9 +233,6 @@ $Refs = new references(); register_shutdown_function('end_flush'); ob_start('output_html',0); -// colect all error msgs -set_error_handler('error_handler' /*, errtypes */); - if (!isset($_SESSION["wa_current_user"])) $_SESSION["wa_current_user"] = new current_user();