diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/InstallCommand.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 491c67f9..1bd76ae3 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -192,6 +192,7 @@ class InstallCommand extends ContainerAwareCommand | |||
192 | $user->setUsername($dialog->ask($this->defaultOutput, '<question>Username</question> <comment>(default: wallabag)</comment> :', 'wallabag')); | 192 | $user->setUsername($dialog->ask($this->defaultOutput, '<question>Username</question> <comment>(default: wallabag)</comment> :', 'wallabag')); |
193 | $user->setPassword($dialog->ask($this->defaultOutput, '<question>Password</question> <comment>(default: wallabag)</comment> :', 'wallabag')); | 193 | $user->setPassword($dialog->ask($this->defaultOutput, '<question>Password</question> <comment>(default: wallabag)</comment> :', 'wallabag')); |
194 | $user->setEmail($dialog->ask($this->defaultOutput, '<question>Email:</question>', '')); | 194 | $user->setEmail($dialog->ask($this->defaultOutput, '<question>Email:</question>', '')); |
195 | $user->setEnabled(true); | ||
195 | 196 | ||
196 | $em->persist($user); | 197 | $em->persist($user); |
197 | 198 | ||
@@ -272,10 +273,11 @@ class InstallCommand extends ContainerAwareCommand | |||
272 | */ | 273 | */ |
273 | private function isDatabasePresent() | 274 | private function isDatabasePresent() |
274 | { | 275 | { |
275 | $databaseName = $this->getContainer()->getParameter('database_name'); | 276 | $connection = $this->getContainer()->get('doctrine')->getManager()->getConnection(); |
277 | $databaseName = $connection->getDatabase(); | ||
276 | 278 | ||
277 | try { | 279 | try { |
278 | $schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager(); | 280 | $schemaManager = $connection->getSchemaManager(); |
279 | } catch (\Exception $exception) { | 281 | } catch (\Exception $exception) { |
280 | if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { | 282 | if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { |
281 | return false; | 283 | return false; |