aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/install_install.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r--phpBB/install/install_install.php43
1 files changed, 36 insertions, 7 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 14f6ca30fb..67e368e34d 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -52,12 +52,13 @@ class install_install extends module
function main($mode, $sub)
{
- global $lang, $template, $language, $phpbb_root_path, $cache;
+ global $lang, $template, $language, $phpbb_root_path, $phpEx;
+ global $phpbb_container, $cache, $phpbb_log;
switch ($sub)
{
case 'intro':
- $cache->purge();
+ $phpbb_container->get('cache.driver')->purge();
$this->page_title = $lang['SUB_INTRO'];
@@ -101,12 +102,20 @@ class install_install extends module
break;
case 'final':
+ // Create a normal container now
+ $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+
+ // Sets the global variables
+ $cache = $phpbb_container->get('cache');
+ $phpbb_log = $phpbb_container->get('log');
+
$this->build_search_index($mode, $sub);
$this->add_modules($mode, $sub);
$this->add_language($mode, $sub);
$this->add_bots($mode, $sub);
$this->email_admin($mode, $sub);
$this->disable_avatars_if_unwritable();
+ $this->populate_migrations($phpbb_container->get('ext.manager'), $phpbb_container->get('migrator'));
// Remove the lock file
@unlink($phpbb_root_path . 'cache/install_lock');
@@ -1449,12 +1458,12 @@ class install_install extends module
*/
function add_modules($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config;
+ global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config, $phpbb_container;
// modules require an extension manager
if (empty($phpbb_extension_manager))
{
- $phpbb_extension_manager = new phpbb_extension_manager($db, $config, EXT_TABLE, $phpbb_root_path, ".$phpEx");
+ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
}
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
@@ -1807,7 +1816,7 @@ class install_install extends module
*/
function email_admin($mode, $sub)
{
- global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpEx;
+ global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$this->page_title = $lang['STAGE_FINAL'];
@@ -1854,7 +1863,7 @@ class install_install extends module
'TITLE' => $lang['INSTALL_CONGRATS'],
'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=convert&language=' . $data['language']), '../docs/README.html'),
'L_SUBMIT' => $lang['INSTALL_LOGIN'],
- 'U_ACTION' => append_sid($phpbb_root_path . 'adm/index.' . $phpEx, 'i=send_statistics&mode=send_statistics'),
+ 'U_ACTION' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=send_statistics&mode=send_statistics'),
));
}
@@ -1874,6 +1883,26 @@ class install_install extends module
}
/**
+ * Populate migrations for the installation
+ *
+ * This "installs" all migrations from (root path)/includes/db/migrations/data.
+ * "installs" means it adds all migrations to the migrations table, but does not
+ * perform any of the actions in the migrations.
+ *
+ * @param phpbb_extension_manager $extension_manager
+ * @param phpbb_db_migrator $migrator
+ */
+ function populate_migrations($extension_manager, $migrator)
+ {
+ $finder = $extension_manager->get_finder();
+
+ $migrations = $finder
+ ->core_path('includes/db/migration/data/')
+ ->get_classes();
+ $migrator->populate_migrations($migrations);
+ }
+
+ /**
* Generate a list of available mail server authentication methods
*/
function mail_auth_select($selected_method)
@@ -2091,7 +2120,7 @@ class install_install extends module
),
'ACP_CAT_CUSTOMISE' => array(
'ACP_STYLE_MANAGEMENT',
- 'ACP_EXTENSIONS_MANAGEMENT',
+ 'ACP_EXTENSION_MANAGEMENT',
'ACP_LANGUAGE',
),
'ACP_CAT_MAINTENANCE' => array(