mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/14039] Use shared language service in the container factory
PHPBB3-14039
This commit is contained in:
parent
dd85806327
commit
29908e54bc
2 changed files with 17 additions and 4 deletions
|
@ -59,6 +59,7 @@ services:
|
||||||
installer.helper.container_factory:
|
installer.helper.container_factory:
|
||||||
class: phpbb\install\helper\container_factory
|
class: phpbb\install\helper\container_factory
|
||||||
arguments:
|
arguments:
|
||||||
|
- @language
|
||||||
- @request
|
- @request
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- %core.php_ext%
|
- %core.php_ext%
|
||||||
|
|
|
@ -15,9 +15,16 @@ namespace phpbb\install\helper;
|
||||||
|
|
||||||
use phpbb\cache\driver\dummy;
|
use phpbb\cache\driver\dummy;
|
||||||
use phpbb\install\exception\cannot_build_container_exception;
|
use phpbb\install\exception\cannot_build_container_exception;
|
||||||
|
use phpbb\language\language;
|
||||||
|
use phpbb\request\request;
|
||||||
|
|
||||||
class container_factory
|
class container_factory
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var language
|
||||||
|
*/
|
||||||
|
protected $language;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -43,12 +50,14 @@ class container_factory
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\request\request $request Request interface
|
* @param language $language Language service
|
||||||
* @param string $phpbb_root_path Path to phpBB's root
|
* @param request $request Request interface
|
||||||
* @param string $php_ext Extension of PHP files
|
* @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->request = $request;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
@ -150,6 +159,9 @@ class container_factory
|
||||||
$this->container->register('request')->setSynthetic(true);
|
$this->container->register('request')->setSynthetic(true);
|
||||||
$this->container->set('request', $this->request);
|
$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
|
// Replace cache service, as config gets cached, and we don't want that when we are installing
|
||||||
if (!is_dir($other_config_path))
|
if (!is_dir($other_config_path))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue