From 732c2ad8971f427ec196acfac53dad034cefdef4 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 22 Feb 2015 17:18:54 +0100 Subject: sqlite doesn't support getListDatabasesSQL --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 11 +++++++++++ src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index a528c309..ac7583ea 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -283,6 +283,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()); } diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php index 6bcc9707..a091d66f 100644 --- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php +++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php @@ -50,7 +50,7 @@ class InstallCommandTest extends WallabagTestCase $tester = new CommandTester($command); $tester->execute(array( - 'command' => $command->getName() + 'command' => $command->getName(), )); $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay()); -- cgit v1.2.3