-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DI injection for commands? #46
Comments
You can use inject methods or |
Perfect, thanks! |
So.. solved? :) |
maybe this tip in doc would be fine, |
Agreed |
@fprochazka One more thing, If I want to run command with injects annotations in other command using procedure from Symfony documentation $container = $this->getHelper('container')->getContainer();
$command = $container->getByType('Kdyby\Console\Application')
->find('pair:productsToFilters'); I need to run $container->callInjects($command); by hand, injects aren't called in find. I also need to run this: $arguments = [
'command' => 'pair:productsToFilters',
'--email' => $input->getOption('email'),
];
$pairProductsToFiltersInput = new ArrayInput($arguments);
$command->run($pairProductsToFiltersInput, $output); It would be nice to have shorter in $this->getHelper('command')
->find('pair:productsToFilters') // inject are already called in this stage
->run($arguments, $output); |
@foxycode that is wrong, you should run other commands using the |
Nebyl by tady nějaký injecting? Toto DI není úplně ok ne? od doby co global context je fuj?
The text was updated successfully, but these errors were encountered: