diff options
author | Jeremy <jeremy.benoist@gmail.com> | 2015-02-22 17:18:54 +0100 |
---|---|---|
committer | Jeremy <jeremy.benoist@gmail.com> | 2015-02-22 17:18:54 +0100 |
commit | 732c2ad8971f427ec196acfac53dad034cefdef4 (patch) | |
tree | 70bf2b4c305dfa5171849f7fca5b2b0501062f4e | |
parent | 0bf99bb144561525a34a50315b95efd6f543fe35 (diff) | |
download | wallabag-732c2ad8971f427ec196acfac53dad034cefdef4.tar.gz wallabag-732c2ad8971f427ec196acfac53dad034cefdef4.tar.zst wallabag-732c2ad8971f427ec196acfac53dad034cefdef4.zip |
sqlite doesn't support getListDatabasesSQL
-rw-r--r-- | app/config/parameters.yml.dist | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 11 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 258a585f..44969750 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist | |||
@@ -6,7 +6,7 @@ parameters: | |||
6 | database_name: symfony | 6 | database_name: symfony |
7 | database_user: root | 7 | database_user: root |
8 | database_password: ~ | 8 | database_password: ~ |
9 | database_path: "%kernel.root_dir%/../data/db/poche.sqlite" | 9 | database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" |
10 | 10 | ||
11 | mailer_transport: smtp | 11 | mailer_transport: smtp |
12 | mailer_host: 127.0.0.1 | 12 | mailer_host: 127.0.0.1 |
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 | |||
283 | throw $exception; | 283 | throw $exception; |
284 | } | 284 | } |
285 | 285 | ||
286 | // custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite | ||
287 | if ('sqlite' == $schemaManager->getDatabasePlatform()->getName()) { | ||
288 | $params = $this->getContainer()->get('doctrine.dbal.default_connection')->getParams(); | ||
289 | |||
290 | if (isset($params['path']) && file_exists($params['path'])) { | ||
291 | return true; | ||
292 | } | ||
293 | |||
294 | return false; | ||
295 | } | ||
296 | |||
286 | return in_array($databaseName, $schemaManager->listDatabases()); | 297 | return in_array($databaseName, $schemaManager->listDatabases()); |
287 | } | 298 | } |
288 | 299 | ||
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 | |||
50 | 50 | ||
51 | $tester = new CommandTester($command); | 51 | $tester = new CommandTester($command); |
52 | $tester->execute(array( | 52 | $tester->execute(array( |
53 | 'command' => $command->getName() | 53 | 'command' => $command->getName(), |
54 | )); | 54 | )); |
55 | 55 | ||
56 | $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay()); | 56 | $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay()); |