Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] Added suggestions for missing packages#29865
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chalasr commentedJan 13, 2019
I like the idea. |
ro0NL commentedJan 13, 2019
i'd prefer something like we did for twig:https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/UndefinedCallableHandler.php i think its more straightforward to handle it in e.g. a catch-all event listener for unknown commands, opposed to tracking a list on high level (console application). |
przemyslaw-bogusz commentedJan 13, 2019
I had some doubts adding it to the main application, since it is widely used as a standalone component, but I wanted the suggestions to be available for some, who started his project with a symfony/skeleton (so without the FrameworkBundle) and tries to use features, that are not installed. By the way, can you tell me, why my CI checks failed? Did I forget about something in my PR? |
przemyslaw-bogusz commentedJan 13, 2019
My mistake. I confused FrameworkBundle with SensioFrameworkExtraBundle. I will rework the PR. But my other question about the CI checks is still valid :) |
268e80f to4f0d498Compareprzemyslaw-bogusz commentedJan 14, 2019
I went with the suggestion from@ro0NL and created an event subscriber. I can always switch to a try/catch inFrameworkBundle Console Application. |
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
018f91a to7c80043Compare
chalasr left a comment
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.
We will need some tests
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
56f0342 to3bf0806Compareprzemyslaw-bogusz commentedJan 17, 2019
I improved the logic. For example, when someone hasWebServerBundle and runs |
1d72a56 toda6f7edComparesrc/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
0217579 to8149049Compareprzemyslaw-bogusz commentedFeb 13, 2019
@fabpot Done. |
nicolas-grekas left a comment
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.
(with minor comment)
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
8149049 tod178ad5Comparesrc/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
d178ad5 to7c6a2d1Comparesrc/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
7c6a2d1 toc6b803eComparesrc/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
f3187ec toba3f404Compareprzemyslaw-bogusz commentedFeb 14, 2019
Too many reviews in a short period of time and things got a little messy for a moment. I've implemented all suggestions the code, fixed the tests. The one Travis CI test that fails, failed before and I guess it has nothing to do with my code directly. The only thing left to decide is whether to put |
ba3f404 tof1cf2f5Comparefabpot commentedFeb 21, 2019
Thank you@przemyslaw-bogusz. |
…myslaw-bogusz)This PR was squashed before being merged into the 4.3-dev branch (closes#29865).Discussion----------[Console] Added suggestions for missing packages| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| License | MITCurrently, when someone runs one of the most common commands, e.g. `server:run`, but does not have a required package installed, they will get a general **'There are no commands defined...'** message.This commit adds a more useful message, informing the user about a package that might be missing and suggesting a command that should be run in order to install it, e.g. `composer require symfony/web-server-bundle --dev`.Commits-------423a54f [Console] Added suggestions for missing packages
Currently, when someone runs one of the most common commands, e.g.
server:run, but does not have a required package installed, they will get a general'There are no commands defined...' message.This commit adds a more useful message, informing the user about a package that might be missing and suggesting a command that should be run in order to install it, e.g.
composer require symfony/web-server-bundle --dev.