contao / manager-bundle

[READ-ONLY] Contao Manager Bundle
GNU Lesser General Public License v3.0
17 stars 10 forks source link

Allow to set basic Contao config in parameters.yml #7

Closed aschempp closed 7 years ago

aschempp commented 7 years ago

As long as the Contao Manager does not have config options, it is currently not possible to configure things like prepend_local. We should add them to the parameters.yml which is the only file that can be customized per installation.

The only other option would be for everyone to write a ContaoManagerPlugin, which is a bit over-engineered 😂

leofeyer commented 7 years ago

What about adding an empty app/config/config.yml file by default, which the user can adjust to their needs? Similar to the web/.htaccess file.

aschempp commented 7 years ago

I just had a thought about this. You can simply set whatever you want in the parameters.yml, right? You can also set contao.prepend_local in there? The parameters.yml is nothing else than a regular configuration file.

leofeyer commented 7 years ago

I guess so. The difference is that the parameters.yml file might be generated/overwritten by the install tool and then all the custom settings are gone. Therefore I'd prefer to have a config.yml file.

aschempp commented 7 years ago

Why would they be gone? We're reading and writing the whole file?

leofeyer commented 7 years ago

Yeah, we might be able to preserve the existing stuff, but it is still bad design IMO.

Technically, Symfony could use only one big parameters.yml file, too, but they are not for good reasons.

leofeyer commented 7 years ago

Then again, it is a managed edition and the users are not supposed to edit config files at all but use the GUI instead. So we do not need a config.yml I guess.

Actually, we do not even need the app folder, do we? We might as well store the parameters.yml file somewhere else.

aschempp commented 7 years ago

Absolutly, but its not that easy.

First of all, we're currently still relying on the install tool, which means we'll have a parameters.yml.

Secondly, even though contao 3 always had backend settings, it is still very much possible to edit some config files. Like dcaconfig or localconfig. So it's not like that would no longer be a use case. Same goes with the app bundle. A managed edition can still be customized by developers.

leofeyer commented 7 years ago

Removing the app folder does not work, because then realpath() cannot resolve "%kernel.root_dir%/..web" in Symfony anymore. :smile:

Ok, so:

  1. If we explicitly support editing config files, I'd prefer a config.yml file.
  2. Otherwise I'm fine with dumping everything into the parameters.yml file.
aschempp commented 7 years ago

Thanks to https://github.com/contao/manager-bundle/commit/5477fda5469e19d7df5451933815be49f5d661cd and https://github.com/contao/manager-bundle/commit/62a4abe6e869017741f03dec460a46a45dce59df the same parameters are now available as in our standard edition, though they don't need to be configured for the application to work.

Added import of app/config/config.yml in https://github.com/contao/manager-bundle/commit/804f1d6c1c2a84d55aa9ad7f96d0235771880176