} catch (\Exception $e) { //Some fatal error happened freepbx_log(FPBX_LOG_WARNING, $e->getMessage()); $file_exists = false; $zendedbroken[] = $key; } //actualy load module if ((!$restrict_mods_local || $is_selected) && $file_exists) { bootstrap_include_hooks('pre_module_load', $key); require_once $file; bootstrap_include_hooks('post_module_load', $key); } //create an array of module sections to display //stored as [items][$type][$category][$name] = $displayvalue if (isset($module['items']) && is_array($module['items'])) { //if asterisk isnt running, mark moduels that depend on //asterisk as disbaled foreach ($module['items'] as $itemKey => $item) { $needs_edb = isset($item['needsenginedb']) && strtolower($item['needsenginedb']) == 'yes'; $needs_running = isset($item['needsenginerunning']) && strtolower($item['needsenginerunning']) == 'yes'; $needs_astman = $needs_edb || $needs_running; if (!$astman->connected() && $needs_astman) { $active_modules[$key]['items'][$itemKey]['disabled'] = true; } } } } } bootstrap_include_hooks('post_module_load', 'all_mods'); $bootstrap_settings['function_modules_included'] = true; }