mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12685] Inject console.command_collection instead of the container
PHPBB3-12685
This commit is contained in:
parent
a54f1275d0
commit
15136e4f8e
2 changed files with 4 additions and 4 deletions
|
@ -58,5 +58,5 @@ $user = $phpbb_container->get('user');
|
||||||
$user->add_lang('acp/common');
|
$user->add_lang('acp/common');
|
||||||
|
|
||||||
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
|
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
|
||||||
$application->register_container_commands($phpbb_container);
|
$application->register_container_commands($phpbb_container->get('console.command_collection'));
|
||||||
$application->run($input);
|
$application->run($input);
|
||||||
|
|
|
@ -80,11 +80,11 @@ class application extends \Symfony\Component\Console\Application
|
||||||
/**
|
/**
|
||||||
* Register a set of commands from the container
|
* Register a set of commands from the container
|
||||||
*
|
*
|
||||||
* @param ContainerInterface $container The container
|
* @param \phpbb\di\service_collection $command_collection The console service collection
|
||||||
*/
|
*/
|
||||||
public function register_container_commands(ContainerInterface $container)
|
public function register_container_commands(\phpbb\di\service_collection $command_collection)
|
||||||
{
|
{
|
||||||
foreach ($container->get('console.command_collection') as $service_command)
|
foreach ($command_collection as $service_command)
|
||||||
{
|
{
|
||||||
$this->add($service_command);
|
$this->add($service_command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue