New in Symfony 4.1: Hidden services
In Symfony 3.4 we made all Symfony services private by default. This is generally better and makes applications more robust (as explained in the previous post) but it also has some drawbacks.
debug:container command for example hides the private services by
default, so it's no longer useful to list the services available in your
application. That's why in Symfony 4.1 we've changed the
command to show the private services by default and we've also deprecated the
Independently from being public or private, sometimes it's useful to hide some
services from the
debug:container listing because they are not intended for
being used by the developers. In those cases, you can add a dot character
.) at the beginning of the service ID to turn it into a "hidden service".
Hidden services behave like the rest of services, except for the fact that they
are not included by default in the output of
debug:container, so you must
add the new
--show-hidden option to show them:
$ ./bin/console debug:container --show-hidden
New in Symfony 4.1: Hidden services symfony.com/blog/new-in-symfony-4-1-hidden-servicesTweet this
Become a certified developer! Exams are online and available in all countries.Register Now
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.