Commit 10aaf93c authored by Jonathan H. Wage's avatar Jonathan H. Wage

Fixing ensure-production-settings task to not throw an exception and instead...

Fixing ensure-production-settings task to not throw an exception and instead use the Output object to output an error
parent 0f4ba3b8
......@@ -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('<error>' . $e->getMessage() . '</error>');
}
$output->write('Environment is correctly configured for production.');
if ($error === false) {
$output->write('<info>Environment is correctly configured for production.</info>' . PHP_EOL);
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment