aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-27 21:02:20 +0200
committerTristan Darricau <github@nicofuma.fr>2014-07-07 01:02:19 +0200
commite7804ecce4511d8befdcc28f6705c3589c47c878 (patch)
treeaed1533f8280d78fffd5c8502b0bd26ccb073a16 /phpBB/install/database_update.php
parentf87e76b9109fa4da3d4c78f191cfd8889f1da1bb (diff)
downloadforums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar
forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar.gz
forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar.bz2
forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar.xz
forums-e7804ecce4511d8befdcc28f6705c3589c47c878.zip
[ticket/12775] Update phpBB/install/database_update.php
PHPBB3-12775
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php36
1 files changed, 13 insertions, 23 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 63e4e8f4ac..481f52de65 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -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');