443) || (!$secure && $server_port <> 80))) { // HTTP HOST can carry a port number... if (strpos($server_name, ':') === false) { $url .= ':' . $server_port; } } $url .= $script_path; header('Location: ' . $url); exit; } // Load Extensions // dl() is deprecated and disabled by default as of PHP 5.3. if (!empty($load_extensions) && function_exists('dl')) { $load_extensions = explode(',', $load_extensions); foreach ($load_extensions as $extension) { @dl(trim($extension)); } } // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); require($phpbb_root_path . 'includes/session.' . $phpEx); require($phpbb_root_path . 'includes/auth.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_content.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Setup class loader first $phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); $phpbb_class_loader_ext->register(); $phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); $phpbb_class_loader->register(); // set up caching $cache_factory = new phpbb_cache_factory($acm_type); $cache = $cache_factory->get_service(); $phpbb_class_loader_ext->set_cache($cache->get_driver()); $phpbb_class_loader->set_cache($cache->get_driver()); // Instantiate some basic classes $phpbb_dispatcher = new phpbb_event_dispatcher(); $request = new phpbb_request(); $user = new user(); $auth = new auth(); $db = new $sql_db(); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function // Connect to DB $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); // We do not need this any longer, unset for safety purposes unset($dbpasswd); // Grab global variables, re-cache if necessary $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); set_config(null, null, null, $config); set_config_count(null, null, null, $config); // load extensions $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver()); $phpbb_template_locator = new phpbb_template_locator(); $phpbb_template_path_provider = new phpbb_template_extension_path_provider($phpbb_extension_manager, new phpbb_template_path_provider()); $template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_template_locator, $phpbb_template_path_provider); $phpbb_subscriber_loader = new phpbb_event_extension_subscriber_loader($phpbb_dispatcher, $phpbb_extension_manager); $phpbb_subscriber_loader->load(); // Add own hook handler require($phpbb_root_path . 'includes/hooks/index.' . $phpEx); $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display'))); foreach ($cache->obtain_hooks() as $hook) { @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); } if (!$config['use_system_cron']) { $cron = new phpbb_cron_manager(new phpbb_cron_task_provider($phpbb_extension_manager), $cache->get_driver()); }