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

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

jenner/config
=============

PHP configurations loading

0.5.0(11y ago)038MITPHPPHP &gt;=5.4

Since Dec 26Pushed 11y ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (12)Used By (0)

Config
======

[](#config)

[![Build Status](https://camo.githubusercontent.com/240cdcf3ef2555c3a57dc09f4e3279e2acf5fb3eced69232aec0562c719d587b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73696e657267692f636f6e6669672f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/sinergi/config)[![Latest Stable Version](https://camo.githubusercontent.com/aa8f0d041910526e7753ff337d293e14bf93e3389d149763d63fb701f8fe09d4/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e657267692f636f6e6669672e7376673f7374796c653d666c6174)](https://packagist.org/packages/sinergi/config)[![Total Downloads](https://camo.githubusercontent.com/d18b9c98d7ed04c5f5761934d80abb4871cdc8c2844b10018322e7af68c6dfa2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696e657267692f636f6e6669672e7376673f7374796c653d666c6174)](https://packagist.org/packages/sinergi/config)[![License](https://camo.githubusercontent.com/d6cfbca02a6e842bd3758b6a9be83e7314dd66460b413425f68d7ede1addeca2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73696e657267692f636f6e6669672e7376673f7374796c653d666c6174)](https://packagist.org/packages/sinergi/config)

PHP configurations loading library. It is made to enable your application to have different configurations depending on the environment it is running in. For example, your application can have different configurations for unit tests, development, staging and production. A good practice would be to **not include** your production or staging configurations in your version control. To do this, simply add a `.gitignore` file to your `configs/environment` directory with the following lines:

```
*
!.gitignore

```

Requirements
------------

[](#requirements)

This library uses PHP 5.3+.

Installation
------------

[](#installation)

It is recommended that you install the Config library [through composer](http://getcomposer.org/). To do so, add the following lines to your `composer.json` file.

```
{
    "require": {
       "sinergi/config": "dev-master"
    }
}
```

Usage
-----

[](#usage)

Setup the configurations directory:

```
use Sinergi\Config\Config;

$config = new Config(__DIR__ . "/configs");
```

Optionally, you can also setup the environment. Setting up the environment will merge normal configurations with configurations in the environment directory. For example, if you setup the environment to be *prod*, the configurations from the directory `configs/prod/*` will be loaded on top of the configurations from the directory `configs/*`. Consider the following example:

```
$config->setEnvironment('prod');
```

You can than use the configurations like this:

```
$config->get('app.timezone');
```

Getter
------

[](#getter)

The configuration getter uses a simple syntax: `file_name.array_key`.

For example:

```
$config->get('app.timezone');
```

You can optionally set a default value like this:

```
$config->get('app.timezone', "America/New_York");
```

You can use the getter to access multidimensional arrays in your configurations:

```
$config->get('database.connections.default.host');
```

Setter
------

[](#setter)

Alternatively, you can set configurations from your application code:

```
$config->set('app.timezone', "Europe/Berlin");
```

You can set entire arrays of configurations:

```
$config->set('database', [
    'host' => "localhost",
    'dbname' => "my_database",
    'user' => "my_user",
    'password' => "my_password"
]);
```

Examples
--------

[](#examples)

See more examples in the [examples folder](https://github.com/sinergi/config/tree/master/examples).

Example of a configuration file:

```
return [
    'timezone' => "America/New_York"
];
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~33 days

Recently: every ~69 days

Total

10

Last Release

4251d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

0.5.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d132b55d12cd603f8cce9c152999e2b3f98748d56fe8a21adf62d5830d88d87?d=identicon)[huyanping](/maintainers/huyanping)

---

Top Contributors

[![gabrielbull](https://avatars.githubusercontent.com/u/671923?v=4)](https://github.com/gabrielbull "gabrielbull (21 commits)")[![white-poto](https://avatars.githubusercontent.com/u/4362540?v=4)](https://github.com/white-poto "white-poto (13 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")

---

Tags

configmanagementloadingconfigurations

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/jenner-config/health.svg)](https://phpackages.com/packages/jenner-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

564323.7M35](/packages/league-config)[northwoods/config

Simple configuration loader

1616.0k](/packages/northwoods-config)

PHPackages © 2026

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