-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancements to module:status command #15543
Enhancements to module:status command #15543
Conversation
$allModules = $this->getAllModules(); | ||
if (!in_array($moduleName, $allModules->getNames())) { | ||
$output->writeln('<error>Module does not exist</error>'); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add return \Magento\Framework\Console\Cli::RETURN_FAILURE;
here to indicate something went wrong similar to here
https://github.com/jissereitsma/magento2/blob/047097beeed4d70f437270db34681f9022ffee67/setup/src/Magento/Setup/Console/Command/AbstractMaintenanceCommand.php#L86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I was in a rush to finalize things, but did not like the return of no error nice anyway. This is fixed now in ca4282e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[x] Review looks good
[x] Local testing passed
Hi @vadimjustus, thank you for the review. |
Hi @jissereitsma. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Awesome thanks. I'll work on Magento 2.3 port soon. |
Description
The CLI command
module:status
provides a listing of all enabled and disabled modules. However, it is hard to determine whether a certain module is enabled or disabled: You always need scrolling and the output is not easily parsed for further automation. This PR adds a couple of things:First of all, you can inspect the status of a specific module using a command
module:status Foo_Bar
which either reportsModule is enabled
orModule is disabled
or a warningModule does not exist
.Second, you can add
--enabled
or--disabled
to only list either enabled modules or disabled modules. I didn't make this bastard-proof, so specifying both options at once (--enabled --disabled
) will just run (theenabled
flag is interpreted first in PHP.The original behaviour of
bin/magento module:status
remains untouched. The entire CLI class is cleaned up: Importing namespaces, PHP 7 argument hinting and method extraction.Fixed Issues (if relevant)
Not relevant.
Manual testing scenarios
With this PR you are able to run the commands as described above.
Contribution checklist