Project

General

Profile

Actions

Feature #89139

closed

Epic #83968: PSR-11 Initiative

Symfony Console Commands should be able to use dependency injection

Added by Benjamin Franzke about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Category:
CLI
Start date:
2019-09-11
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The CommandRegistry instantiates all Commands with a constructor argument (command name).
That means GeneralUtility::makeInstance can not offload to the dependency injection container.

Furthermore all commands are instantiates (always), independent from the command that is actually executed.

It should be made possible to use dependency injection for commands.
Bonus would be registration of console commands via DI tags.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #90450: Defining an alias for a command overwrites its original command nameClosed2020-02-20

Actions
Related to TYPO3 Core - Task #91534: Remove deprecated Commands.php loadingClosedBenjamin Franzke2020-05-29

Actions
Actions

Also available in: Atom PDF