Skip to content

[Console] More info returned by AboutCommand #29923

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

Closed

Conversation

przemyslaw-bogusz
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

This will make AboutCommand display additional information, indicating which basic symfony bundles are installed. For example:

bundles

As a consequence, a user will have a general idea about the commands that can be run, without having to go through composer.json, or checking if a command is available by trying something like php bin/console make:entity --help.

@javiereguiluz
Copy link
Member

Thanks for your (first) contribution to Symfony!

I'm not sure I understand the purpose of this change. You mentioned that instead of running bin/console make:entity and realize it doesn't exist, developers could run bin/console about, check the list of installed bundles ... and then remember which bundle does the command belong to and then decide if it's available or not. It looks more complicated to me :(

@przemyslaw-bogusz
Copy link
Contributor Author

This is a kind pf reverse of what I proposed here #29865. Image yourself in the followig situation:

  1. You are working in the terminal and want to create some entities and migrations. You don't know if you have the required bundles, i.e. if you can run the necessary commands like make:entity, or doctrine:migrations:migrate. You just run about and you know what is installed.

  2. Or you run one of these commands and get a CommandNotFoundException. What else is missing? Run about and you know.

I guess, an experienced Symfony user like you, never had to ask these kind of questions. But a less experienced, like me, had to. So it might be useful to somebody else. If anybody wonders, why not just show the list of commands - listing bundles instead of commands is better, bacuse the list is shorter.

@stof
Copy link
Member

stof commented Jan 18, 2019

but how many users know exactly which bundle provide which command when they don't have these bundles ?

And which non-installed bundles should we display in the list ? We would have to hardcode a list in Symfony for that (as that cannot rely on installed things). And then, how do we decide which bundle are allowed to enter that list ?

@linaori
Copy link
Contributor

linaori commented Jan 18, 2019

You are working in the terminal and want to create some entities and migrations. You don't know if you have the required bundles

I usually do this: $ composer show | grep the-bundle. It's not ideal and certainly doesn't match the bundle name, but it usually works. Though the command not found message also indicates that it isn't installed.

@przemyslaw-bogusz
Copy link
Contributor Author

@stof Yes, the list has to be hardcoded. I included the most common "internal" Symfony bundles, that provide commads.

@iltar That's why I thought that maybe modifying about would be a simpler way to get extra information.

To all. I created this PR as a byproduct of another one. It was a quick idea, and seeing your comments, it seems I should have given it more thought. If I don't get any positive reactions, I will close this PR within 24 hours.

@delirehberi
Copy link

I think this is cool but not necessary for a general purpose framework. Maybe one day, someone makes a command list database in flex servers and we improve CommandNotFoundException class, capable of command and bundle relation find.

@przemyslaw-bogusz
Copy link
Contributor Author

@delirehberi If I understand you correctly, this is a simple version of what you have in mind #29865

@delirehberi
Copy link

@przemyslaw-bogusz yes, that is related. But I suggest a command-package relation server for ideal resolution for that problem. The reason of server, hardcoded command-package relation data is not enough for fixing that problem.

However, this feature needs internet access. It`s not pretty for error handling.

@przemyslaw-bogusz przemyslaw-bogusz deleted the console_about branch January 21, 2019 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants