From 7b44e2c791b6655380b673cf98150f48f5795d39 Mon Sep 17 00:00:00 2001 From: Andrii Afanasiev Date: Fri, 15 Jun 2018 08:35:59 +0200 Subject: [PATCH] [ticket/15678] Fix build and cache flow for container 1. During procedure of building container we have to check both required files in cache: container_* and autoload_*. This files should be "fresh" and if one of the does not exist then we have to build it and put into a cache one more time. 2. Fix typo 'posic_getuid' does not exist, so $php_uid is alwasy was false. PHPBB3-15678 --- phpBB/phpbb/di/container_builder.php | 7 +++++++ phpBB/phpbb/filesystem/filesystem.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php index ac1a1a1733..8c1ce8bde2 100644 --- a/phpBB/phpbb/di/container_builder.php +++ b/phpBB/phpbb/di/container_builder.php @@ -143,6 +143,13 @@ class container_builder { if ($this->use_extensions) { + $autoload_cache = new ConfigCache($this->get_autoload_filename(), defined('DEBUG')); + if (!$autoload_cache->isFresh()) + { + // autoload cache should be refreshed + $this->load_extensions(); + } + require($this->get_autoload_filename()); } diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php index 3f39448f05..bfafdf5ddd 100644 --- a/phpBB/phpbb/filesystem/filesystem.php +++ b/phpBB/phpbb/filesystem/filesystem.php @@ -367,7 +367,7 @@ class filesystem implements filesystem_interface $common_php_group = @filegroup(__FILE__); // And the owner and the groups PHP is running under. - $php_uid = (function_exists('posic_getuid')) ? @posix_getuid() : false; + $php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false; $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false; // If we are unable to get owner/group, then do not try to set them by guessing