1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12775] Update phpBB/install/database_update.php

PHPBB3-12775
This commit is contained in:
Tristan Darricau
2014-06-27 21:02:20 +02:00
parent f87e76b910
commit e7804ecce4
4 changed files with 347 additions and 323 deletions

View File

@@ -56,8 +56,15 @@ function phpbb_end_update($cache, $config)
}
require($phpbb_root_path . 'includes/startup.' . $phpEx);
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
// Setup class loader first
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
$phpbb_config_php_handler = new \phpbb\config_php($phpbb_root_path, $phpEx);
extract($phpbb_config_php_handler->get_all());
include($phpbb_root_path . 'config.' . $phpEx);
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update.");
@@ -68,11 +75,8 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
// Include files
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
@@ -82,26 +86,12 @@ 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 = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
// Set up container (must be done here because extensions table may not exist)
$container_extensions = array(
new \phpbb\di\extension\config($phpbb_root_path . 'config.' . $phpEx),
new \phpbb\di\extension\core($phpbb_root_path . 'config/'),
);
$container_passes = array(
new \phpbb\di\pass\collection_pass(),
);
$phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx);
// Compile the container
foreach ($container_passes as $pass)
{
$phpbb_container->addCompilerPass($pass);
}
$phpbb_container->compile();
$phpbb_container_factory = new \phpbb\di\container_factory($phpbb_config_php_handler, $phpbb_root_path, $phpEx);
$phpbb_container_factory->set_use_extensions(false);
$phpbb_container_factory->set_use_kernel_pass(false);
$phpbb_container_factory->set_dump_container(false);
$phpbb_container = $phpbb_container_factory->get_container();
// set up caching
$cache = $phpbb_container->get('cache');