feat: add ConfigPlugin to auto-load module config files#131
Open
calebdw wants to merge 3 commits intoInterNACHI:mainfrom
Open
feat: add ConfigPlugin to auto-load module config files#131calebdw wants to merge 3 commits intoInterNACHI:mainfrom
calebdw wants to merge 3 commits intoInterNACHI:mainfrom
Conversation
This project uses tabs for PHP indentation. Adding an .editorconfig helps editors and IDEs respect this convention automatically. - PHP: tabs (project convention) - JSON: 4 spaces - YAML: 2 spaces - All files: UTF-8, LF line endings, final newline
Introduces a registration-phase hook for plugins, mirroring the existing boot-phase pattern. Plugins can use #[OnRegister] attribute to run during the service provider's register() method instead of boot(). This is needed for plugins like config loading that must complete before other services are resolved.
Add ConfigPlugin that automatically discovers and loads configuration files from module config/ directories. Module configs are merged with app-level configs, where app-level config values take precedence over module defaults.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
In our project, we created a base service provider which allows every module to have its own config file (here we place things like the morph_map for that module and other module-specific configs). With the new plugin system, I figured this would be great to PR upstream.
Example:
This has 3 commits:
.editorconfigto keep my editor (neovim btw 🙃) from trying to convert tabs to spaces---feel free to customizeOnRegisterattribute that allows plugins to hook intoregisterConfigPluginThanks!