Skip to content

Commit 6e9358a

Browse files
committed
feature #10257 [FrameworkBundle][Console] Load command from DIC after command from bundles. (lyrixx)
This PR was merged into the 2.5-dev branch. Discussion ---------- [FrameworkBundle][Console] Load command from DIC after command from bundles. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - 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 } **Note**: This is not a new feature... It could be very cool to have it for symfony 2.4 ;) Commits ------- 34f4ef5 [FrameworkBundle][Console] Load command from DIC after command from bundles.
2 parents 3e8f33a + 34f4ef5 commit 6e9358a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy