diff --git a/phpbb/di/container_builder.php b/phpbb/di/container_builder.php index 70ceb9b5..966f6b4e 100644 --- a/phpbb/di/container_builder.php +++ b/phpbb/di/container_builder.php @@ -137,9 +137,8 @@ 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) { @@ -153,10 +152,17 @@ 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()),