yiisoft / config

Configuration management
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
31 stars 11 forks source link

Do not error on absent config files #124

Open samdark opened 1 year ago

samdark commented 1 year ago

Problem

Too many files returning [] in application's config directory.

Solution

Return [] if the file is not found instead of throwing exception.

To save clarity about what config files are read we can do https://github.com/yiisoft/config/issues/125

cebe commented 1 year ago

absent files could be allowed by adding the ? marker. Returning empty array on a required file does not seem to be a good idea to me.

vjik commented 1 year ago

Seems, idea of issue — make all files always optional.

terabytesoftw commented 1 year ago

Suppose this case, i have an app without providers.php, but i installed an extension that has the config of providers.php, then it should be guaranteed, that if I have them as optional, it builds the config, without throwing any exception, i think from this is what the topic is about.

vjik commented 1 year ago

Suppose this case, i have an app without providers.php, but i installed an extension that has the config of providers.php, then it should be guaranteed, that if I have them as optional, it builds the config, without throwing any exception, i think from this is what the topic is about.

It's good case. If it doesn't work that way, it needs to be fixed.