PHPackages                             byjg/config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. byjg/config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

byjg/config
===========

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

6.0.0(5mo ago)411.3k↓40.9%2MITPHPPHP &gt;=8.3 &lt;8.6CI passing

Since Mar 18Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/byjg/php-config)[ Packagist](https://packagist.org/packages/byjg/config)[ GitHub Sponsors](https://github.com/byjg)[ RSS](/packages/byjg-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (22)Used By (2)

Configuration and Dependency Injection
======================================

[](#configuration-and-dependency-injection)

[![Sponsor](https://camo.githubusercontent.com/fab14b7f7f475072ada0473f193d6f322561fd4a2958e0cc89910d053347cf27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d2532336561346161613f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d306431313137)](https://github.com/sponsors/byjg)[![Build Status](https://github.com/byjg/php-config/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/byjg/php-config/actions/workflows/phpunit.yml)[![Opensource ByJG](https://camo.githubusercontent.com/425c1bbccc0f292bf4d20569ae74a6b2e384fd648f1af8911bc61de9a8dcfc0b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f70656e736f757263652d62796a672d737563636573732e737667)](http://opensource.byjg.com)[![GitHub source](https://camo.githubusercontent.com/88e61eb211719144efdd570290a0456b6e13099c2df8d973f1bb43fe33bf0039/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769746875622d736f757263652d696e666f726d6174696f6e616c3f6c6f676f3d676974687562)](https://github.com/byjg/php-config/)[![GitHub license](https://camo.githubusercontent.com/85708afcd2354e3bbf4b4ba74666ad19473b9fd92b112258fecc54584684024c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f62796a672f7068702d636f6e6669672e737667)](https://opensource.byjg.com/license/)[![GitHub release](https://camo.githubusercontent.com/c5774a4b70e851c442b06a495b59f070ab89ae4593c4dbd3212a9430af58c597/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f62796a672f7068702d636f6e6669672e737667)](https://github.com/byjg/php-config/releases/)

This is a basic and minimalist implementation of PSR-11 for config management and dependency injection.

Features
--------

[](#features)

- **PSR-11 Compatible**: Implements PSR-11 Container Interface for standardized dependency injection
- **Auto-Initialization**: Automatically loads configuration from a bootstrap file with zero setup
- **Static Facade**: Clean, Laravel-style static API for accessing configuration anywhere
- **Environment-Based Configuration**: Easily switch between development, production, and custom environments
- **Multiple Configuration Formats**: Support for both PHP arrays and .env files
- **Dependency Injection**: Simple API for defining and resolving dependencies
- **Type Conversion**: Built-in parsers for converting configuration values to specific types
- **Caching Support**: Optional caching of configuration values for improved performance
- **Environment Inheritance**: Environments can inherit from one another to reduce configuration duplication
- **Abstract &amp; Final Environments**: Design flexible environment hierarchies with constraints
- **Performance Optimizations**: Configure caching modes for different use cases

Quick Start with Auto-Initialization
------------------------------------

[](#quick-start-with-auto-initialization)

The fastest way to get started is using the auto-initialization feature:

```
