10000 [FEATURE] Implement lazy console command list · TYPO3-CMS/lowlevel@6e85067 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e85067

Browse files
bnfhelhum
authored andcommitted
[FEATURE] Implement lazy console command list
Based on the configuration syntax of the Symfony Console feature symfony/symfony#39851 …but implemented differently, using a registry pattern rather then a lazy-object pattern (like symfony does). Main motiviation for the registry pattern is following: Symfony LazyCommand wrappers add quite some complexity only for the sake of the list command, we already got lazy commands (in terms of execution) as our CommandRegistry implements the ConfigurationLoaderInterface that has been introduced by 2017 to add support for lazy commands. Now, that means we already got a registry for lazy commands, so it is logical to add lazy description handling there as well. We want to assure that the command list will never instantiate any commands. This is in constrast to the Symfony core LazyCommand approach, where legacy commands, that do not provide a compile time description, would still be instantiated during console command list. Also commands that return false in `isEnabled()` are now listed. That means enabled state is only evaluated during runtime. Therefore the special `dumpautoload` command is transformed into a lowlevel command in order to be hidden dependending on being run in composer-mode or not. Releases: master Resolves: #93174 Change-Id: Ifa68404cc81c64a335be30f2263a7eb17de0624d Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67635 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: core-ci <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Helmut Hummel <typo3@helhum.io> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Helmut Hummel <typo3@helhum.io>
1 parent 7aea8dd commit 6e85067

9 files changed

+8
-8
lines changed

Classes/Command/CleanFlexFormsCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function __construct(ConnectionPool $connectionPool)
5252
public function configure()
5353
{
5454
$this
55-
->setDescription('Updates all database records which have a FlexForm field and the XML data does not match the chosen datastructure.')
5655
->setHelp('Traverse page tree and find and clean/update records with dirty FlexForm values. If you want to get more detailed information, use the --verbose option.')
5756
->addOption(
5857
'pid',

Classes/Command/DeletedRecordsCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function __construct(ConnectionPool $connectionPool)
5252
public function configure()
5353
{
5454
$this
55-
->setDescription('Permanently deletes all records marked as "deleted" in the database.')
5655
->setHelp('Traverse page tree and find and flush deleted records. If you want to get more detailed information, use the --verbose option.')
5756
->addOption(
5857
'pid',

Classes/Command/FilesWithMultipleReferencesCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function __construct(ConnectionPool $connectionPool, BasicFileUtility $ba
5959
public function configure()
6060
{
6161
$this
62-
->setDescription('Looking for files from TYPO3 managed records which are referenced more than once')
6362
->setHelp('
6463
Assumptions:
6564
- a perfect integrity of the reference index table (always update the reference index table before using this tool!)

Classes/Command/ListSysLogCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class ListSysLogCommand extends Command
3535
*/
3636
public function configure()
3737
{
38-
$this->setDescription('Show entries from the sys_log database table of the last 24 hours.');
3938
$this->setHelp('Prints a list of recent sys_log entries.' . LF . 'If you want to get more detailed information, use the --verbose option.');
4039
}
4140

Classes/Command/LostFilesCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public function __construct(ConnectionPool $connectionPool)
5050
public function configure()
5151
{
5252
$this
53-
->setDescription('Looking for files in the uploads/ folder which does not have a reference in TYPO3 managed records.')
5453
->setHelp('
5554
Assumptions:
5655
- a perfect integrity of the reference index table (always update the reference index table before using this tool!)

Classes/Command/MissingFilesCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public function __construct(ConnectionPool $connectionPool)
5050
public function configure()
5151
{
5252
$this
53-
->setDescription('Find all file references from records pointing to a missing (non-existing) file.')
5453
->setHelp('
5554
Assumptions:
5655
- a perfect integrity of the reference index table (always update the reference index table before using this tool!)

Classes/Command/MissingRelationsCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(ConnectionPool $connectionPool)
5757
public function configure()
5858
{
5959
$this
60-
->setDescription('Find all record references pointing to a non-existing record')
6160
->setHelp('
6261
Assumptions:
6362
- a perfect integrity of the reference index table (always update the reference index table before using this tool!)

Classes/Command/OrphanRecordsCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function __construct(ConnectionPool $connectionPool)
4949
public function configure()
5050
{
5151
$this
52-
->setDescription('Find and delete records that have lost their connection with the page tree.')
5352
->setHelp('Assumption: All actively used records on the website from TCA configured tables are located in the page tree exclusively.
5453
5554
All records managed by TYPO3 via the TCA array configuration has to belong to a page in the page tree, either directly or indirectly as a version of another record.

Configuration/Services.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,49 @@ services:
1111
tags:
1212
- name: 'console.command'
1313
command: 'syslog:list'
14+
description: 'Show entries from the sys_log database table of the last 24 hours.'
1415

1516
TYPO3\CMS\Lowlevel\Command\MissingFilesCommand:
1617
tags:
1718
- name: 'console.command'
1819
command: 'cleanup:missingfiles'
20+
description: 'Find all file references from records pointing to a missing (non-existing) file.'
1921

2022
TYPO3\CMS\Lowlevel\Command\LostFilesCommand:
2123
tags:
2224
- name: 'console.command'
2325
command: 'cleanup:lostfiles'
26+
description: 'Looking for files in the uploads/ folder which does not have a reference in TYPO3 managed records.'
2427

2528
TYPO3\CMS\Lowlevel\Command\FilesWithMultipleReferencesCommand:
2629
tags:
2730
- name: 'console.command'
2831
command: 'cleanup:multiplereferencedfiles'
32+
description: 'Looking for files from TYPO3 managed records which are referenced more than once'
2933

3034
TYPO3\CMS\Lowlevel\Command\MissingRelationsCommand:
3135
tags:
3236
- name: 'console.command'
3337
command: 'cleanup:missingrelations'
38+
description: 'Find all record references pointing to a non-existing record'
3439

3540
TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand:
3641
tags:
3742
- name: 'console.command'
3843
command: 'cleanup:deletedrecords'
44+
description: 'Permanently deletes all records marked as "deleted" in the database.'
3945

4046
TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand:
4147
tags:
4248
- name: 'console.command'
4349
command: 'cleanup:orphanrecords'
50+
description: 'Find and delete records that have lost their connection with the page tree.'
4451

4552
TYPO3\CMS\Lowlevel\Command\CleanFlexFormsCommand:
4653
tags:
4754
- name: 'console.command'
4855
command: 'cleanup:flexforms'
56+
description: 'Updates all database records which have a FlexForm field and the XML data does not match the chosen datastructure.'
4957

5058
TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\ProviderRegistry:
5159
public: true

0 commit comments

Comments
 (0)
0