From cdb252faaa3bc1c28a04b41c7df4112d75ff58c6 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Thu, 27 Feb 2020 14:54:00 +0100 Subject: [PATCH] [ticket/16368] Container isFresh check order PHPBB3-16368 --- phpBB/phpbb/di/container_builder.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php index 70ceb9b5e3..1884e41f15 100644 --- a/phpBB/phpbb/di/container_builder.php +++ b/phpBB/phpbb/di/container_builder.php @@ -137,13 +137,14 @@ class container_builder { try { - $container_filename = $this->get_container_filename(); - $config_cache = new ConfigCache($container_filename, defined('DEBUG')); - if ($this->use_cache && $config_cache->isFresh()) + $build_container = true; + + if ($this->use_cache) { if ($this->use_extensions) { $autoload_cache = new ConfigCache($this->get_autoload_filename(), defined('DEBUG')); + if (!$autoload_cache->isFresh()) { // autoload cache should be refreshed @@ -153,10 +154,18 @@ class container_builder require($this->get_autoload_filename()); } - require($config_cache->getPath()); - $this->container = new \phpbb_cache_container(); + $container_filename = $this->get_container_filename(); + $config_cache = new ConfigCache($container_filename, defined('DEBUG')); + + if ($config_cache->isFresh()) + { + require($config_cache->getPath()); + $this->container = new \phpbb_cache_container(); + $build_container = false; + } } - else + + if ($build_container) { $this->container_extensions = [ new extension\core($this->get_config_path()),