Fixing ensure-production-settings task to not throw an exception and instead use the Output object to output an error
This commit is contained in:
parent
0f4ba3b875
commit
10aaf93c44
@ -65,12 +65,21 @@ EOT
|
|||||||
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
|
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
|
||||||
{
|
{
|
||||||
$em = $this->getHelper('em')->getEntityManager();
|
$em = $this->getHelper('em')->getEntityManager();
|
||||||
$em->getConfiguration()->ensureProductionSettings();
|
|
||||||
|
|
||||||
if ($input->getOption('complete') !== null) {
|
$error = false;
|
||||||
$em->getConnection()->connect();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user