aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php20
1 files changed, 18 insertions, 2 deletions
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
72 { 72 {
73 $this->defaultOutput->writeln('<info><comment>Step 1 of 5.</comment> Checking system requirements.</info>'); 73 $this->defaultOutput->writeln('<info><comment>Step 1 of 5.</comment> Checking system requirements.</info>');
74 74
75 $fulfilled = true; 75 $rows = [];
76 76
77 // testing if database driver exists
78 $fulfilled = true;
77 $label = '<comment>PDO Driver</comment>'; 79 $label = '<comment>PDO Driver</comment>';
78 $status = '<info>OK!</info>'; 80 $status = '<info>OK!</info>';
79 $help = ''; 81 $help = '';
@@ -84,7 +86,21 @@ class InstallCommand extends ContainerAwareCommand
84 $help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.'; 86 $help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.';
85 } 87 }
86 88
87 $rows = []; 89 $rows[] = [$label, $status, $help];
90
91 // testing if connection to the database can be etablished
92 $label = '<comment>Database connection</comment>';
93 $status = '<info>OK!</info>';
94 $help = '';
95
96 try {
97 $this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
98 } catch (\Exception $e) {
99 $fulfilled = false;
100 $status = '<error>ERROR!</error>';
101 $help = 'Can\'t connect to the database: '.$e->getMessage();
102 }
103
88 $rows[] = [$label, $status, $help]; 104 $rows[] = [$label, $status, $help];
89 105
90 foreach ($this->functionExists as $functionRequired) { 106 foreach ($this->functionExists as $functionRequired) {