Skip to content

Commit 34f4ef5

Browse files
committed
[FrameworkBundle][Console] Load command from DIC after command from bundles.
It's better to load a command from DIC after other one. Because it allow easy override of default (symfony/assetic/doctrine) command. The end user could do: # config.yml services: assetic.command.dump: class: SensioLabs\Shim\Assetic\DumpCommand tags: - { name: console.command }
1 parent f828aee commit 34f4ef5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ protected function registerCommands()
100100
{
101101
$container = $this->kernel->getContainer();
102102

103-
if ($container->hasParameter('console.command.ids')) {
104-
foreach ($container->getParameter('console.command.ids') as $id) {
105-
$this->add($container->get($id));
106-
}
107-
}
108-
109103
foreach ($this->kernel->getBundles() as $bundle) {
110104
if ($bundle instanceof Bundle) {
111105
$bundle->registerCommands($this);
112106
}
113107
}
108+
109+
if ($container->hasParameter('console.command.ids')) {
110+
foreach ($container->getParameter('console.command.ids') as $id) {
111+
$this->add($container->get($id));
112+
}
113+
}
114114
}
115115
}

0 commit comments

Comments
 (0)