]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Command/InstallCommand.php
Add tests
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Command / InstallCommand.php
index a528c3098275a6ec59a22d60a61acbfccfa994d5..bba2607d05ae6c5ffd80585dbe268d2d97ffd98f 100644 (file)
@@ -198,6 +198,7 @@ class InstallCommand extends ContainerAwareCommand
         $config = new Config($user);
         $config->setTheme($this->getContainer()->getParameter('theme'));
         $config->setItemsPerPage($this->getContainer()->getParameter('items_on_page'));
+        $config->setRssLimit($this->getContainer()->getParameter('rss_limit'));
         $config->setLanguage($this->getContainer()->getParameter('language'));
 
         $em->persist($config);
@@ -283,6 +284,17 @@ class InstallCommand extends ContainerAwareCommand
             throw $exception;
         }
 
+        // custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
+        if ('sqlite' == $schemaManager->getDatabasePlatform()->getName()) {
+            $params = $this->getContainer()->get('doctrine.dbal.default_connection')->getParams();
+
+            if (isset($params['path']) && file_exists($params['path'])) {
+                return true;
+            }
+
+            return false;
+        }
+
         return in_array($databaseName, $schemaManager->listDatabases());
     }