From d33aaac199bf1305d37b49a83b91a1bd014ea6cd Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 12 Nov 2012 16:16:40 -0500 Subject: [ticket/11195] Condense logic, remove improperly formatted if() PHPBB3-11195 --- phpBB/includes/functions_container.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/functions_container.php') diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 1de1d9f7ea..1763d1082a 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -126,11 +126,8 @@ function phpbb_create_dumped_container(array $extensions, array $passes, $phpbb_ function phpbb_create_dumped_container_unless_debug(array $extensions, array $passes, $phpbb_root_path, $php_ext) { - if (defined('DEBUG')) { - return phpbb_create_compiled_container($extensions, $passes, $phpbb_root_path, $php_ext); - } - - return phpbb_create_dumped_container($extensions, $passes, $phpbb_root_path, $php_ext); + $container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; + return $container_factory($extensions, $passes, $phpbb_root_path, $php_ext); } function phpbb_container_filename($phpbb_root_path, $php_ext) -- cgit v1.2.1 From 73ce1a5a976f3f1634e9aeffa8fbe79378870c71 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 15 Nov 2012 01:56:33 +0100 Subject: [ticket/11199] Purge dumped container correctly on cache purge. This patch changes the dumped container suffix to a prefix instead which makes the existing code for purging 'cache/container_*' files work as intended. PHPBB3-11199 --- 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 1763d1082a..9f84511439 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -133,5 +133,5 @@ function phpbb_create_dumped_container_unless_debug(array $extensions, array $pa function phpbb_container_filename($phpbb_root_path, $php_ext) { $filename = str_replace(array('/', '.'), array('slash', 'dot'), $phpbb_root_path); - return $phpbb_root_path . 'cache/' . $filename . '_container.' . $php_ext; + return $phpbb_root_path . 'cache/container_' . $filename . '.' . $php_ext; } -- cgit v1.2.1 From 31843ecd8c5b5d3b95d9d1775213fe22a93c8d2b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 15 Nov 2012 05:00:24 +0100 Subject: [ticket/11200] Make cache available during container construction Fixes fatal errors in the dbal. PHPBB3-11200 --- phpBB/includes/functions_container.php | 5 ++++- 1 file changed, 4 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 1763d1082a..cbd0fe15b0 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -84,8 +84,11 @@ function phpbb_create_compiled_container(array $extensions, array $passes, $phpb $tmp_container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext); $tmp_container->compile(); + $GLOBALS['cache'] = $tmp_container->get('cache'); + $installed_exts = $tmp_container->get('ext.manager')->all_enabled(); + // Now pass the enabled extension paths into the ext compiler extension - $extensions[] = new phpbb_di_extension_ext($tmp_container->get('ext.manager')->all_enabled()); + $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); -- cgit v1.2.1 From f2cffd6a6ce72fd5d3a60c734623ea3c1f051071 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Nov 2012 08:50:04 -0500 Subject: [ticket/11200] Add a reminder comment. PHPBB3-11200 --- phpBB/includes/functions_container.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/includes/functions_container.php') diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index cbd0fe15b0..843207db84 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -84,6 +84,8 @@ function phpbb_create_compiled_container(array $extensions, array $passes, $phpb $tmp_container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext); $tmp_container->compile(); + // XXX stop writing to global $cache when + // http://tracker.phpbb.com/browse/PHPBB3-11203 is fixed $GLOBALS['cache'] = $tmp_container->get('cache'); $installed_exts = $tmp_container->get('ext.manager')->all_enabled(); -- cgit v1.2.1