mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/14039] Use shared language service in the container factory
PHPBB3-14039
This commit is contained in:
@@ -59,6 +59,7 @@ services:
|
||||
installer.helper.container_factory:
|
||||
class: phpbb\install\helper\container_factory
|
||||
arguments:
|
||||
- @language
|
||||
- @request
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@@ -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))
|
||||
{
|
||||
|
Reference in New Issue
Block a user