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/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(); $container = new ContainerBuilder(); $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/config')); $loader->load('parameters.yml'); $loader->load('services.yml'); $container->setParameter('core.root_path', $phpbb_root_path); $container->setParameter('core.php_ext', $phpEx); // set up caching $cache = $container->get('cache'); $phpbb_class_loader_ext->set_cache($container->get('cache.driver')); $phpbb_class_loader->set_cache($container->get('cache.driver')); // Instantiate some basic classes $phpbb_dispatcher = $container->get('dispatcher'); $request = $container->get('request'); $user = $container->get('user'); $auth = $container->get('auth'); $db = $container->get('dbal.conn'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function // Grab global variables, re-cache if necessary $config = $container->get('config'); set_config(null, null, null, $config); set_config_count(null, null, null, $config); // load extensions $phpbb_extension_manager = $container->get('ext.manager'); $template = $container->get('template'); $style = $container->get('style'); $phpbb_subscriber_loader = $container->get('event.subscriber_loader'); $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 = $container->get('cron.manager'); }