[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 }
This commit is contained in:
Grégoire Pineau 2014-02-13 15:09:55 +01:00
parent f828aee7f7
commit 34f4ef5297

View File

@ -100,16 +100,16 @@ class Application extends BaseApplication
{
$container = $this->kernel->getContainer();
if ($container->hasParameter('console.command.ids')) {
foreach ($container->getParameter('console.command.ids') as $id) {
$this->add($container->get($id));
}
}
foreach ($this->kernel->getBundles() as $bundle) {
if ($bundle instanceof Bundle) {
$bundle->registerCommands($this);
}
}
if ($container->hasParameter('console.command.ids')) {
foreach ($container->getParameter('console.command.ids') as $id) {
$this->add($container->get($id));
}
}
}
}