skip to Main Content

In Magento 2 we store config data which is only relevant for production in the env.php – so it is not included in DB dumps and such.

Is this possible in Shopware 6 ?

For example, if I have a plugin config like

JopsoMonitoring.config.sentryEnvironment I can already call
`bin/console system:config:set JopsoMonitoring.config.sentryEnvironment dev’

But can I also write something like

JopsoMonitoring.config.sentryEnvironment in the .env?

2

Answers



  1. That’s currently not supported, but it’s an interesting idea. The SystemConfigService relies on the settings being stored in the database so the service would have to be refactored to account for environment variables. A quick solution would be to write a CLI command implementation that uses dotenv to read the config settings, maybe detectable by a certain prefix, and persists the values via the SystemConfigService. That command could then be automated to be executed after deployment.

    If third-party tool are an option, you could have a look at shopware-cli that comes with a command to push config setting from a yml file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search