Remove Loader as a top-level package and split its responsibilities across Config, Environment, and helper boot
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
Research direction
Start by tracing the responsibilities and usages across src/Loader/Loader.php, src/Loader/Setup.php, src/Config/Config.php, src/Environment/Environment.php, src/Storage/Uploads/UploadConfigProvider.php, and src/App/Stages/LoadHelpersStage.php. Verify the existing hierarchical resolution behavior and identify the tests and docs affected before separating ownership. Done means Loader is no longer a top-level package, the new owners preserve compatible behavior, and tests and docs are updated as needed.
Written by the indexing model from the issue text.
Description
Summary
Refactor the current Loader package out of the top-level framework architecture.
Its responsibilities should be split into the places that actually own them:
- hierarchical config file resolution should belong to
Config - environment bootstrap file resolution should belong to
Environment - helper loading should be handled separately and should not justify
Loaderremaining its own package
Why
Right now Loader acts like a standalone package, but the code shows it is mostly a shared utility for unrelated internal concerns.
Current usages include:
Configloading hierarchical config filesEnvironmentloading env bootstrap configUploadConfigProviderprobing/loading optional uploads config- helper directory loading during boot
This is a weak package boundary.
The most obvious mismatch is Environment: environment bootstrap should not depend on a separate generic loader package just to resolve a small config file that determines which .env file to load.
Current Behavior to Preserve
For config loading, preserve the current hierarchical resolution behavior:
- resolve the module-scoped file first
- if the setup is hierarchical and the module file does not exist, fall back to the shared file
For config imports that currently means:
modules/<module>/config/<file>.php- then
shared/config/<file>.php
Proposed Changes
- remove
Loaderas a standalone top-level package concept - move hierarchical config file resolution into
Config - move environment bootstrap file resolution into
Environment - update
UploadConfigProviderso its optional config lookup follows the new ownership boundaries - keep helper loading as a separate concern and do not let it define the long-term architecture of
Loader
Acceptance Criteria
Loaderis no longer treated as a standalone top-level packageConfigowns hierarchical config file resolutionEnvironmentno longer relies onLoaderfor its bootstrap config resolutionUploadConfigProviderno longer relies on a generic top-level loader abstraction if a more local ownership model is available- existing hierarchical config behavior remains compatible
- tests and docs are updated as needed
Notes
Relevant code:
src/Loader/Loader.phpsrc/Loader/Setup.phpsrc/Config/Config.phpsrc/Environment/Environment.phpsrc/Storage/Uploads/UploadConfigProvider.phpsrc/App/Stages/LoadHelpersStage.php
- Dominant language
- PHP
- Stars
- 36
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quantum-php/framework
-
routing testing
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
quantum-php/framework#547 ·
-
view
Difficulty 1/5 Under an hour Newbie friendliness 75/100
quantum-php/framework#542 ·
-
enhancement http
Difficulty 5/5 Over a week Newbie friendliness 35/100
quantum-php/framework#565 · 1 comment ·
-
components view
Difficulty 5/5 Over a week Newbie friendliness 42/100
quantum-php/framework#551 ·
-
Add explicit @version special route token support for API major versioning within a single module Openrouting
Difficulty 5/5 Over a week Newbie friendliness 45/100
quantum-php/framework#550 ·
All issues in quantum-php/framework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
a11y admissions.uiowa.edu needs grooming SiteImprove best practice
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Save States Menu Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pluginsGLPI/datainjection#673 ·