random improvements (#5506)

* fix order of destroying form elements
* API documentation - fixes #1949
* make command path independent
* use PhpSubprocess to execute migrations
* allow to configure optional SAML attributes
* fix deprecation
* unify wording of exported state - fixes #5392
This commit is contained in:
Kevin Papst
2025-05-28 13:34:01 +02:00
committed by GitHub
parent 81107377f4
commit 0420eb27c7
19 changed files with 150 additions and 63 deletions

View File

@@ -10,9 +10,10 @@
namespace App\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Process\PhpSubprocess;
/**
* Command used to execute all the basic application bootstrapping AFTER "composer install" was executed.
@@ -24,16 +25,36 @@ use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(name: 'kimai:reset:dev', description: 'Resets the "development" environment')]
final class ResetDevelopmentCommand extends AbstractResetCommand
{
public function __construct(string $kernelEnvironment)
public function __construct(string $kernelEnvironment, private readonly string $projectDirectory)
{
parent::__construct($kernelEnvironment);
}
protected function loadData(InputInterface $input, OutputInterface $output): void
{
$command = $this->getApplication()->find('doctrine:fixtures:load');
$cmdInput = new ArrayInput([]);
$cmdInput->setInteractive(false);
$command->run($cmdInput, $output);
$io = new SymfonyStyle($input, $output);
$io->writeln('Importing fixtures, this will take a while ... please be patient ...');
$process = new PhpSubprocess(
[
'bin/console',
'doctrine:fixtures:load',
'--no-interaction',
],
$this->projectDirectory
);
$process->run();
if (!$process->isSuccessful()) {
$io->error('Failed to load fixtures');
$io->error($process->getErrorOutput());
} else {
if ($io->isVerbose()) {
$io->write($process->getOutput());
} else {
$io->success('Fixtures loaded');
}
}
}
}