From d30a9cb4971f261e33a4814cc94c8fd218afda91 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sun, 13 Jan 2013 13:23:42 -0600 Subject: [feature/migrations] Automatically populate migrations table on install PHPBB3-9737 --- phpBB/install/install_install.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/install/install_install.php') diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 1ab9caee0a..e0eb9e4472 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -114,6 +114,7 @@ class install_install extends module $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); $this->disable_avatars_if_unwritable(); + $this->populate_migrations($phpbb_container, $phpbb_root_path); // Remove the lock file @unlink($phpbb_root_path . 'cache/install_lock'); @@ -1880,6 +1881,12 @@ class install_install extends module } } + function populate_migrations($container, $phpbb_root_path) + { + $migrator = $container->get('migrator'); + $migrator->populate_migrations_from_directory($phpbb_root_path . 'includes/db/migration/data/'); + } + /** * Generate a list of available mail server authentication methods */ -- cgit v1.2.1 From 7a8ae493009eac3d4f5c97279f0be6e10c588002 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Mon, 25 Feb 2013 13:12:32 -0600 Subject: [feature/migrations] Inject migrator rather than the container. Some docblocks PHBB3-9737 --- phpBB/install/install_install.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'phpBB/install/install_install.php') diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index e0eb9e4472..a99de9bec9 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -114,7 +114,7 @@ class install_install extends module $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); $this->disable_avatars_if_unwritable(); - $this->populate_migrations($phpbb_container, $phpbb_root_path); + $this->populate_migrations($phpbb_container->get('migrator'), $phpbb_root_path); // Remove the lock file @unlink($phpbb_root_path . 'cache/install_lock'); @@ -1881,9 +1881,18 @@ class install_install extends module } } - function populate_migrations($container, $phpbb_root_path) + /** + * 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_db_migrator $migrator + * @param string $phpbb_root_path + */ + function populate_migrations($migrator, $phpbb_root_path) { - $migrator = $container->get('migrator'); $migrator->populate_migrations_from_directory($phpbb_root_path . 'includes/db/migration/data/'); } -- cgit v1.2.1