From 10aaf93c4488466810da58fcc346360d3fa61eba Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Tue, 13 Apr 2010 14:12:13 -0400 Subject: [PATCH] Fixing ensure-production-settings task to not throw an exception and instead use the Output object to output an error --- .../Command/EnsureProductionSettingsCommand.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php index 44cdd5688..7c33174f5 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php @@ -65,12 +65,21 @@ EOT protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { $em = $this->getHelper('em')->getEntityManager(); - $em->getConfiguration()->ensureProductionSettings(); - if ($input->getOption('complete') !== null) { - $em->getConnection()->connect(); + $error = false; + try { + $em->getConfiguration()->ensureProductionSettings(); + + if ($input->getOption('complete') !== null) { + $em->getConnection()->connect(); + } + } catch (\Exception $e) { + $error = true; + $output->writeln('' . $e->getMessage() . ''); } - $output->write('Environment is correctly configured for production.'); + if ($error === false) { + $output->write('Environment is correctly configured for production.' . PHP_EOL); + } } } \ No newline at end of file