Improved error handling.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 7 Dec 2010 12:08:19 +0000 (12:08 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 7 Dec 2010 12:08:19 +0000 (12:08 +0000)
admin/inst_module.php
includes/main.inc
includes/session.inc

index e19523f1c314e86bb337eee9b09c4368de9e790b..0e7cb534cf63e97fba7019c96bb31697d6ccd840 100644 (file)
@@ -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;
index 3d94aeb6900d1a85583ece6eef587f33015c96b9..161911c608b512b87559d7e7ff2569b21ae8427d 100644 (file)
@@ -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");
index 5620c78d1af384e68f1e966683808ddc09e616c5..4a50596f14a2f8e2dadea608408990d40c9852bc 100644 (file)
@@ -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();