Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Finish install commands migration #1110

Merged
merged 1 commit into from Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -20,9 +20,16 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Core\BootService;
use TYPO3\CMS\Core\Information\Typo3Version;

class InstallDefaultConfigurationCommand extends Command
{
public function __construct(private readonly BootService $bootService)
{
parent::__construct('install:defaultconfiguration');
}

protected function configure()
{
$this->setHidden(true);
Expand Down Expand Up @@ -62,6 +69,9 @@ public function isEnabled()

protected function execute(InputInterface $input, OutputInterface $output): int
{
// @deprecated with TYPO3 12, this version check can be removed
$this->bootService->loadExtLocalconfDatabaseAndExtTables(allowCaching: (new Typo3Version())->getMajorVersion() > 11);

$siteSetupType = $input->getOption('site-setup-type');
$arguments['siteUrl'] = $input->getOption('site-base-url');
switch ($siteSetupType) {
Expand Down
8 changes: 8 additions & 0 deletions Classes/Console/ServiceProvider.php
Expand Up @@ -7,6 +7,7 @@
use Helhum\Typo3Console\Command\Install\InstallDatabaseConnectCommand;
use Helhum\Typo3Console\Command\Install\InstallDatabaseDataCommand;
use Helhum\Typo3Console\Command\Install\InstallDatabaseSelectCommand;
use Helhum\Typo3Console\Command\Install\InstallDefaultConfigurationCommand;
use Helhum\Typo3Console\Command\Install\InstallEnvironmentAndFoldersCommand;
use Helhum\Typo3Console\Command\Install\InstallExtensionSetupIfPossibleCommand;
use Helhum\Typo3Console\Command\Install\InstallFixFolderStructureCommand;
Expand Down Expand Up @@ -36,6 +37,7 @@ public function getFactories(): array
InstallDatabaseConnectCommand::class => [ static::class, 'getInstallDatabaseConnectCommand' ],
InstallDatabaseDataCommand::class => [ static::class, 'getInstallDatabaseDataCommand' ],
InstallDatabaseSelectCommand::class => [ static::class, 'getInstallDatabaseSelectCommand' ],
InstallDefaultConfigurationCommand::class => [ static::class, 'getInstallDefaultConfigurationCommand' ],
InstallActionNeedsExecutionCommand::class => [ static::class, 'getInstallActionNeedsExecutionCommand' ],
LockInstallToolCommand::class => [ static::class, 'getLockInstallToolCommand' ],
UnlockInstallToolCommand::class => [ static::class, 'getUnlockInstallToolCommand' ],
Expand Down Expand Up @@ -89,6 +91,11 @@ public static function getInstallDatabaseSelectCommand(): InstallDatabaseSelectC
return new InstallDatabaseSelectCommand('install:databaseselect');
}

public static function getInstallDefaultConfigurationCommand(ContainerInterface $container): InstallDefaultConfigurationCommand
{
return new InstallDefaultConfigurationCommand($container->get(BootService::class));
}

public static function getInstallActionNeedsExecutionCommand(): InstallActionNeedsExecutionCommand
{
return new InstallActionNeedsExecutionCommand('install:actionneedsexecution');
Expand All @@ -114,6 +121,7 @@ public static function configureCommands(ContainerInterface $container, CommandR
$commandRegistry->addLazyCommand('install:databaseconnect', InstallDatabaseConnectCommand::class, 'Connect to database');
$commandRegistry->addLazyCommand('install:databasedata', InstallDatabaseDataCommand::class, 'Add database data');
$commandRegistry->addLazyCommand('install:databaseselect', InstallDatabaseSelectCommand::class, 'Select database');
$commandRegistry->addLazyCommand('install:defaultconfiguration', InstallDefaultConfigurationCommand::class, 'Select database');
$commandRegistry->addLazyCommand('install:actionneedsexecution', InstallActionNeedsExecutionCommand::class, 'Calls needs execution on the given action and returns the result');
$commandRegistry->addLazyCommand('install:lock', LockInstallToolCommand::class, 'Lock Install Tool');
$commandRegistry->addLazyCommand('install:unlock', UnlockInstallToolCommand::class, 'Unlock Install Tool');
Expand Down
8 changes: 0 additions & 8 deletions Configuration/Commands.php
Expand Up @@ -27,14 +27,6 @@
'class' => \Helhum\Typo3Console\Command\Database\DatabaseImportCommand::class,
'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL,
],
'install:defaultconfiguration' => [
'vendor' => 'typo3_console',
'class' => \Helhum\Typo3Console\Command\Install\InstallDefaultConfigurationCommand::class,
'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL,
'bootingSteps' => [
'helhum.typo3console:persistence',
],
],
'upgrade:list' => [
'vendor' => 'typo3_console',
'class' => \Helhum\Typo3Console\Command\Upgrade\UpgradeListCommand::class,
Expand Down