Improved error handling.
[fa-stable.git] / admin / inst_module.php
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;