diff --git a/src/Command/Database/DumpCommand.php b/src/Command/Database/DumpCommand.php index 4650838db..e40d9ac08 100644 --- a/src/Command/Database/DumpCommand.php +++ b/src/Command/Database/DumpCommand.php @@ -204,43 +204,36 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->getIo()->commentBlock($command); } - try { - $process = new Process($command); - $process->setTimeout(null); - $process->setWorkingDirectory($this->appRoot); - $process->run(); - - if($process->isSuccessful()) { - $resultFile = $file; - if ($gz) { - if (substr($file, -3) != '.gz') { - $resultFile = $file . '.gz'; - } - file_put_contents( - $resultFile, - gzencode( - file_get_contents( - $file - ) - ) - ); - if ($resultFile != $file) { - unlink($file); - } - } - $this->getIo()->success( - sprintf( - '%s %s', - $this->trans('commands.database.dump.messages.success'), - $resultFile + $process = new Process($command); + $process->setTimeout(null); + $process->setWorkingDirectory($this->appRoot); + $process->mustRun(); + + $resultFile = $file; + if ($gz) { + if (substr($file, -3) != '.gz') { + $resultFile = $file . '.gz'; + } + file_put_contents( + $resultFile, + gzencode( + file_get_contents( + $file ) - ); + ) + ); + if ($resultFile != $file) { + unlink($file); } - - return 0; - } catch (\Exception $e) { - return 1; } + + $this->getIo()->success( + sprintf( + '%s %s', + $this->trans('commands.database.dump.messages.success'), + $resultFile + ) + ); } }