]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Check selected PDO driver on install 1832/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 1 Apr 2016 14:44:50 +0000 (16:44 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 1 Apr 2016 14:44:51 +0000 (16:44 +0200)
Instead of checking that one of the DB driver is installed we retrieve the selected driver (in parameters) and see if the extension exists.

src/Wallabag/CoreBundle/Command/InstallCommand.php

index 7c3d1c523f95fdd2f41451355e43cef131b3f8eb..6665f4b5b7d503ad9cab5eb81ea1bd2da3995673 100644 (file)
@@ -73,13 +73,14 @@ class InstallCommand extends ContainerAwareCommand
 
         $fulfilled = true;
 
-        $label = '<comment>PDO Drivers</comment>';
+        $label = '<comment>PDO Driver</comment>';
         $status = '<info>OK!</info>';
         $help = '';
-        if (!(extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql'))) {
+
+        if (!extension_loaded($this->getContainer()->getParameter('database_driver'))) {
             $fulfilled = false;
             $status = '<error>ERROR!</error>';
-            $help = 'Needs one of sqlite, mysql or pgsql PDO drivers';
+            $help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.';
         }
 
         $rows = [];