X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=1bd76ae36ec9db535b68ce33926d09228a886eec;hb=784bb4c38d4665294108d7de39c85208a6d76001;hp=493842f7959962818fd5127207afa77982a947c3;hpb=164bd801188245942ca996eda75d7a554f29746a;p=github%2Fwallabag%2Fwallabag.git
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 493842f7..1bd76ae3 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);
@@ -225,7 +226,7 @@ class InstallCommand extends ContainerAwareCommand
}
/**
- * Run a command
+ * Run a command.
*
* @param string $command
* @param array $parameters Parameters to this command (usually 'force' => true)
@@ -266,16 +267,17 @@ class InstallCommand extends ContainerAwareCommand
}
/**
- * Check if the database already exists
+ * Check if the database already exists.
*
- * @return boolean
+ * @return bool
*/
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;
@@ -300,9 +302,9 @@ class InstallCommand extends ContainerAwareCommand
/**
* Check if the schema is already created.
- * If we found at least oen table, it means the schema exists
+ * If we found at least oen table, it means the schema exists.
*
- * @return boolean
+ * @return bool
*/
private function isSchemaPresent()
{