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

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

userfrosting/config
===================

Configuration module for UserFrosting

4.5.0(5y ago)147.9k↓73.3%3MITPHPPHP &gt;=7.1

Since Mar 29Pushed 5y ago4 watchersCompare

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

READMEChangelog (9)Dependencies (3)Versions (13)Used By (0)

Config module for UserFrosting 4
================================

[](#config-module-for-userfrosting-4)

[![Latest Version](https://camo.githubusercontent.com/cfee5c1a9f4cc07d29ad06f14ebca9f63ff4916311f9742397e23088ebc42b17/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7573657266726f7374696e672f636f6e6669672e737667)](https://github.com/userfrosting/config/releases)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Join the chat at https://chat.userfrosting.com/channel/support](https://camo.githubusercontent.com/3ef275424b9a67f2277aea0eeb294f16f16660d8fc4073a0a988298d626d4c5a/68747470733a2f2f636861742e7573657266726f7374696e672e636f6d2f6170692f76312f736869656c642e7376673f6e616d653d5573657246726f7374696e67)](https://chat.userfrosting.com/channel/support)[![Donate](https://camo.githubusercontent.com/9b77bd2b1b19b6b8fcbff67c4cfa703b0ab2c936b33ce26d534e1222cbdcdea6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f70656e253230436f6c6c6563746976652d446f6e6174652d626c75652e737667)](https://opencollective.com/userfrosting#backer)

BranchBuildCoverageStyle[master](https://github.com/userfrosting/config)[![](https://github.com/userfrosting/config/workflows/Build/badge.svg?branch=master)](https://github.com/userfrosting/config/actions?query=workflow%3ABuild)[![](https://camo.githubusercontent.com/a7792f56095ea791e2f3f77001179fd5ba24b3b3afb1183826fc02f05c549575/68747470733a2f2f636f6465636f762e696f2f67682f7573657266726f7374696e672f636f6e6669672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/userfrosting/config)[![](https://camo.githubusercontent.com/43cd3bd2f74ee1244739050e6f1914fa172c9257296e9d6a70cd3d8b9ef4b7c9/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f35343935353133342f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://github.styleci.io/repos/54955134)[develop](https://github.com/userfrosting/config/tree/develop)[![](https://github.com/userfrosting/config/workflows/Build/badge.svg?branch=develop)](https://github.com/userfrosting/config/actions?query=workflow%3ABuild) [![](https://camo.githubusercontent.com/c5b768ad2cd7633cba9c26e77b7cbcb25b0a7729dc2f7621e4d6ff4bf860f43a/68747470733a2f2f636f6465636f762e696f2f67682f7573657266726f7374696e672f636f6e6669672f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/userfrosting/config)[![](https://camo.githubusercontent.com/b5ccbe8e33ae261688a0b912a83f1f7b05192f1e764671d0b44a78e3c112e7bb/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f35343935353133342f736869656c643f6272616e63683d646576656c6f70267374796c653d666c6174)](https://github.styleci.io/repos/54955134)Usage
-----

[](#usage)

Create a file `default.php`, in a directory `/path/to/core/config/`:

**default.php**

```
return [
    'contacts' => [
        'housekeeper' => [
            'name' => 'Alex',
            'email' => 'alex@cleansthetoilet.com'
        ]
    ]
];

```

Suppose now you have another config file which can override values in this base config file. For example, in `/path/to/plugin/config/`, you have:

**default.php**

```
return [
    'contacts' => [
        'housekeeper' => [
            'name' => 'Alex "the man" Weissman'
        ]
    ]
];

```

You can generate an ordered list of these configuration files using the `ConfigPathBuilder` class, and merge them together using an instance of `UserFrosting\Support\Respository\Loader\ArrayFileLoader`.

### Path builder

[](#path-builder)

Create `ResourceLocator` and `ConfigPathBuilder` classes to build a list of configuration files:

```
$locator = new ResourceLocator(__DIR__);
$locator->registerLocation('core', 'path/to/core');
$locator->registerLocation('plugin', 'path/to/plugin');
$locator->registerStream('config', '', 'config/');

$builder = new ConfigPathBuilder($locator, 'config://');
$paths = $builder->buildPaths();

// Generates a list of paths:
[
    '/core/config/default.php'
    '/plugin/config/default.php'
]

```

### Data loader

[](#data-loader)

You can then use the `ArrayFileLoader` class to load and merge all configuration data from this list of paths:

```
$loader = new \UserFrosting\Support\Respository\Loader\ArrayFileLoader($builder->buildPaths());
$config = new \UserFrosting\Support\Respository\Repository($loader->load());

```

Config files in multiple paths will be merged in the order in which the paths are specified. You can now access your configuration data via the standard `Repository` methods:

```
echo $config->get('contacts.housekeeper.name');
// Prints 'Alex'

```

You can also specify environment-specific config files in each path. If an environment name is passed to `buildPaths()`, `ConfigPathBuilder` will merge in the environment-specific file in a path immediately after merging in `default.php`:

**development.php**

```
return [
    'database' => [
        'password' => 'sup3rC-cr3t'
    ]
];

```

To merge this in, you would call:

```
$paths = $builder->buildPaths('development');

```

[Style Guide](STYLE-GUIDE.md)
-----------------------------

[](#style-guide)

[Testing](RUNNING_TESTS.md)
---------------------------

[](#testing)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 69.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~184 days

Recently: every ~207 days

Total

11

Last Release

1889d ago

Major Versions

1.1 → 4.0.02017-02-18

PHP version history (3 changes)v1.0PHP &gt;=5.5.9

4.1.0PHP &gt;=5.6

4.3.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5004534?v=4)[Alex Weissman](/maintainers/alexweissman)[@alexweissman](https://github.com/alexweissman)

---

Top Contributors

[![lcharette](https://avatars.githubusercontent.com/u/2566513?v=4)](https://github.com/lcharette "lcharette (32 commits)")[![alexweissman](https://avatars.githubusercontent.com/u/5004534?v=4)](https://github.com/alexweissman "alexweissman (14 commits)")

---

Tags

userfrostinguserfrosting-componentconfigurationconfiguserfrosting

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/userfrosting-config/health.svg)

```
[![Health](https://phpackages.com/badges/userfrosting-config/health.svg)](https://phpackages.com/packages/userfrosting-config)
```

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k514.6M1.9k](/packages/symfony-options-resolver)[league/config

Define configuration arrays with strict schemas and access values with dot notation

565323.7M35](/packages/league-config)[dflydev/dot-access-configuration

Given a deep data structure representing a configuration, access configuration by dot notation.

13414.5M4](/packages/dflydev-dot-access-configuration)[dmishh/settings-bundle

Database centric Symfony configuration management. Global and per-user settings supported.

114256.9k1](/packages/dmishh-settings-bundle)[jbtronics/settings-bundle

A symfony bundle to easily create typesafe, user-configurable settings for symfony applications

9558.8k3](/packages/jbtronics-settings-bundle)[caseyamcl/configula

A simple, but versatile, PHP config loader

42148.7k6](/packages/caseyamcl-configula)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
