-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Description (*)
Magento applications come out of the box with a few particularly "heavy to initialize" CLI commands. Two examples: \Magento\Setup\Console\Command\InstallCommand
and \Magento\Setup\Console\Command\ConfigSetCommand
. Each of these probes all installed modules for ConfigOptionsList classes, initializes them, and reads options from them. That work is not necessary unless the user is interacting with either these commands, though it's currently necessary due to the fact that each command added directly to a Symfony Console app must have a Definition.
Expected behavior (*)
Without going too far into designing the implementation, I'd like to see an alternative to the \Magento\Framework\Console\CommandListInterface
which defines a return value similar to that of the \Symfony\Component\Console\CommandLoader\CommandLoaderInterface
. I'd additionally like to see Magento implement this alternative Command loading technique especially for time-consuming commands such as those listed in the description.
Benefits
Currently, a command must be "fully initialized" to be ready to add to Magento. This means it must be instantiated at runtime, along with its dependencies, definition, etc. In order to minimize the impact of new commands, extra care must be taken to use factories and proxies in dependencies.
If new commands can be added to Magento's CLI app without being fully initialized, implementors can be free to focus on the features.
Additional information
If this is a desired change, I'd be happy to request time from my employer to implement it and contribute it to the community. Thanks for considering it!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status