phpbb_require_updated('includes/functions.' . $phpEx); phpbb_require_updated('includes/functions_content.' . $phpEx, true); phpbb_include_updated('includes/functions_admin.' . $phpEx); phpbb_include_updated('includes/utf/utf_tools.' . $phpEx); 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');
$phpbb_class_loader->register(); $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); extract($phpbb_config_php_file->get_all()); if (!defined('PHPBB_ENVIRONMENT')) { @define('PHPBB_ENVIRONMENT', 'production'); } require $phpbb_root_path . 'includes/constants.' . $phpEx; require $phpbb_root_path . 'includes/functions.' . $phpEx; require $phpbb_root_path . 'includes/functions_admin.' . $phpEx; require $phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx; $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx); $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file); $phpbb_container_builder->without_cache(); $input = new ArgvInput(); if ($input->hasParameterOption(array('--safe-mode'))) { $phpbb_container_builder->without_extensions(); } else { $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); } $phpbb_container = $phpbb_container_builder->get_container(); $phpbb_container->get('request')->enable_super_globals(); require $phpbb_root_path . 'includes/compatibility_globals.' . $phpEx; /* @var $user \phpbb\user */ $user = $phpbb_container->get('user'); $user->add_lang('acp/common'); $user->add_lang('cli'); $lang = $phpbb_container->get('language'); $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang); $application->register_container_commands($phpbb_container->get('console.command_collection')); $application->run($input);