Closed stollr closed 1 year ago
I don't think this make sense to have 2 ways todo the same thing. There exist specific for this case the bin/websiteconsole
:
bin/websiteconsole debug:container --tag controller.service_arguments
Having two ways of doings things is mostly bad. Still it is possible as you mostly already know to adopt this in your project if it is a requirement for you.
Also keep in mind you should not build something baseed on the sulu.context
. As the Two Kernel Setup will be one of the things which will be removed in the future.
Okay, now I understand the difference between bin/adminconsole and bin/websiteconsole. That wasn't completely clear to me, until now.
Also keep in mind you should not build something baseed on the sulu.context. As the Two Kernel Setup will be one of the things which will be removed in the future.
Understood.
What's in this PR?
This PR makes it possible to define the kernel context for the console commands per ENV variables.
Why?
Symfony provides several debugging commands. For example you can debug the container to list all services with a specified tag. For example
The problem is that this command would only list the admin controllers. All controllers of the website context will be hidden.
Example Usage
To change the kernel context, it will be possible to easily get the services of the website context. This could be done by prefixing the console command with
SULU_CONTEXT=website
Alternatively you can export the variable to the environment of subsequently executed commands. This will give you the same result as in the above example.