diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-10-24 15:27:34 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-11-07 14:15:33 +0100 |
commit | 54a2241e136ccf90c659b5699af4489b6e4d2da1 (patch) | |
tree | 59abd47c5d132e29e893aca08a66dfa98a234372 /src/Wallabag | |
parent | 4529d0f4b6b20cbbd1ccb5339a753aff7d35552b (diff) | |
download | wallabag-54a2241e136ccf90c659b5699af4489b6e4d2da1.tar.gz wallabag-54a2241e136ccf90c659b5699af4489b6e4d2da1.tar.zst wallabag-54a2241e136ccf90c659b5699af4489b6e4d2da1.zip |
Fix database already exist detection
This is not the same message exception from MySQL & SQLite with Postgres.
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 808baaf6..865a73e1 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -283,10 +283,16 @@ class InstallCommand extends ContainerAwareCommand | |||
283 | try { | 283 | try { |
284 | $schemaManager = $connection->getSchemaManager(); | 284 | $schemaManager = $connection->getSchemaManager(); |
285 | } catch (\Exception $exception) { | 285 | } catch (\Exception $exception) { |
286 | // mysql & sqlite | ||
286 | if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { | 287 | if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { |
287 | return false; | 288 | return false; |
288 | } | 289 | } |
289 | 290 | ||
291 | // pgsql | ||
292 | if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) { | ||
293 | return false; | ||
294 | } | ||
295 | |||
290 | throw $exception; | 296 | throw $exception; |
291 | } | 297 | } |
292 | 298 | ||