Answer the question
In order to leave comments, you need to log in
How to pass an argument to a command received from a DI container when executing symfony?
There are commands to run migrations for different connections, I can’t pass an argument that the confirmation command would not ask for execution:
the command to execute:
->setName('tenant:migration')
tried to do this, it doesn’t help, migrations all ask for confirmation.
$command = $this->getApplication()->find('doctrine:migrations:migrate');
$arguments = [
'-n' => '-n'
];
$greetInput = new ArrayInput($arguments);
$returnCode = $command->run($greetInput, $this->output);
Answer the question
In order to leave comments, you need to log in
$greetInput = new ArrayInput($arguments);
$greetInput->setInteractive(false);
$returnCode = $command->run($greetInput, $this->output);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question