Skip to content

Commit

Permalink
Return Command::SUCCESS or Command::FAILURE
Browse files Browse the repository at this point in the history
  • Loading branch information
back-2-95 committed Feb 16, 2023
1 parent a23a142 commit e8b424c
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Get only settings which are found from the defaults
$dumpSettings = array_intersect_key($dumpSettings, $this->getValidDumpSettings());

if ($input->getOption('display-effective-replacements')) {
// We simply display the gdpr-dump specific settings and exit.
$this->displayEffectiveReplacements($output, $dumpSettings);
} else {
$dumper = new MysqldumpGdpr($dsn, $user, $password, $dumpSettings, $pdoSettings);
$dumper->start($input->getOption('result-file'));
try {
if ($input->getOption('display-effective-replacements')) {
// We simply display the gdpr-dump specific settings and exit.
$this->displayEffectiveReplacements($output, $dumpSettings);
} else {
$dumper = new MysqldumpGdpr($dsn, $user, $password, $dumpSettings, $pdoSettings);
$dumper->start($input->getOption('result-file'));
}
} catch (\Exception $e) {
$output->writeln($e->getMessage());
return Command::FAILURE;
}

return Command::SUCCESS;
}

protected function getDefaults($extraFile): array
Expand Down

0 comments on commit e8b424c

Please sign in to comment.