- What problem does rich-id/configuration-bundle solve?
- It gives PHP applications a single, predictable entry point for defining and reading configuration values instead of scattering settings across source files. Defaults, per-environment overrides, and validation are handled in one place, so missing or malformed values fail early rather than at runtime. The goal is configuration that is explicit, testable, and easy to evolve as a project grows.
- How do I install rich-id/configuration-bundle with Composer?
- Install it like any other Composer package with composer require rich-id/configuration-bundle; the package is listed on Packagist under that vendor name. Because dependencies are minimal, it drops into an existing project without pulling in a large framework stack. After installing, wire the configuration services into your container or bundle registration and point them at your config files.
- Does rich-id/configuration-bundle work with Laravel?
- The bundle is built around Symfony-style service wiring, so its native integration path is a Symfony application rather than Laravel's service provider system. In a Laravel project you would typically register the configuration services manually in a service provider and resolve them from Laravel's container. If you want zero-friction Laravel integration, Laravel's built-in config repository may be the simpler choice.
- How does environment-aware configuration overriding work in this bundle?
- Settings are defined once with sensible defaults, and each environment can supply its own overrides without duplicating the whole config tree. That keeps environment-specific values out of your source code and makes the difference between staging and production explicit. The resolved configuration is then exposed through the same consistent API regardless of environment.
- What kind of validation does the bundle provide for configuration values?
- Validation is built into the loading process, so required keys and malformed values are caught early instead of surfacing as confusing errors deep in your application. This makes misconfiguration a startup problem rather than a production incident. The validation surface is intentionally small and focused, matching the package's lightweight design.
- Can I use rich-id/configuration-bundle in a standalone PHP project without a full framework?
- Yes, the package is framework-friendly rather than framework-locked, and it has minimal dependencies. You can instantiate the configuration services yourself or wire them through any PSR-11 compatible container. You only need a full Symfony application if you want the bundle's automatic registration conveniences.
- How do I test code that depends on configuration values?
- Because all settings are read through a single, consistent API, you can substitute known values in your test bootstrap or inject a prepared configuration object into the code under test. That removes reliance on real environment variables and makes assertions deterministic. Validation also helps tests fail loudly when a required fixture value is missing.
- Is it a replacement for Laravel's config files and .env handling?
- No, it is an alternative approach rather than a drop-in replacement. Laravel's config repository and .env loading are tightly integrated with the framework, while this bundle focuses on centralizing defaults, environment overrides, and validation behind one API. Teams that want stricter, self-validating configuration sometimes use it alongside, or instead of, ad-hoc config arrays.
- Which PHP versions are supported and how heavy are the dependencies?
- The package is described as lightweight with a small, focused surface area and minimal dependencies, which keeps its footprint low in production. Exact PHP and Symfony version constraints are declared in the package's composer.json, so check that file or the Packagist listing before upgrading a major PHP version. There is no config caching layer to warm, so runtime overhead is negligible.
- How is the package maintained and where should I report issues?
- The source lives at github.com/rich-id/configuration-bundle, which is the right place to open issues and pull requests. Check the repository's release history and recent commit activity to judge how actively it is maintained before adopting it. Pinning a known-good version in composer.json is a sensible precaution for long-lived projects.