addArgument('datei', InputArgument::REQUIRED, 'Die Zip-Datei des Pakets.') ->addOption('mit-benutzern', null, InputOption::VALUE_NONE, 'Konten und Passwörter aus dem Paket übernehmen.') ->addOption('ja', null, InputOption::VALUE_NONE, 'Ohne Rückfrage ersetzen.'); } protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $file = (string) $input->getArgument('datei'); if (!$input->getOption('ja') && !$io->confirm('Die Inhalte dieser Installation werden ersetzt (vorher wird gesichert). Weiter?', false)) { return Command::FAILURE; } $result = $this->packages->import($file, (bool) $input->getOption('mit-benutzern')); foreach ($result['steps'] as $step) { $io->writeln(sprintf('%s %s: %s', $step['ok'] ? 'ok ' : 'FEHLER', $step['step'], $step['detail'])); } return $result['ok'] ? Command::SUCCESS : Command::FAILURE; } }