$user->setUsername($dialog->ask($this->defaultOutput, '<question>Username</question> <comment>(default: wallabag)</comment> :', 'wallabag'));
$user->setPassword($dialog->ask($this->defaultOutput, '<question>Password</question> <comment>(default: wallabag)</comment> :', 'wallabag'));
$user->setEmail($dialog->ask($this->defaultOutput, '<question>Email:</question>', ''));
+ $user->setEnabled(true);
$em->persist($user);
}
/**
- * Run a command
+ * Run a command.
*
* @param string $command
* @param array $parameters Parameters to this command (usually 'force' => true)
}
/**
- * 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;
/**
* 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()
{