upgraded FosUserBundle and Symfony 4.3 (#1005)

This commit is contained in:
Kevin Papst
2019-08-02 16:52:30 +02:00
committed by GitHub
parent 614a50ce0b
commit e11a2a6089
57 changed files with 1577 additions and 1184 deletions

View File

@@ -114,17 +114,14 @@ class CreateReleaseCommand extends Command
$tar .= '.tar.gz';
$zip .= '.zip';
// this removes the current env settings, as they might differ from the release ones
// if we don't unset them, the .env file won't be read when executing bin/console commands
putenv('DATABASE_URL');
putenv('APP_ENV');
$prefix = 'APP_ENV=prod DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite';
$commands = [
'Clone repository' => $gitCmd . ' ' . $tmpDir,
'Install composer dependencies' => 'cd ' . $tmpDir . ' && composer install --no-dev --optimize-autoloader',
'Create database' => 'cd ' . $tmpDir . ' && bin/console doctrine:database:create -n',
'Create tables' => 'cd ' . $tmpDir . ' && bin/console doctrine:schema:create -n',
'Add all migrations' => 'cd ' . $tmpDir . ' && bin/console doctrine:migrations:version --add --all -n',
'Create database' => 'cd ' . $tmpDir . ' && ' . $prefix . ' bin/console doctrine:database:create -n',
'Create tables' => 'cd ' . $tmpDir . ' && ' . $prefix . ' bin/console doctrine:schema:create -n',
'Add all migrations' => 'cd ' . $tmpDir . ' && ' . $prefix . ' bin/console doctrine:migrations:version --add --all -n',
];
$filesToDelete = [

View File

@@ -106,9 +106,6 @@ class CreateUserCommand extends Command
->setRoles(explode(',', $role))
;
$pwd = $this->encoder->encodePassword($user, $user->getPlainPassword());
$user->setPassword($pwd);
$errors = $this->validator->validate($user, null, ['Registration']);
if ($errors->count() > 0) {
/** @var \Symfony\Component\Validator\ConstraintViolation $error */
@@ -126,6 +123,9 @@ class CreateUserCommand extends Command
}
try {
$pwd = $this->encoder->encodePassword($user, $user->getPlainPassword());
$user->setPassword($pwd);
$entityManager = $this->doctrine->getManager();
$entityManager->persist($user);
$entityManager->flush();