Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Resource import order to overwrite partial data #13

Open
vimishor opened this issue Nov 6, 2014 · 3 comments
Open

Resource import order to overwrite partial data #13

vimishor opened this issue Nov 6, 2014 · 3 comments

Comments

@vimishor
Copy link

vimishor commented Nov 6, 2014

If I want to overwrite partial data from an imported resource, I need to list that file first, which is confusing.

For example, if I want to overwrite "parameters.yml::key2" from file "parameters_dev.yml", at this point in time I should do it like this:

# file: parameters.yml
key1: value1
key2: value2
key3: value3

# file parameters_dev.yml
key2: value20

# config.yml
imports:
  - { resource: parameters_dev.yml }
  - { resource: parameters.yml }

I would expect that parameters_dev.yml to be listed in config.yml after parameters.yml:

# config.yml
imports:
  - { resource: parameters.yml }
  - { resource: parameters_dev.yml }
@vimishor vimishor changed the title Overwrite partial data Resource import order to overwrite partial data Nov 6, 2014
@vimishor
Copy link
Author

vimishor commented Nov 6, 2014

@kherge If your are interested in this change, I could send a PR after #12 is merged.

@kherge
Copy link
Member

kherge commented Nov 6, 2014

Wise is modeled after how Symfony handles configuration settings, and I'm not sure how they handle this particular situation. However, what I do know is that this does not follow Symfony's configuration conventions. The "normal" way of overriding parameters is by loading them like this:

config_dev.yml:

imports:
    - { resource: parameters_dev.yml }
    - { resource: config.yml }

parameters_dev.yml:

imports:
    - { resource: parameters.yml }

key2: value20

parameters.yml:

key1: value1
key2: value2
key3: value3

@vimishor
Copy link
Author

vimishor commented Nov 6, 2014

Wise is modeled after how Symfony handles configuration settings, and I'm not sure how they handle this particular situation.

SF allows you to do this and handles the imports from the top to bottom, like I initially explained.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants