settings-manager-bundle
settings-manager-bundle copied to clipboard
YamlSettingsProvider
I don't know if this is a bad practice but do you consider to implement a YamlSettingsProvider?
One of my app have some global settings that must be shared between users and I thought it would be nice to just read/write inside several YAML files depending on the domain they came from.
For example:
config
├── settings
│ ├── domain1.yaml
│ ├── domain2.yaml
│ └── domain3.yaml
hi, sorry for delay. Actually you can
helis_settings_manager:
settings_files:
- '%kernel.project_dir%/config/settings/domain1.yaml'
- '%kernel.project_dir%/config/settings/domain2.yaml'
- '%kernel.project_dir%/config/settings/domain3.yaml'
also there is an example in tests https://github.com/HelisLT/settings-manager-bundle/blob/a861e9b7d7844a3e8e9f68d8812a5a3f1ef81da2/tests/app/config/config_test.yml#L63
Hi, Of what I understood, I think the question was to be able to update directly the Yaml config files when you edit a setting (without having to store it via Doctrine or in a cookie). For example if you edit a value configured in '%kernel.project_dir%/config/settings/domain1.yaml', this yaml file would directly be updated on save.
IMHO I don't think its a good idea. Writable file provider will not be very performant, especially not php file, because opcache wont work with it. f.e. why symfony container is built into few large php files from multiple and various configuration formats, is that it could execute fast and faster with opcache. Well thats my opinion :)