Exemple #1
0
phpbb_require_updated('includes/functions_install.' . $phpEx);
// Setup class loader first
$phpbb_class_loader_new = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx);
$phpbb_class_loader_new->register();
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
// Set up container
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
$phpbb_container_builder->without_extensions()->without_cache()->without_compiled_container();
$other_config_path = $phpbb_root_path . 'install/update/new/config/';
$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/';
$phpbb_container_builder->with_config_path($config_path);
$phpbb_container_builder->with_custom_parameters(array('core.root_path' => $phpbb_root_path, 'core.adm_relative_path' => $phpbb_adm_relative_path, 'core.php_ext' => $phpEx, 'core.table_prefix' => '', 'cache.driver.class' => 'phpbb\\cache\\driver\\file'));
$phpbb_container = $phpbb_container_builder->get_container();
$phpbb_container->register('dbal.conn.driver')->setSynthetic(true);
$phpbb_container->register('template.twig.environment')->setSynthetic(true);
$phpbb_container->register('language.loader')->setSynthetic(true);
$phpbb_container->compile();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
/* @var $request \phpbb\request\request_interface */
$request = $phpbb_container->get('request');
// Try and load an appropriate language if required
$language = basename($request->variable('language', ''));
if ($request->header('Accept-Language') && !$language) {
    $accept_lang_ary = explode(',', strtolower($request->header('Accept-Language')));