{
$this->defaultOutput->writeln('<info><comment>Step 1 of 5.</comment> Checking system requirements.</info>');
- $fulfilled = true;
+ $rows = [];
+ // testing if database driver exists
+ $fulfilled = true;
$label = '<comment>PDO Driver</comment>';
$status = '<info>OK!</info>';
$help = '';
$help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.';
}
- $rows = [];
+ $rows[] = [$label, $status, $help];
+
+ // testing if connection to the database can be etablished
+ $label = '<comment>Database connection</comment>';
+ $status = '<info>OK!</info>';
+ $help = '';
+
+ try {
+ $this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
+ } catch (\Exception $e) {
+ $fulfilled = false;
+ $status = '<error>ERROR!</error>';
+ $help = 'Can\'t connect to the database: '.$e->getMessage();
+ }
+
$rows[] = [$label, $status, $help];
foreach ($this->functionExists as $functionRequired) {