settings-manager-bundle icon indicating copy to clipboard operation
settings-manager-bundle copied to clipboard

YamlSettingsProvider

Open soifou opened this issue 6 years ago • 3 comments

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

soifou avatar Mar 19 '19 10:03 soifou

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

martiis avatar Mar 22 '19 07:03 martiis

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.

elparici75 avatar Mar 23 '19 09:03 elparici75

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 :)

martiis avatar Mar 25 '19 20:03 martiis