[TASK] Refactor low level console commands to avoid full boot
This will allow for low level commands like cache:warmup (or flush) to be implemented. Commands that're registered in (internal!) service providers are now defined to be lowlevel. That allows to change behaviour for internal commands only, without being breaking. Low level commands… * will only be defined by TYPO3 core, not by third party extensions or libraries (despite by using internal interfaces) * will not use any $GLOBALS in constructor * will only inject dependencies defined by service providers * must not require a database connection during construction * will only be defined in internal service providers * may use the internal BootService to bootstrap to a certain boot level Regular commands… * are allowed to access TYPO3_CONF_VARS in constructor * are allowed to inject any service via constructor * are allowed to access TCA in constructor * may perform database calls in constructors (although this is not recommended) * may fail during construction, e.g. because of a stale DI container (an upcoming low level cache:flush/warmup command will be provided for such scenarios) The command list `bin/typo3 list`… * will show all low level commands * will degrade to low level only commands if the DI container is not loadable The upgrade command therefore now runs fully uncached and does not require a full boot upfront. The symfony command `help` is treated as non low level command, as command constructors need to be executed in order for arguments to be configured and available for help output. Therefore a full boot is required. This causes the symfony DI container, ext_localconf and ext_tables to be loaded. That means: An invalid container cache will cause help to fail, `list` will degrade do lowlevel commands, but an (upcoming) low level console command cache:flush/warmup will still be invokable and is intended for scenarios where 3rd party code is changed and therefore DI/localconf/TCA cache became stale. `typo3/cms-cli`, which provides vendor/bin/typo3 in composer mode, is adapted in: https://github.com/TYPO3/cms-cli/pull/5 Commands used for updating typo3/cms-cli: composer require typo3/cms-cli:^3.0 composer require typo3/cms-cli:^3.0 \ --no-update --working-dir=typo3/sysext/core Resolves: #86248 Related: #93174 Releases: master Change-Id: Ie7cfb73983d96ed67532570be4099a25d106db28 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67241 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Helmut Hummel <typo3@helhum.io> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Helmut Hummel <typo3@helhum.io> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- composer.json 1 addition, 1 deletioncomposer.json
- composer.lock 11 additions, 11 deletionscomposer.lock
- typo3/sysext/core/Classes/Command/Descriptor/TextDescriptor.php 11 additions, 1 deletion...sysext/core/Classes/Command/Descriptor/TextDescriptor.php
- typo3/sysext/core/Classes/Command/ListCommand.php 18 additions, 4 deletionstypo3/sysext/core/Classes/Command/ListCommand.php
- typo3/sysext/core/Classes/Console/CommandApplication.php 71 additions, 18 deletionstypo3/sysext/core/Classes/Console/CommandApplication.php
- typo3/sysext/core/Classes/Core/BootService.php 155 additions, 0 deletionstypo3/sysext/core/Classes/Core/BootService.php
- typo3/sysext/core/Classes/DependencyInjection/ContainerBuilder.php 3 additions, 0 deletions...ext/core/Classes/DependencyInjection/ContainerBuilder.php
- typo3/sysext/core/Classes/ServiceProvider.php 18 additions, 2 deletionstypo3/sysext/core/Classes/ServiceProvider.php
- typo3/sysext/core/Resources/Private/Php/cli.php 1 addition, 1 deletiontypo3/sysext/core/Resources/Private/Php/cli.php
- typo3/sysext/core/composer.json 1 addition, 1 deletiontypo3/sysext/core/composer.json
- typo3/sysext/install/Classes/Command/UpgradeWizardListCommand.php 1 addition, 1 deletion...sext/install/Classes/Command/UpgradeWizardListCommand.php
- typo3/sysext/install/Classes/Command/UpgradeWizardRunCommand.php 1 addition, 1 deletion...ysext/install/Classes/Command/UpgradeWizardRunCommand.php
- typo3/sysext/install/Classes/Service/LateBootService.php 6 additions, 124 deletionstypo3/sysext/install/Classes/Service/LateBootService.php
Please register or sign in to comment