diff options
author | Mate Bartus <mate.bartus@gmail.com> | 2015-10-18 17:31:12 +0200 |
---|---|---|
committer | Mate Bartus <mate.bartus@gmail.com> | 2015-10-18 17:31:12 +0200 |
commit | 29908e54bcdf734150371fded932d04042580505 (patch) | |
tree | 0ec9fd81e5fbbdf115770cdf3372440ca96269f3 | |
parent | dd8580632765c051ea68b877ce608ca69b5655fe (diff) | |
download | forums-29908e54bcdf734150371fded932d04042580505.tar forums-29908e54bcdf734150371fded932d04042580505.tar.gz forums-29908e54bcdf734150371fded932d04042580505.tar.bz2 forums-29908e54bcdf734150371fded932d04042580505.tar.xz forums-29908e54bcdf734150371fded932d04042580505.zip |
[ticket/14039] Use shared language service in the container factory
PHPBB3-14039
-rw-r--r-- | phpBB/config/installer/container/services_installer.yml | 1 | ||||
-rw-r--r-- | phpBB/phpbb/install/helper/container_factory.php | 20 |
2 files changed, 17 insertions, 4 deletions
diff --git a/phpBB/config/installer/container/services_installer.yml b/phpBB/config/installer/container/services_installer.yml index 0072402d3c..939dd225b9 100644 --- a/phpBB/config/installer/container/services_installer.yml +++ b/phpBB/config/installer/container/services_installer.yml @@ -59,6 +59,7 @@ services: installer.helper.container_factory: class: phpbb\install\helper\container_factory arguments: + - @language - @request - %core.root_path% - %core.php_ext% diff --git a/phpBB/phpbb/install/helper/container_factory.php b/phpBB/phpbb/install/helper/container_factory.php index 8c007de39f..efbe278628 100644 --- a/phpBB/phpbb/install/helper/container_factory.php +++ b/phpBB/phpbb/install/helper/container_factory.php @@ -15,10 +15,17 @@ namespace phpbb\install\helper; use phpbb\cache\driver\dummy; use phpbb\install\exception\cannot_build_container_exception; +use phpbb\language\language; +use phpbb\request\request; class container_factory { /** + * @var language + */ + protected $language; + + /** * @var string */ protected $phpbb_root_path; @@ -43,12 +50,14 @@ class container_factory /** * Constructor * - * @param \phpbb\request\request $request Request interface - * @param string $phpbb_root_path Path to phpBB's root - * @param string $php_ext Extension of PHP files + * @param language $language Language service + * @param request $request Request interface + * @param string $phpbb_root_path Path to phpBB's root + * @param string $php_ext Extension of PHP files */ - public function __construct(\phpbb\request\request $request, $phpbb_root_path, $php_ext) + public function __construct(language $language, request $request, $phpbb_root_path, $php_ext) { + $this->language = $language; $this->request = $request; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; @@ -150,6 +159,9 @@ class container_factory $this->container->register('request')->setSynthetic(true); $this->container->set('request', $this->request); + $this->container->register('language')->setSynthetic(true); + $this->container->set('language', $this->language); + // Replace cache service, as config gets cached, and we don't want that when we are installing if (!is_dir($other_config_path)) { |