[ticket/14039] Use shared language service in the container factory

PHPBB3-14039
This commit is contained in:
Mate Bartus 2015-10-18 17:31:12 +02:00
parent dd85806327
commit 29908e54bc
2 changed files with 17 additions and 4 deletions

View file

@ -59,6 +59,7 @@ services:
installer.helper.container_factory:
class: phpbb\install\helper\container_factory
arguments:
- @language
- @request
- %core.root_path%
- %core.php_ext%

View file

@ -15,9 +15,16 @@ 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
*/
@ -43,12 +50,14 @@ class container_factory
/**
* Constructor
*
* @param \phpbb\request\request $request Request interface
* @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))
{