function main($mode, $sub) { global $lang, $template, $language, $src_root_path, $phpEx; global $src_container, $cache, $src_log, $request, $src_config_php_file; switch ($sub) { case 'intro': $src_container->get('cache.driver')->purge(); $this->page_title = $lang['SUB_INTRO']; $template->assign_vars(array('TITLE' => $lang['INSTALL_INTRO'], 'BODY' => $lang['INSTALL_INTRO_BODY'], 'L_SUBMIT' => $lang['NEXT_STEP'], 'S_LANG_SELECT' => '<select id="language" name="language">' . $this->p_master->inst_language_select($language) . '</select>', 'U_ACTION' => $this->p_master->module_url . "?mode={$mode}&sub=requirements&language={$language}")); break; case 'requirements': $this->check_server_requirements($mode, $sub); break; case 'database': $this->obtain_database_settings($mode, $sub); break; case 'administrator': $this->obtain_admin_settings($mode, $sub); break; case 'config_file': $this->create_config_file($mode, $sub); break; case 'advanced': $this->obtain_advanced_settings($mode, $sub); break; case 'create_table': $this->load_schema($mode, $sub); break; case 'final': // Enable super globals to prevent issues with the new \src\request\request object $request->enable_super_globals(); // Create a normal container now $src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx); $src_container = $src_container_builder->get_container(); // Sets the global variables $cache = $src_container->get('cache'); $src_log = $src_container->get('log'); $this->build_search_index($mode, $sub); $this->add_modules($mode, $sub); $this->add_language($mode, $sub); $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); $this->disable_avatars_if_unwritable(); $this->populate_migrations($src_container->get('ext.manager'), $src_container->get('migrator')); // Remove the lock file @unlink($src_root_path . 'cache/install_lock'); break; } $this->tpl_name = 'install_install'; }
$src_adm_relative_path = isset($src_adm_relative_path) ? $src_adm_relative_path : 'adm/'; $src_admin_path = defined('src_ADMIN_PATH') ? src_ADMIN_PATH : $src_root_path . $src_adm_relative_path; // Include files require $src_root_path . 'includes/functions.' . $phpEx; require $src_root_path . 'includes/functions_content.' . $phpEx; include $src_root_path . 'includes/functions_compatibility.' . $phpEx; require $src_root_path . 'includes/constants.' . $phpEx; require $src_root_path . 'includes/utf/utf_tools.' . $phpEx; // Set PHP error handler to ours set_error_handler(defined('src_MSG_HANDLER') ? src_MSG_HANDLER : 'msg_handler'); $src_class_loader_ext = new \src\class_loader('\\', "{$src_root_path}ext/", $phpEx); $src_class_loader_ext->register(); src_load_extensions_autoloaders($src_root_path); // Set up container $src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx); $src_container = $src_container_builder->get_container(); $src_class_loader->set_cache($src_container->get('cache.driver')); $src_class_loader_ext->set_cache($src_container->get('cache.driver')); require $src_root_path . 'includes/compatibility_globals.' . $phpEx; // Add own hook handler require $src_root_path . 'includes/hooks/index.' . $phpEx; $src_hook = new src_hook(array('exit_handler', 'src_user_session_handler', 'append_sid', array('template', 'display'))); $src_hook_finder = $src_container->get('hook_finder'); foreach ($src_hook_finder->find() as $hook) { @(include $src_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); } /** * Main event which is triggered on every page * * You can use this event to load function files and initiate objects *