PHPackages                             icanboogie/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. icanboogie/config

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

icanboogie/config
=================

Synthesizes low-level configurations.

v1.3.0(4y ago)04.2k↓84.6%1BSD-3-ClausePHPPHP &gt;=5.5

Since Jan 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ICanBoogie/Config)[ Packagist](https://packagist.org/packages/icanboogie/config)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-config/feed)WikiDiscussions 6.0 Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (8)Used By (1)

Config
======

[](#config)

[![Release](https://camo.githubusercontent.com/286f558bbd0d9fd3749f0ebd1bd40656c0151933568e55d0a3d0385961425851/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f636f6e6669672e737667)](https://packagist.org/packages/icanboogie/config)[![Code Coverage](https://camo.githubusercontent.com/9b1b64e48ce1d79131eea6732aaacf4a3218041316ce4167f1807a61af9cc1b4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f436f6e6669672f62616467652e7376673f6272616e63683d362e30)](https://coveralls.io/r/ICanBoogie/Config?branch=6.0)[![Downloads](https://camo.githubusercontent.com/7630842b7ca734922e0ffcd5676e737c414a4963accdfde71f8fe75a73f82779/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6963616e626f6f6769652f636f6e6669672e737667)](https://packagist.org/packages/icanboogie/config)

An API to build low-level configuration.

This package is used by the framework [ICanBoogie](https://icanboogie.org/) to configure its components.

Configurations are defined by a set of files called *fragments*. Builders use these fragments to build configurations. Configurations are managed by a \[Config\]\[\] instance. Configurations can be cached, which cancels the cost of the builds.

#### Installation

[](#installation)

```
composer require icanboogie/config
```

Configuration fragments
-----------------------

[](#configuration-fragments)

A configuration fragment is a PHP file returning a callable. Multiple fragments are used to build a configuration. They're usually located in "config" directories and are usually named after the config they are used to build.

Configuration provider
----------------------

[](#configuration-provider)

Configurations are read through a [ConfigProvider](lib/ConfigProvider.php).

The following example demonstrates how to get a configuration of class `MyConfig`:

```
