-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Console] Commands auto-registration is deprecated #8269
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
Conversation
console.rst
Outdated
@@ -38,6 +38,19 @@ For example, a command called ``CreateUser`` must follow this structure:: | |||
} | |||
} | |||
|
|||
If you're using the :ref:`default services.yml configuration <service-container-services-load-example>`, |
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.
Considering that this is the Console article, this explanation about services may be a bit advanced and/or confusing. Imagine you are a user reading the article: you just want to create and run some commands. You don't even need to know what a service is.
So, why don't we reword the first paragraph to tell the user something like this:
Symfony registers any PHP class extending from Command as a console command automatically, so you can now execute this command as
.......
.
And keep the mention of services and tags for the .. note
.
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.
I like the idea! However I'm not sure I did exactly what you wanted, can you check?
console.rst
Outdated
@@ -64,12 +64,26 @@ method. Then you can optionally define a help message and the | |||
Executing the Command | |||
--------------------- | |||
|
|||
After configuring the command, you can execute it in the terminal: | |||
Symfony registers any PHP class extending from :class:`Symfony\\Component\\Console\\Command\\Command` |
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.
from
console.rst
Outdated
@@ -64,12 +64,26 @@ method. Then you can optionally define a help message and the | |||
Executing the Command | |||
--------------------- | |||
|
|||
After configuring the command, you can execute it in the terminal: | |||
Symfony registers any PHP class extending from :class:`Symfony\\Component\\Console\\Command\\Command` | |||
as a console command automatically, so you can now execute this command in the |
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.
[...] automatically. So you [...]
console.rst
Outdated
|
||
Otherwise, Symfony looks in the ``Command/`` directory of bundles for commands | ||
non registered as a service but this is deprecated since Symfony 3.4 and | ||
won't be supported in Symfony 4.0. |
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 should move this whole paragraph into a caution
block?
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.
done
The text on line 19 of
You can reference this article on the subject, with the relevant information summarized below.
|
@robfrawley I didn't know that, thanks for the explanation! It's fixed now. |
Thank you @GuilhemN. |
…emN) This PR was squashed before being merged into the 3.4 branch (closes #8269). Discussion ---------- [Console] Commands auto-registration is deprecated Document symfony/symfony#23805. I wonder, should I update https://github.com/symfony/symfony-docs/blob/17d1c39298e9415886e2c712748d3021ed7865a4/bundles/best_practices.rst L122 (`Command/ Yes`) ? As it is not really mandatory to use the `Command/` directory anymore. Commits ------- 493ae89 [Console] Commands auto-registration is deprecated
I think we should take that into account in #7156 |
* 3.4: (42 commits) [#8273] fix bundle registration code [#8273] minor rewording Reworded the built-in web server articles for Symfony 3.3 fix diff code block highlighting [#8269] minor rewording [Console] Commands auto-registration is deprecated [#8231] fix reStructuredText syntax Specified import order of config files [#7981] revert some changes Update upload_file.rst Update usage.rst Update doctrine.rst Update usage.rst [#8260] add missing redirection map entry Delete use_virtuals_forms.rst Added a missing redirection Update validation_group_service_resolver.rst Update redirection_map Update button_based_validation.rst Delete group_service_resolver.rst ...
Document symfony/symfony#23805.
I wonder, should I update https://github.com/symfony/symfony-docs/blob/17d1c39298e9415886e2c712748d3021ed7865a4/bundles/best_practices.rst L122 (
Command/ Yes
) ? As it is not really mandatory to use theCommand/
directory anymore.