X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=50d0dfff49b56adefe139d929d90fb709712f8f2;hb=001a7bad66fd1ce2b208abfe89177e72b5e1baa5;hp=813ac720de0c9d53c4a42c35d7bc49a76f2d2d48;hpb=f2e5fdc3666a2a6525b4202ab48df05efeebaf5c;p=github%2Fwallabag%2Fwallabag.git
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 813ac720..50d0dfff 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -72,8 +72,10 @@ class InstallCommand extends ContainerAwareCommand
{
$this->defaultOutput->writeln('Step 1 of 5. Checking system requirements.');
- $fulfilled = true;
+ $rows = [];
+ // testing if database driver exists
+ $fulfilled = true;
$label = 'PDO Driver';
$status = 'OK!';
$help = '';
@@ -84,7 +86,21 @@ class InstallCommand extends ContainerAwareCommand
$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 = 'Database connection';
+ $status = 'OK!';
+ $help = '';
+
+ try {
+ $this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
+ } catch (\Exception $e) {
+ $fulfilled = false;
+ $status = 'ERROR!';
+ $help = 'Can\'t connect to the database: '.$e->getMessage();
+ }
+
$rows[] = [$label, $status, $help];
foreach ($this->functionExists as $functionRequired) {