From 1dea0286a48b4bac6702aad673e13e281690adfb Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 12 Jul 2013 15:40:49 -0400 Subject: [ticket/11574] Use alternate DI config file for updater PHPBB3-11574 --- phpBB/includes/functions_container.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_container.php') diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 106b7d75cc..d302b75350 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -53,7 +53,10 @@ function phpbb_create_container(array $extensions, $phpbb_root_path, $php_ext) */ function phpbb_create_install_container($phpbb_root_path, $php_ext) { - $core = new phpbb_di_extension_core($phpbb_root_path); + $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'; + + $core = new phpbb_di_extension_core($config_path); $container = phpbb_create_container(array($core), $phpbb_root_path, $php_ext); $container->setParameter('core.root_path', $phpbb_root_path); @@ -175,7 +178,7 @@ function phpbb_create_default_container($phpbb_root_path, $php_ext) return phpbb_create_dumped_container_unless_debug( array( new phpbb_di_extension_config($phpbb_root_path . 'config.' . $php_ext), - new phpbb_di_extension_core($phpbb_root_path), + new phpbb_di_extension_core($phpbb_root_path . 'config'), ), array( new phpbb_di_pass_collection_pass(), -- cgit v1.2.1 From d6de892ee40579c45259f8c68ba7eef26accc08b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 13 Jul 2013 16:47:15 -0400 Subject: [ticket/11574] Fix various path issues in the updater PHPBB3-11574 --- phpBB/includes/functions_container.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_container.php') diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index d302b75350..923a8f370b 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -53,7 +53,7 @@ function phpbb_create_container(array $extensions, $phpbb_root_path, $php_ext) */ function phpbb_create_install_container($phpbb_root_path, $php_ext) { - $other_config_path = $phpbb_root_path . 'install/update/new/config'; + $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'; $core = new phpbb_di_extension_core($config_path); @@ -73,6 +73,30 @@ function phpbb_create_install_container($phpbb_root_path, $php_ext) return $container; } +/** +* Create updater container +* +* @param string $phpbb_root_path Root path +* @param string $php_ext PHP Extension +* @param array $config_path Path to config directory +* @return ContainerBuilder object (compiled) +*/ +function phpbb_create_update_container($phpbb_root_path, $php_ext, $config_path) +{ + return phpbb_create_compiled_container( + array( + new phpbb_di_extension_config($phpbb_root_path . 'config.' . $php_ext), + new phpbb_di_extension_core($config_path), + ), + array( + new phpbb_di_pass_collection_pass(), + new phpbb_di_pass_kernel_pass(), + ), + $phpbb_root_path, + $php_ext + ); +} + /** * Create a compiled ContainerBuilder object * -- cgit v1.2.1 From e6e2a50062eca8b640822b8f616ea4bb23b23566 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 14 Jul 2013 01:28:49 -0400 Subject: [ticket/11574] Add trailing slash for consistency PHPBB3-11574 --- phpBB/includes/functions_container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_container.php') diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 923a8f370b..e22fa9919a 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -54,7 +54,7 @@ function phpbb_create_container(array $extensions, $phpbb_root_path, $php_ext) function phpbb_create_install_container($phpbb_root_path, $php_ext) { $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'; + $config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/'; $core = new phpbb_di_extension_core($config_path); $container = phpbb_create_container(array($core), $phpbb_root_path, $php_ext); -- cgit v1.2.1 From 8928240dc3fefd42d8e98132451e2de92ff7cbec Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 14 Jul 2013 15:40:09 -0400 Subject: [ticket/11574] Fix more issues in the updater * Stupid mistake in phpbb_create_update_container * Do not bootstrap extensions in installer/updater * Fix template lookup in installer/updater * Do not attempt to delete posts from bots The latter is a really fun problem. Since deleting posts now depends on a new db column that does not exist yet, we cannot call delete_post from a migration, ever. By using retain, we can hack around the issue for now. PHPBB3-11574 --- phpBB/includes/functions_container.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/functions_container.php') diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 5c6bd6dd8a..7cbfa17a0e 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -148,9 +148,11 @@ function phpbb_create_install_container($phpbb_root_path, $php_ext) */ function phpbb_create_update_container($phpbb_root_path, $php_ext, $config_path) { + $config_file = $phpbb_root_path . 'config.' . $php_ext; return phpbb_create_compiled_container( + $config_file, array( - new phpbb_di_extension_config($phpbb_root_path . 'config.' . $php_ext), + new phpbb_di_extension_config($config_file), new phpbb_di_extension_core($config_path), ), array( @@ -173,11 +175,6 @@ function phpbb_create_update_container($phpbb_root_path, $php_ext, $config_path) */ function phpbb_create_compiled_container($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext) { - $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path); - - // Now pass the enabled extension paths into the ext compiler extension - $extensions[] = new phpbb_di_extension_ext($installed_exts); - // Create the final container to be compiled and cached $container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext); @@ -258,11 +255,14 @@ function phpbb_create_dumped_container_unless_debug($config_file, array $extensi function phpbb_create_default_container($phpbb_root_path, $php_ext) { $config_file = $phpbb_root_path . 'config.' . $php_ext; + $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path); + return phpbb_create_dumped_container_unless_debug( $config_file, array( new phpbb_di_extension_config($config_file), new phpbb_di_extension_core($phpbb_root_path . 'config'), + new phpbb_di_extension_ext($installed_exts), ), array( new phpbb_di_pass_collection_pass(), -- cgit v1.2.1