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

Abandoned → [northwoods/config](/?search=northwoods%2Fconfig)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

sinergi/config
==============

PHP configurations loading

0.6.4(10y ago)3017.1k↑1293.3%9[1 issues](https://github.com/shadowhand/config/issues)2MITPHPPHP &gt;=5.6

Since Dec 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/shadowhand/config)[ Packagist](https://packagist.org/packages/sinergi/config)[ Docs](https://github.com/sinergi/config)[ RSS](/packages/sinergi-config/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (6)Versions (19)Used By (2)

Config
======

[](#config)

[![Build Status](https://camo.githubusercontent.com/e370058f9fdd6ae3d44dd2837658b70e954114cb2057233a1807be0bf36ba546/68747470733a2f2f7472617669732d63692e6f72672f73696e657267692f636f6e6669672e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/sinergi/config)[![StyleCI](https://camo.githubusercontent.com/0345a8ee7d41eb042c2c8d0128517d158e6b4ba230e687e4b12c2ed0fe57f508/68747470733a2f2f7374796c6563692e696f2f7265706f732f31353434353439392f736869656c64)](https://styleci.io/repos/15445499)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/993c6302a330bf5ffe18359a580ea757ba914665aa10fd49b3f4cd4a112b613c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696e657267692f636f6e6669672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sinergi/config/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/0df633ca58492036f7e09d65bd4f35697ce56b5c8ac3f44149c970e3ab2aed18/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696e657267692f636f6e6669672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sinergi/config/?branch=master)[![Code Climate](https://camo.githubusercontent.com/1aad170b5105a9b43db2657f7bda97f68f602940ae95398a9e7f1128a7c733c3/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f73696e657267692f636f6e6669672f6261646765732f6770612e737667)](https://codeclimate.com/github/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)[![SensioLabsInsight](https://camo.githubusercontent.com/5123ceb5cefd36472802a01dfdeb8685af4510ef5b94c38bfec372e66aa729a6/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34376232636539352d613831302d343364642d383233652d3438326162386536386561332f6d696e692e706e67)](https://insight.sensiolabs.com/projects/47b2ce95-a810-43dd-823e-482ab8e68ea3)[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/sinergi/config?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

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, Config supports [Dotenv](https://github.com/vlucas/phpdotenv).

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

[](#requirements)

This library uses PHP 5.6+.

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

[](#installation)

It is recommended that you install the Config library [through composer](http://getcomposer.org/). To do so, run the Composer command to install the latest stable version of Config:

```
composer require sinergi/config
```

Usage
-----

[](#usage)

Use the factory to instanciate a Config collection class:

```
use Sinergi\Config\Collection;

$config = Collection::factory([
    'path' => __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:

```
use Sinergi\Config\Collection;

$config = Collection::factory([
    'path' => __DIR__ . "/configs",
    'environment' => 'prod'
]);
```

Optionally, you can also use dotenv to hide sensible information into a `.env` file. To do so, specify a directory where the `.env` file. Like in this example:

```
use Sinergi\Config\Collection;

$config = Collection::factory([
    'path' => __DIR__ . "/configs",
    'dotenv' => __DIR__,
    'environment' => '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).

### PHP Configuration File

[](#php-configuration-file)

Example of a PHP configuration file:

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

### Yaml Configuration File

[](#yaml-configuration-file)

Example of a YAML configuration file:

```
timezone: America/New_York
```

### Dotenv

[](#dotenv)

Example of using Dotenv in a PHP configuration file:

```
return [
    'timezone' => env('TIMEZONE', "America/New_York")
];
```

And in the `.env` file:

```
TIMEZONE="America/Chicago"

```

License
-------

[](#license)

Config is licensed under The MIT License (MIT).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.7% 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 ~54 days

Recently: every ~60 days

Total

17

Last Release

3698d ago

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

0.5.0PHP &gt;=5.4

0.5.1PHP &gt;=5.3

0.6.0PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38203?v=4)[Woody Gilk](/maintainers/shadowhand)[@shadowhand](https://github.com/shadowhand)

![](https://www.gravatar.com/avatar/a3b6bf01b626fd571d50bbbe004923f52f6cdd3f4e1ba97066ada146688524d6?d=identicon)[sinergi](/maintainers/sinergi)

---

Top Contributors

[![gabrielbull](https://avatars.githubusercontent.com/u/671923?v=4)](https://github.com/gabrielbull "gabrielbull (42 commits)")[![white-poto](https://avatars.githubusercontent.com/u/4362540?v=4)](https://github.com/white-poto "white-poto (12 commits)")[![aak74](https://avatars.githubusercontent.com/u/3227024?v=4)](https://github.com/aak74 "aak74 (2 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/sinergi-config/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

43785.5k4](/packages/lullabot-drainpipe)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

318123.0k1](/packages/cognesy-instructor-php)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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