Skip to content

[spiral/config] Refactored config files loading system. Now, it uses a new way to manage config directories and file loaders. #1218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

butschster
Copy link
Member

This PR improves how configuration files are loaded in spiral/config. The new system makes config management more flexible and structured.

What's changed:

  • Introduced a new way to manage config directories and file loaders.
  • Added two loading strategies:
    • SingleFileStrategyLoader – loads the first available config file.
    • MergeFileStrategyLoader – finds and merges multiple config files.
  • Deprecated the old directory-based loader.
  • Updated tests to support the new logic.

These changes improve modularity and allow better handling of different configuration structures. 🚀

…age config directories and file loaders.

 - `SingleFileStrategyLoader` loads the first found config file.
- `MergeFileStrategyLoader` finds all matching config files and merges them.

The old way of loading configs is now deprecated. Tests updated to match new logic.
@butschster butschster moved this from Todo to In review in Spiral framework Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

Load config based on APP_ENV
2 participants