명령 줄에서 실행하는 경우 : php bin/console doctrine : migrations : migrate -n --em = views다른 명령에서 값이 아닌 (InputOption :: VALUE_NONE) 매개 변수와 함께 명령을 호출하려면 어떻게해야합니까?
모든 것이 잘 작동합니다.
그러나 다른 명령에서이 명령을 실행하려고하면 ArrayInput에 InputOption :: VALUE_NONE 매개 변수를 넣는 방법을 모르겠습니다.
private function executeMigrate($connection = null) {
$theCommandStr = 'doctrine:migrations:migrate';
$command = $this->getApplication()->find($theCommandStr) ;
if ($command)
{
$arguments = [];
$arguments['-n'] = null; //<-- THE PROBLEM IS HERE!
$arguments['--em'] = 'views';
$input = new ArrayInput($arguments);
$output = new BufferedOutput();
$returnCode = $command->run($input, $output);
if($returnCode == 0) {
echo "OK";
} else {
echo "KO";
}
}
}
내가 (운없이) 테스트 한 : $ 인수를 [ '- N'] = NULL; $ arguments [ '- n'] = "";
두 옵션을 사용하면 명령이 실행되었지만 -n 수정자가 무시되었습니다.
Symfony v.3.3을 사용하고 있습니다.