From a1691859ca0cb4c1b360c34b05aa74bdba9e582a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 18 Aug 2015 11:08:45 +0200 Subject: implement FosUser --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag/CoreBundle/Command') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 491c67f9..29d91109 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -192,6 +192,7 @@ class InstallCommand extends ContainerAwareCommand $user->setUsername($dialog->ask($this->defaultOutput, 'Username (default: wallabag) :', 'wallabag')); $user->setPassword($dialog->ask($this->defaultOutput, 'Password (default: wallabag) :', 'wallabag')); $user->setEmail($dialog->ask($this->defaultOutput, 'Email:', '')); + $user->setEnabled(true); $em->persist($user); -- cgit v1.2.3 From af43bd37675954f937720f7b6fbcf78d85928bc5 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 11 Sep 2015 16:13:59 +0200 Subject: Fix tests Ensure that created use during install command will always be unique. We assume that the install command must be run to initialize a wallabag instance. NEVER to add more user. Also, use a better way to retrieve the real name of the database and not the one defined in parameters.yml (which isn't the same for test envi because the dbname isn't defined in parameters.yml but directly in config_test.yml) --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle/Command') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 29d91109..1bd76ae3 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -273,10 +273,11 @@ class InstallCommand extends ContainerAwareCommand */ private function isDatabasePresent() { - $databaseName = $this->getContainer()->getParameter('database_name'); + $connection = $this->getContainer()->get('doctrine')->getManager()->getConnection(); + $databaseName = $connection->getDatabase(); try { - $schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager(); + $schemaManager = $connection->getSchemaManager(); } catch (\Exception $exception) { if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { return false; -- cgit v1.2.3