mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 15:05:43 +02:00
[ticket/13740] Use language service in console application
PHPBB3-13740
This commit is contained in:
parent
fc46dec813
commit
be7e1ba7a0
phpBB
@ -68,7 +68,8 @@ require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
|||||||
$user = $phpbb_container->get('user');
|
$user = $phpbb_container->get('user');
|
||||||
$user->add_lang('acp/common');
|
$user->add_lang('acp/common');
|
||||||
$user->add_lang('cli');
|
$user->add_lang('cli');
|
||||||
|
$lang = $phpbb_container->get('language');
|
||||||
|
|
||||||
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
|
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang);
|
||||||
$application->register_container_commands($phpbb_container->get('console.command_collection'));
|
$application->register_container_commands($phpbb_container->get('console.command_collection'));
|
||||||
$application->run($input);
|
$application->run($input);
|
||||||
|
@ -26,18 +26,18 @@ class application extends \Symfony\Component\Console\Application
|
|||||||
protected $in_shell = false;
|
protected $in_shell = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \phpbb\user User object
|
* @var \phpbb\language\language User object
|
||||||
*/
|
*/
|
||||||
protected $user;
|
protected $language;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name The name of the application
|
* @param string $name The name of the application
|
||||||
* @param string $version The version of the application
|
* @param string $version The version of the application
|
||||||
* @param \phpbb\user $user The user which runs the application (used for translation)
|
* @param \phpbb\language\language $language The user which runs the application (used for translation)
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $version, $user)
|
public function __construct($name, $version, \phpbb\language\language $language)
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
$this->language = $language;
|
||||||
|
|
||||||
parent::__construct($name, $version);
|
parent::__construct($name, $version);
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ class application extends \Symfony\Component\Console\Application
|
|||||||
'safe-mode',
|
'safe-mode',
|
||||||
null,
|
null,
|
||||||
InputOption::VALUE_NONE,
|
InputOption::VALUE_NONE,
|
||||||
$this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
|
$this->language->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
|
||||||
));
|
));
|
||||||
|
|
||||||
return $input_definition;
|
return $input_definition;
|
||||||
@ -80,7 +80,7 @@ class application extends \Symfony\Component\Console\Application
|
|||||||
'--shell',
|
'--shell',
|
||||||
'-s',
|
'-s',
|
||||||
InputOption::VALUE_NONE,
|
InputOption::VALUE_NONE,
|
||||||
$this->user->lang('CLI_DESCRIPTION_OPTION_SHELL')
|
$this->language->lang('CLI_DESCRIPTION_OPTION_SHELL')
|
||||||
));
|
));
|
||||||
|
|
||||||
return parent::getHelp();
|
return parent::getHelp();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user