diff --git a/.gitignore b/.gitignore index d37e85a0..db061d29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ /.Build/* /Classes/Console/Hook/* -/Configuration/Console/ComposerPackagesCommands.php +/Configuration/ComposerPackagesCommands.php /Libraries/vendor /Resources/Public/* /.php_cs.cache /composer.lock /ext_* -*GENERATED* \ No newline at end of file +*GENERATED* diff --git a/Classes/Console/Composer/InstallerScript/PopulateCommandConfiguration.php b/Classes/Console/Composer/InstallerScript/PopulateCommandConfiguration.php index 05c75e53..e0373685 100644 --- a/Classes/Console/Composer/InstallerScript/PopulateCommandConfiguration.php +++ b/Classes/Console/Composer/InstallerScript/PopulateCommandConfiguration.php @@ -49,11 +49,14 @@ public function run(ScriptEvent $event): bool // Since meta packages have no code, thus cannot include any commands, we ignore them as well. continue; } - $commandConfiguration = array_merge($commandConfiguration, $this->getConfigFromPackage($installPath, $packageName)); + $packageConfig = $this->getConfigFromPackage($installPath, $packageName); + if ($packageConfig !== []) { + $commandConfiguration[] = $packageConfig; + } } $success = file_put_contents( - __DIR__ . '/../../../../Configuration/Console/ComposerPackagesCommands.php', + __DIR__ . '/../../../../Configuration/ComposerPackagesCommands.php', ' CommandConfiguration::unifyCommandConfiguration($commandConfiguration, $packageName)]; + return CommandConfiguration::unifyCommandConfiguration($commandConfiguration, $packageName); } } diff --git a/Classes/Console/Core/Booting/Sequence.php b/Classes/Console/Core/Booting/Sequence.php index 6b440873..800526e0 100644 --- a/Classes/Console/Core/Booting/Sequence.php +++ b/Classes/Console/Core/Booting/Sequence.php @@ -84,6 +84,7 @@ public function removeStep($stepIdentifier) * Executes all steps of this sequence * * @param Bootstrap $bootstrap + * @throws StepFailedException * @return void */ public function invoke(Bootstrap $bootstrap) diff --git a/Classes/Console/Error/ExceptionHandler.php b/Classes/Console/Error/ExceptionHandler.php index 08d966ba..7de999fa 100644 --- a/Classes/Console/Error/ExceptionHandler.php +++ b/Classes/Console/Error/ExceptionHandler.php @@ -28,16 +28,10 @@ class ExceptionHandler */ protected $output; - /** - * @param ConsoleOutput $output - */ public function __construct(ExceptionRenderer $exceptionRenderer = null, ConsoleOutput $output = null) { $this->exceptionRenderer = $exceptionRenderer ?: new ExceptionRenderer(); - if ($output === null) { - $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_DEBUG); - } - $this->output = $output; + $this->output = $output ?? new ConsoleOutput(ConsoleOutput::VERBOSITY_DEBUG); } /** diff --git a/Classes/Console/Mvc/Cli/CommandCollection.php b/Classes/Console/Mvc/Cli/CommandCollection.php index 72b61d7c..b63b6aee 100644 --- a/Classes/Console/Mvc/Cli/CommandCollection.php +++ b/Classes/Console/Mvc/Cli/CommandCollection.php @@ -53,6 +53,11 @@ class CommandCollection implements CommandLoaderInterface */ private $commands = []; + /** + * @var string[] + */ + private $replaces = []; + public function __construct(RunLevel $runLevel, CommandConfiguration $commandConfiguration) { $this->runLevel = $runLevel; @@ -106,11 +111,11 @@ public function get($name): BaseCommand throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name), [], 1518812618); } $commandConfig = $this->commands[$name]; - if (isset($commandConfig['class'])) { + if (isset($commandConfig['controller'])) { + $command = GeneralUtility::makeInstance(CommandControllerCommand::class, $commandConfig['name'], new Command($commandConfig['controller'], $commandConfig['controllerCommandName']), $commandConfig['lateCommand'] ?? false); + } elseif (isset($commandConfig['class'])) { /** @var BaseCommand $command */ $command = GeneralUtility::makeInstance($commandConfig['class'], $commandConfig['name']); - } elseif (isset($commandConfig['controller'])) { - $command = GeneralUtility::makeInstance(CommandControllerCommand::class, $commandConfig['name'], new Command($commandConfig['controller'], $commandConfig['controllerCommandName'])); } else { throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name), [], 1520205204); } @@ -155,9 +160,22 @@ private function isCommandAvailable(string $name): bool private function populateCommands(array $definitions = null) { - foreach ($definitions ?? $this->commandConfiguration->getCommandDefinitions() as $nameSpacedName => $commandConfig) { - $this->add($nameSpacedName, $commandConfig); + $definitions = $definitions ?? $this->commandConfiguration->getCommandDefinitions(); + $this->extractReplaces($definitions); + foreach ($definitions as $commandConfig) { + $this->add($commandConfig); + } + } + + private function extractReplaces(array $definitions) + { + $replaces = []; + foreach ($definitions as $commandConfiguration) { + if (isset($commandConfiguration['replace'])) { + $replaces[] = $commandConfiguration['replace']; + } } + $this->replaces = array_merge($this->replaces, ...$replaces); } private function initializeRunLevel() @@ -174,25 +192,24 @@ private function initializeRunLevel() } } - private function add(string $nameSpacedName, array $commandConfig) + private function add(array $commandConfig) { $finalCommandName = $commandConfig['name']; - $replaces = $this->commandConfiguration->getReplaces(); - if (in_array($commandConfig['name'], $replaces, true) - || in_array($nameSpacedName, $replaces, true) + if (in_array($commandConfig['name'], $this->replaces, true) + || in_array($commandConfig['nameSpacedName'], $this->replaces, true) ) { return; } if (isset($this->commands[$finalCommandName])) { - $finalCommandName = $nameSpacedName; + $finalCommandName = $commandConfig['nameSpacedName']; } if (isset($this->commands[$finalCommandName])) { throw new CommandNameAlreadyInUseException('Command "' . $finalCommandName . '" registered by "' . $commandConfig['vendor'] . '" is already in use', 1506531326); } $commandConfig['aliases'] = $commandConfig['aliases'] ?? []; - if ($finalCommandName !== $nameSpacedName) { + if ($finalCommandName !== $commandConfig['nameSpacedName']) { // Add alias to be able to call this command always with name spaced command name - $commandConfig['aliases'][] = $nameSpacedName; + $commandConfig['aliases'][] = $commandConfig['nameSpacedName']; } $commandConfig['name'] = $finalCommandName; $this->commands[$finalCommandName] = $commandConfig; diff --git a/Classes/Console/Mvc/Cli/CommandConfiguration.php b/Classes/Console/Mvc/Cli/CommandConfiguration.php index ee58cafe..72d4b900 100644 --- a/Classes/Console/Mvc/Cli/CommandConfiguration.php +++ b/Classes/Console/Mvc/Cli/CommandConfiguration.php @@ -15,7 +15,6 @@ */ use Symfony\Component\Console\Exception\RuntimeException; -use TYPO3\CMS\Core\Console\CommandNameAlreadyInUseException; use TYPO3\CMS\Core\Package\PackageInterface; use TYPO3\CMS\Core\Package\PackageManager; @@ -29,8 +28,6 @@ class CommandConfiguration */ private $packageManager; - private $replaces = []; - private $commandDefinitions = []; public function __construct(PackageManager $packageManager) @@ -60,40 +57,43 @@ public static function ensureValidCommandRegistration($commandConfiguration, $pa public static function unifyCommandConfiguration(array $commandConfiguration, string $packageName): array { - $commandDefinitions = array_replace($commandConfiguration['commands'] ?? [], self::extractCommandDefinitionsFromControllers($commandConfiguration['controllers'] ?? [])); + $commandDefinitions = []; - foreach ($commandDefinitions as $commandName => $commandConfig) { - $commandDefinitions[$commandName]['vendor'] = $vendor = $commandConfig['vendor'] ?? $packageName; + foreach ($commandConfiguration['commands'] ?? [] as $commandName => $commandConfig) { + $vendor = $commandConfig['vendor'] ?? $packageName; $nameSpacedCommandName = $vendor . ':' . $commandName; + $commandConfig['vendor'] = $vendor; + $commandConfig['name'] = $commandName; + $commandConfig['nameSpacedName'] = $nameSpacedCommandName; $nameSpacedCommandCollection = $nameSpacedCommandName; if (strrpos($commandName, ':') !== false) { $nameSpacedCommandCollection = $vendor . ':' . substr($commandName, 0, strrpos($commandName, ':')) . ':*'; } if (isset($commandConfiguration['runLevels'][$nameSpacedCommandCollection])) { - $commandDefinitions[$commandName]['runLevel'] = $commandConfiguration['runLevels'][$nameSpacedCommandCollection]; + $commandConfig['runLevel'] = $commandConfiguration['runLevels'][$nameSpacedCommandCollection]; } if (isset($commandConfiguration['runLevels'][$commandName])) { - $commandDefinitions[$commandName]['runLevel'] = $commandConfiguration['runLevels'][$commandName]; + $commandConfig['runLevel'] = $commandConfiguration['runLevels'][$commandName]; } if (isset($commandConfiguration['runLevels'][$nameSpacedCommandName])) { - $commandDefinitions[$commandName]['runLevel'] = $commandConfiguration['runLevels'][$nameSpacedCommandName]; + $commandConfig['runLevel'] = $commandConfiguration['runLevels'][$nameSpacedCommandName]; } if (isset($commandConfiguration['bootingSteps'][$commandName])) { - $commandDefinitions[$commandName]['bootingSteps'] = $commandConfiguration['bootingSteps'][$commandName]; + $commandConfig['bootingSteps'] = $commandConfiguration['bootingSteps'][$commandName]; } if (isset($commandConfiguration['bootingSteps'][$nameSpacedCommandName])) { - $commandDefinitions[$commandName]['bootingSteps'] = $commandConfiguration['bootingSteps'][$nameSpacedCommandName]; + $commandConfig['bootingSteps'] = $commandConfiguration['bootingSteps'][$nameSpacedCommandName]; } + $commandDefinitions[] = $commandConfig; } if (isset($commandConfiguration['replace'])) { - $anyCommandName = key($commandDefinitions); - $commandDefinitions[$anyCommandName]['replace'] = array_merge($commandDefinitions[$anyCommandName]['replace'] ?? [], $commandConfiguration['replace']); + $commandDefinitions[0]['replace'] = array_merge($commandDefinitions[0]['replace'] ?? [], $commandConfiguration['replace']); } - return $commandDefinitions; + return array_replace($commandDefinitions, self::extractCommandDefinitionsFromControllers($commandConfiguration['controllers'] ?? [], $packageName === '_lateCommands')); } - private static function extractCommandDefinitionsFromControllers(array $controllers): array + private static function extractCommandDefinitionsFromControllers(array $controllers, bool $lateCommand): array { $commandDefinitions = []; foreach ($controllers as $controllerClassName) { @@ -113,9 +113,15 @@ private static function extractCommandDefinitionsFromControllers(array $controll $vendor = \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($classNameParts[1]); $controllerCommandNameSpace = strtolower(substr($classNameParts[$numberOfClassNameParts - 1], 0, -17)); $commandName = $controllerCommandNameSpace . ':' . strtolower($controllerCommandName); - $commandDefinitions[$commandName]['vendor'] = $vendor; - $commandDefinitions[$commandName]['controller'] = $controllerClassName; - $commandDefinitions[$commandName]['controllerCommandName'] = $controllerCommandName; + $namespacedCommandName = $vendor . ':' . $commandName; + $commandDefinitions[] = [ + 'vendor' => $vendor, + 'name' => $commandName, + 'nameSpacedName' => $namespacedCommandName, + 'controller' => $controllerClassName, + 'controllerCommandName' => $controllerCommandName, + 'lateCommand' => $lateCommand, + ]; } } } @@ -123,14 +129,6 @@ private static function extractCommandDefinitionsFromControllers(array $controll return $commandDefinitions; } - /** - * @return array - */ - public function getReplaces(): array - { - return $this->replaces; - } - /** * @return array */ @@ -141,36 +139,19 @@ public function getCommandDefinitions(): array public function addCommandControllerCommands(array $commandControllers): array { - $addedCommandDefinitions = $this->getCommandDefinitionsForCommands(self::unifyCommandConfiguration(['controllers' => $commandControllers], '')); - $this->commandDefinitions = array_replace($this->commandDefinitions, $addedCommandDefinitions); + $addedCommandDefinitions = self::unifyCommandConfiguration(['controllers' => $commandControllers], '_lateCommands'); + $this->commandDefinitions = array_merge($this->commandDefinitions, $addedCommandDefinitions); + + if (!empty($addedCommandDefinitions)) { + trigger_error('Registering commands via $GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'extbase\'][\'commandControllers\'] is deprecated and will be removed with 6.0. Register Symfony commands in Configuration/Commands.php instead.', E_USER_DEPRECATED); + } return $addedCommandDefinitions; } private function initialize() { - foreach ($this->gatherRawConfig() as $commandConfiguration) { - $this->commandDefinitions = array_replace($this->commandDefinitions, $this->getCommandDefinitionsForCommands($commandConfiguration)); - } - } - - private function getCommandDefinitionsForCommands(array $commands): array - { - $commandDefinitions = []; - foreach ($commands as $name => $singleCommandConfiguration) { - $vendor = $singleCommandConfiguration['vendor']; - if (isset($singleCommandConfiguration['replace'])) { - $this->replaces = array_merge($this->replaces, $singleCommandConfiguration['replace']); - } - $singleCommandConfiguration['name'] = $name; - $nameSpacedCommandName = $vendor . ':' . $name; - if (isset($this->commandDefinitions[$nameSpacedCommandName])) { - throw new CommandNameAlreadyInUseException('Command "' . $nameSpacedCommandName . '" registered by "' . $vendor . '" is already in use', 1520181870); - } - $commandDefinitions[$nameSpacedCommandName] = $singleCommandConfiguration; - } - - return $commandDefinitions; + $this->commandDefinitions = array_merge([], ...$this->gatherRawConfig()); } /** @@ -178,18 +159,23 @@ private function getCommandDefinitionsForCommands(array $commands): array */ private function gatherRawConfig(): array { - if (file_exists($commandConfigurationFile = __DIR__ . '/../../../../Configuration/Console/ComposerPackagesCommands.php')) { + if (file_exists($commandConfigurationFile = __DIR__ . '/../../../../Configuration/ComposerPackagesCommands.php')) { $configuration = require $commandConfigurationFile; } else { // We only reach this point in non composer mode // We ensure that our commands are present, even if we are not an active extension or even not being an extension at all - $configuration['typo3_console'] = self::unifyCommandConfiguration(require __DIR__ . '/../../../../Configuration/Console/Commands.php', 'typo3_console'); + $configuration[] = require __DIR__ . '/../../../../Configuration/Commands.php'; } foreach ($this->packageManager->getActivePackages() as $package) { + if ($package->getPackageKey() === 'typo3_console') { + // We only reach this point in non composer mode + // We registered our commands above already + continue; + } $packageConfig = $this->getConfigFromExtension($package); if (!empty($packageConfig)) { self::ensureValidCommandRegistration($packageConfig, $package->getPackageKey()); - $configuration[$package->getPackageKey()] = self::unifyCommandConfiguration($packageConfig, $package->getPackageKey()); + $configuration[] = self::unifyCommandConfiguration($packageConfig, $package->getPackageKey()); } } @@ -200,6 +186,7 @@ private function getConfigFromExtension(PackageInterface $package): array { $commandConfiguration = []; if (file_exists($commandConfigurationFile = $package->getPackagePath() . 'Configuration/Console/Commands.php')) { + trigger_error('Configuration/Console/Commands.php for registering commands is deprecated and will be removed with 6.0. Register Symfony commands in Configuration/Commands.php instead.', E_USER_DEPRECATED); $commandConfiguration = require $commandConfigurationFile; } if (file_exists($commandConfigurationFile = $package->getPackagePath() . 'Configuration/Commands.php')) { diff --git a/Classes/Console/Mvc/Cli/Symfony/Command/CommandControllerCommand.php b/Classes/Console/Mvc/Cli/Symfony/Command/CommandControllerCommand.php index 4f57c912..bab0cd74 100644 --- a/Classes/Console/Mvc/Cli/Symfony/Command/CommandControllerCommand.php +++ b/Classes/Console/Mvc/Cli/Symfony/Command/CommandControllerCommand.php @@ -35,6 +35,7 @@ use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; /** @@ -60,10 +61,24 @@ class CommandControllerCommand extends Command */ private $application; - public function __construct($name, CommandDefinition $commandDefinition) + /** + * @var bool + */ + private $isLateCommand; + + public function __construct($name, CommandDefinition $commandDefinition, bool $isLateCommand = false) { $this->commandDefinition = $commandDefinition; parent::__construct($name); + $this->isLateCommand = $isLateCommand; + } + + /** + * @return bool + */ + public function isLateCommand(): bool + { + return $this->isLateCommand; } public function getNativeDefinition() @@ -155,9 +170,16 @@ protected function execute(InputInterface $input, OutputInterface $output) { // @deprecated in 5.0 will be removed in 6.0 $givenCommandName = $input->getArgument('command'); + $debugOutput = $output; + if ($output instanceof ConsoleOutput) { + $debugOutput = $output->getErrorOutput(); + } if ($givenCommandName === $this->getAliases()[0]) { - $output->writeln('Specifying the full command name is deprecated.'); - $output->writeln(sprintf('Please use "%s" as command name instead.', $this->getName())); + $debugOutput->writeln('Specifying the full command name is deprecated.'); + $debugOutput->writeln(sprintf('Please use "%s" as command name instead.', $this->getName())); + } + if ($this->isLateCommand && $output->isVerbose()) { + $debugOutput->writeln('Registering commands via $GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'extbase\'][\'commandControllers\'] is deprecated and will be removed with 6.0. Register Symfony commands in Configuration/Commands.php instead.'); } $response = (new RequestHandler())->handle($this->commandDefinition, $input, $output); diff --git a/Classes/Console/Mvc/Cli/Symfony/Command/DummyCommand.php b/Classes/Console/Mvc/Cli/Symfony/Command/DummyCommand.php new file mode 100644 index 00000000..87b306b6 --- /dev/null +++ b/Classes/Console/Mvc/Cli/Symfony/Command/DummyCommand.php @@ -0,0 +1,29 @@ +command = $this->getApplication()->find($input->getArgument('command_name')); } + if ($this->command instanceof CommandControllerCommand && $this->command->isLateCommand()) { + $output->writeln('Registering commands via $GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'extbase\'][\'commandControllers\'] is deprecated and will be removed with 6.0. Register Symfony commands in Configuration/Commands.php instead.'); + } + $helper = new DescriptorHelper(); // Add our own descriptor $helper->register('txt', new TextDescriptor()); diff --git a/Classes/Console/Mvc/Controller/CommandController.php b/Classes/Console/Mvc/Controller/CommandController.php index f32bc2e3..25984153 100644 --- a/Classes/Console/Mvc/Controller/CommandController.php +++ b/Classes/Console/Mvc/Controller/CommandController.php @@ -28,6 +28,7 @@ */ use Helhum\Typo3Console\Log\Writer\ConsoleWriter; +use Helhum\Typo3Console\Mvc\Cli\CommandReflection; use Helhum\Typo3Console\Mvc\Cli\ConsoleOutput; use Helhum\Typo3Console\Mvc\Cli\Response; use Psr\Log\LoggerInterface; @@ -35,6 +36,7 @@ use TYPO3\CMS\Core\Log\LogLevel; use TYPO3\CMS\Extbase\Mvc\Cli\CommandArgumentDefinition; use TYPO3\CMS\Extbase\Mvc\Cli\Request; +use TYPO3\CMS\Extbase\Mvc\Controller\Argument; use TYPO3\CMS\Extbase\Mvc\Controller\Arguments; use TYPO3\CMS\Extbase\Mvc\Controller\CommandControllerInterface; use TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentTypeException; @@ -182,7 +184,7 @@ protected function resolveCommandMethodName() protected function initializeCommandMethodArguments() { $this->arguments->removeAll(); - $methodParameters = $this->reflectionService->getMethodParameters(get_class($this), $this->commandMethodName); + $methodParameters = (new CommandReflection(get_class($this), $this->commandMethodName))->getParameters(); foreach ($methodParameters as $parameterName => $parameterInfo) { $dataType = null; diff --git a/Configuration/Commands.php b/Configuration/Commands.php new file mode 100644 index 00000000..6195d00d --- /dev/null +++ b/Configuration/Commands.php @@ -0,0 +1,417 @@ + [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'replace' => [ + 'extbase:_core_command', + 'extbase:_extbase_help', + 'extbase:help:error', + 'typo3_console:_dummy', + ], + ], + 'backend:createadmin' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\BackendCommandController::class, + 'controllerCommandName' => 'createAdmin', + ], + 'backend:lock' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\BackendCommandController::class, + 'controllerCommandName' => 'lock', + 'replace' => [ + 'backend:backend:lock', + ], + ], + 'backend:lockforeditors' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\BackendCommandController::class, + 'controllerCommandName' => 'lockForEditors', + ], + 'backend:unlock' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\BackendCommandController::class, + 'controllerCommandName' => 'unlock', + 'replace' => [ + 'backend:backend:unlock', + ], + ], + 'backend:unlockforeditors' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\BackendCommandController::class, + 'controllerCommandName' => 'unlockForEditors', + ], + 'cache:flush' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\CacheCommandController::class, + 'controllerCommandName' => 'flush', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'cache:flushcomplete' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\CacheCommandController::class, + 'controllerCommandName' => 'flushComplete', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + ], + 'cache:flushgroups' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\CacheCommandController::class, + 'controllerCommandName' => 'flushGroups', + ], + 'cache:flushtags' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\CacheCommandController::class, + 'controllerCommandName' => 'flushTags', + ], + 'cache:listgroups' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\CacheCommandController::class, + 'controllerCommandName' => 'listGroups', + ], + 'cleanup:updatereferenceindex' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\CleanupCommandController::class, + 'controllerCommandName' => 'updateReferenceIndex', + 'replace' => [ + 'backend:referenceindex:update', + ], + 'aliases' => [ + 'backend:referenceindex:update', + 'referenceindex:update', + ], + ], + 'configuration:remove' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ConfigurationCommandController::class, + 'controllerCommandName' => 'remove', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + ], + 'configuration:set' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ConfigurationCommandController::class, + 'controllerCommandName' => 'set', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + ], + 'configuration:show' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ConfigurationCommandController::class, + 'controllerCommandName' => 'show', + ], + 'configuration:showactive' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ConfigurationCommandController::class, + 'controllerCommandName' => 'showActive', + ], + 'configuration:showlocal' => [ + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'vendor' => 'typo3_console', + 'controller' => \Helhum\Typo3Console\Command\ConfigurationCommandController::class, + 'controllerCommandName' => 'showLocal', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + ], + 'database:export' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Command\Database\DatabaseExportCommand::class, + 'schedulable' => false, + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + ], + 'database:import' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\DatabaseCommandController::class, + 'controllerCommandName' => 'import', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + ], + 'database:updateschema' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\DatabaseCommandController::class, + 'controllerCommandName' => 'updateSchema', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + 'bootingSteps' => [ + 'helhum.typo3console:database', + 'helhum.typo3console:persistence', + ], + ], + 'documentation:generatexsd' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\DocumentationCommandController::class, + 'controllerCommandName' => 'generateXsd', + ], + 'extension:activate' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'activate', + 'replace' => [ + 'extensionmanager:extension:install', + 'extensionmanager:extension:activate', + ], + 'aliases' => [ + 'extension:install', + 'extensionmanager:extension:install', + 'extensionmanager:extension:activate', + ], + ], + 'extension:deactivate' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'deactivate', + 'replace' => [ + 'extensionmanager:extension:uninstall', + 'extensionmanager:extension:deactivate', + ], + 'aliases' => [ + 'extension:uninstall', + 'extensionmanager:extension:uninstall', + 'extensionmanager:extension:deactivate', + ], + ], + 'extension:dumpautoload' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'dumpAutoload', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + 'replace' => [ + 'extensionmanager:extension:dumpclassloadinginformation', + ], + 'aliases' => [ + 'extension:dumpclassloadinginformation', + 'extensionmanager:extension:dumpclassloadinginformation', + ], + ], + 'extension:list' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'list', + 'replace' => [ + 'core:extension:list', + ], + ], + 'extension:removeinactive' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'removeInactive', + ], + 'extension:setup' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'setup', + ], + 'extension:setupactive' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\ExtensionCommandController::class, + 'controllerCommandName' => 'setupActive', + ], + 'frontend:request' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\FrontendCommandController::class, + 'controllerCommandName' => 'request', + ], + 'install:setup' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'setup', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:generatepackagestates' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'generatePackageStates', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:fixfolderstructure' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'fixFolderStructure', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:extensionsetupifpossible' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'extensionSetupIfPossible', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:environmentandfolders' => [ + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'vendor' => 'typo3_console', + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'environmentAndFolders', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:databaseconnect' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'databaseConnect', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:databaseselect' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'databaseSelect', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'install:databasedata' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'databaseData', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + 'bootingSteps' => [ + 'helhum.typo3console:database', + 'helhum.typo3console:persistence', + ], + ], + 'install:defaultconfiguration' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'defaultConfiguration', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, + 'bootingSteps' => [ + 'helhum.typo3console:database', + 'helhum.typo3console:persistence', + ], + ], + 'install:actionneedsexecution' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\InstallCommandController::class, + 'controllerCommandName' => 'actionNeedsExecution', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'scheduler:run' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\SchedulerCommandController::class, + 'controllerCommandName' => 'run', + 'replace' => [ + 'scheduler:scheduler:run', + ], + ], + 'upgrade:all' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\UpgradeCommandController::class, + 'controllerCommandName' => 'all', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + 'replace' => [ + 'install:upgrade:run', + ], + ], + 'upgrade:checkextensionconstraints' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\UpgradeCommandController::class, + 'controllerCommandName' => 'checkExtensionConstraints', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'upgrade:list' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\UpgradeCommandController::class, + 'controllerCommandName' => 'list', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + 'replace' => [ + 'install:upgrade:list', + ], + 'aliases' => [ + 'install:upgrade:list', + ], + ], + 'upgrade:wizard' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\UpgradeCommandController::class, + 'controllerCommandName' => 'wizard', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], + 'upgrade:subprocess' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\UpgradeCommandController::class, + 'controllerCommandName' => 'subProcess', + ], + 'upgrade:checkextensioncompatibility' => [ + 'vendor' => 'typo3_console', + 'class' => \Helhum\Typo3Console\Mvc\Cli\Symfony\Command\DummyCommand::class, + 'schedulable' => false, + 'controller' => \Helhum\Typo3Console\Command\UpgradeCommandController::class, + 'controllerCommandName' => 'checkExtensionCompatibility', + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + ], +]; diff --git a/Configuration/Console/Commands.php b/Configuration/Console/Commands.php deleted file mode 100644 index eaae53eb..00000000 --- a/Configuration/Console/Commands.php +++ /dev/null @@ -1,329 +0,0 @@ - [ - '_dummy' => [ - 'vendor' => 'typo3_console', - 'replace' => [ - 'extbase:_core_command', - 'extbase:_extbase_help', - 'extbase:help:error', - 'typo3_console:_dummy', - ], - ], - 'backend:createadmin' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\BackendCommandController::class, - 'controllerCommandName' => 'createAdmin', - ], - 'backend:lock' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\BackendCommandController::class, - 'controllerCommandName' => 'lock', - 'replace' => [ - 'backend:backend:lock', - ], - ], - 'backend:lockforeditors' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\BackendCommandController::class, - 'controllerCommandName' => 'lockForEditors', - ], - 'backend:unlock' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\BackendCommandController::class, - 'controllerCommandName' => 'unlock', - 'replace' => [ - 'backend:backend:unlock', - ], - ], - 'backend:unlockforeditors' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\BackendCommandController::class, - 'controllerCommandName' => 'unlockForEditors', - ], - 'cache:flush' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\CacheCommandController::class, - 'controllerCommandName' => 'flush', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'cache:flushcomplete' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\CacheCommandController::class, - 'controllerCommandName' => 'flushComplete', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - ], - 'cache:flushgroups' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\CacheCommandController::class, - 'controllerCommandName' => 'flushGroups', - ], - 'cache:flushtags' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\CacheCommandController::class, - 'controllerCommandName' => 'flushTags', - ], - 'cache:listgroups' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\CacheCommandController::class, - 'controllerCommandName' => 'listGroups', - ], - 'cleanup:updatereferenceindex' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\CleanupCommandController::class, - 'controllerCommandName' => 'updateReferenceIndex', - 'replace' => [ - 'backend:referenceindex:update', - ], - 'aliases' => [ - 'backend:referenceindex:update', - 'referenceindex:update', - ], - ], - 'configuration:remove' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ConfigurationCommandController::class, - 'controllerCommandName' => 'remove', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - ], - 'configuration:set' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ConfigurationCommandController::class, - 'controllerCommandName' => 'set', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - ], - 'configuration:show' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ConfigurationCommandController::class, - 'controllerCommandName' => 'show', - ], - 'configuration:showactive' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ConfigurationCommandController::class, - 'controllerCommandName' => 'showActive', - ], - 'configuration:showlocal' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ConfigurationCommandController::class, - 'controllerCommandName' => 'showLocal', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - ], - 'database:export' => [ - 'vendor' => 'typo3_console', - 'class' => Helhum\Typo3Console\Command\Database\DatabaseExportCommand::class, - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - ], - 'database:import' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\DatabaseCommandController::class, - 'controllerCommandName' => 'import', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - ], - 'database:updateschema' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\DatabaseCommandController::class, - 'controllerCommandName' => 'updateSchema', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - 'bootingSteps' => [ - 'helhum.typo3console:database', - 'helhum.typo3console:persistence', - ], - ], - 'documentation:generatexsd' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\DocumentationCommandController::class, - 'controllerCommandName' => 'generateXsd', - ], - 'extension:activate' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'activate', - 'replace' => [ - 'extensionmanager:extension:install', - 'extensionmanager:extension:activate', - ], - 'aliases' => [ - 'extension:install', - 'extensionmanager:extension:install', - 'extensionmanager:extension:activate', - ], - ], - 'extension:deactivate' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'deactivate', - 'replace' => [ - 'extensionmanager:extension:uninstall', - 'extensionmanager:extension:deactivate', - ], - 'aliases' => [ - 'extension:uninstall', - 'extensionmanager:extension:uninstall', - 'extensionmanager:extension:deactivate', - ], - ], - 'extension:dumpautoload' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'dumpAutoload', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - 'replace' => [ - 'extensionmanager:extension:dumpclassloadinginformation', - ], - 'aliases' => [ - 'extension:dumpclassloadinginformation', - 'extensionmanager:extension:dumpclassloadinginformation', - ], - ], - 'extension:list' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'list', - 'replace' => [ - 'core:extension:list', - ], - ], - 'extension:removeinactive' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'removeInactive', - ], - 'extension:setup' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'setup', - ], - 'extension:setupactive' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\ExtensionCommandController::class, - 'controllerCommandName' => 'setupActive', - ], - 'frontend:request' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\FrontendCommandController::class, - 'controllerCommandName' => 'request', - ], - 'install:setup' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'setup', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:generatepackagestates' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'generatePackageStates', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:fixfolderstructure' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'fixFolderStructure', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:extensionsetupifpossible' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'extensionSetupIfPossible', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:environmentandfolders' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'environmentAndFolders', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:databaseconnect' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'databaseConnect', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:databaseselect' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'databaseSelect', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'install:databasedata' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'databaseData', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - 'bootingSteps' => [ - 'helhum.typo3console:database', - 'helhum.typo3console:persistence', - ], - ], - 'install:defaultconfiguration' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'defaultConfiguration', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_MINIMAL, - 'bootingSteps' => [ - 'helhum.typo3console:database', - 'helhum.typo3console:persistence', - ], - ], - 'install:actionneedsexecution' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\InstallCommandController::class, - 'controllerCommandName' => 'actionNeedsExecution', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'scheduler:run' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\SchedulerCommandController::class, - 'controllerCommandName' => 'run', - 'replace' => [ - 'scheduler:scheduler:run', - ], - ], - 'upgrade:all' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\UpgradeCommandController::class, - 'controllerCommandName' => 'all', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - 'replace' => [ - 'install:upgrade:run', - ], - ], - 'upgrade:checkextensionconstraints' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\UpgradeCommandController::class, - 'controllerCommandName' => 'checkExtensionConstraints', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'upgrade:list' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\UpgradeCommandController::class, - 'controllerCommandName' => 'list', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - 'replace' => [ - 'install:upgrade:list', - ], - 'aliases' => [ - 'install:upgrade:list', - ], - ], - 'upgrade:wizard' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\UpgradeCommandController::class, - 'controllerCommandName' => 'wizard', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - 'upgrade:subprocess' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\UpgradeCommandController::class, - 'controllerCommandName' => 'subProcess', - ], - 'upgrade:checkextensioncompatibility' => [ - 'vendor' => 'typo3_console', - 'controller' => Helhum\Typo3Console\Command\UpgradeCommandController::class, - 'controllerCommandName' => 'checkExtensionCompatibility', - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - ], - ], -]; diff --git a/Packages/ConvertCommandControllerCommand/Configuration/Commands.php b/Packages/ConvertCommandControllerCommand/Configuration/Commands.php new file mode 100644 index 00000000..5ca66dcf --- /dev/null +++ b/Packages/ConvertCommandControllerCommand/Configuration/Commands.php @@ -0,0 +1,10 @@ + [ + 'class' => \Typo3Console\ConvertCommandControllerCommand\Command\ConvertCommandControllerCommand::class, + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_FULL, + 'vendor' => 'typo3_console', + ], +]; diff --git a/Packages/ConvertCommandControllerCommand/Configuration/Console/Commands.php b/Packages/ConvertCommandControllerCommand/Configuration/Console/Commands.php deleted file mode 100644 index b0d529ce..00000000 --- a/Packages/ConvertCommandControllerCommand/Configuration/Console/Commands.php +++ /dev/null @@ -1,12 +0,0 @@ - [ - 'convert-command-controller' => [ - 'class' => \Typo3Console\ConvertCommandControllerCommand\Command\ConvertCommandControllerCommand::class, - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_FULL, - 'vendor' => 'typo3_console', - ], - ], -]; diff --git a/Packages/CreateReferenceCommand/Configuration/Commands.php b/Packages/CreateReferenceCommand/Configuration/Commands.php new file mode 100644 index 00000000..55572e82 --- /dev/null +++ b/Packages/CreateReferenceCommand/Configuration/Commands.php @@ -0,0 +1,10 @@ + [ + 'class' => \Typo3Console\CreateReferenceCommand\Command\CommandReferenceRenderCommand::class, + 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, + 'vendor' => 'typo3_console', + ], +]; diff --git a/Packages/CreateReferenceCommand/Configuration/Console/Commands.php b/Packages/CreateReferenceCommand/Configuration/Console/Commands.php deleted file mode 100644 index a36eb37a..00000000 --- a/Packages/CreateReferenceCommand/Configuration/Console/Commands.php +++ /dev/null @@ -1,12 +0,0 @@ - [ - 'commandreference:render' => [ - 'class' => \Typo3Console\CreateReferenceCommand\Command\CommandReferenceRenderCommand::class, - 'runLevel' => \Helhum\Typo3Console\Core\Booting\RunLevel::LEVEL_COMPILE, - 'vendor' => 'typo3_console', - ], - ], -]; diff --git a/Tests/Console/Unit/Fixtures/Command/TestCommandController.php b/Tests/Console/Unit/Fixtures/Command/TestCommandController.php index 4435243e..5e9844cd 100644 --- a/Tests/Console/Unit/Fixtures/Command/TestCommandController.php +++ b/Tests/Console/Unit/Fixtures/Command/TestCommandController.php @@ -14,9 +14,14 @@ * */ -class TestCommandController +use Helhum\Typo3Console\Mvc\Controller\CommandController; + +class TestCommandController extends CommandController { - public function helloCommand() + /** + * @param string $foo Foo bar + */ + public function helloCommand(string $foo = '') { } } diff --git a/Tests/Console/Unit/Mvc/Cli/CommandConfigurationTest.php b/Tests/Console/Unit/Mvc/Cli/CommandConfigurationTest.php index 3871d56e..718bd8b0 100644 --- a/Tests/Console/Unit/Mvc/Cli/CommandConfigurationTest.php +++ b/Tests/Console/Unit/Mvc/Cli/CommandConfigurationTest.php @@ -69,9 +69,11 @@ public function validationThrowsExceptionOnInvalidRegistration(array $configurat public function unifyCommandConfigurationMovesGlobalOptionsToCommandConfiguration() { $expected = [ - 'bar:baz' => [ + [ 'class' => 'bla', 'vendor' => 'foobar', + 'name' => 'bar:baz', + 'nameSpacedName' => 'foobar:bar:baz', 'runLevel' => 'normal', 'bootingSteps' => ['one'], 'replace' => ['replaced:command'], @@ -140,8 +142,10 @@ public function unifyCommandConfigurationMovesGlobalRunLevelOptionsToCommandConf public function unifyCommandConfigurationMovesGlobalRunLevelOptionsToCommandConfiguration(string $commandName, array $runLevels) { $expected = [ - $commandName => [ + [ 'vendor' => 'baz', + 'name' => $commandName, + 'nameSpacedName' => 'baz:' . $commandName, 'runLevel' => 'normal', ], ]; @@ -165,10 +169,13 @@ public function unifyCommandConfigurationMovesGlobalRunLevelOptionsToCommandConf public function commandControllerCommandsAreResolved() { $expected = [ - 'test:hello' => [ + [ 'vendor' => 'typo3_console', + 'name' => 'test:hello', + 'nameSpacedName' => 'typo3_console:test:hello', 'controller' => TestCommandController::class, 'controllerCommandName' => 'hello', + 'lateCommand' => false, ], ]; $actual = CommandConfiguration::unifyCommandConfiguration(