PHPackages                             minond/configurare - 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. minond/configurare

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

minond/configurare
==================

Configuration management

v2.0.0(12y ago)0499GPL-2.0+PHPPHP &gt;=5.4.0

Since Jan 31Pushed 12y ago1 watchersCompare

[ Source](https://github.com/minond/Configurare)[ Packagist](https://packagist.org/packages/minond/configurare)[ RSS](/packages/minond-configurare/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Configurare
===========

[](#configurare)

[![Build Status](https://camo.githubusercontent.com/fe2fea7411fc60249b80e9fe1401982c2cc11c0d61b8fbfa41fa41839e2ddc61/68747470733a2f2f7472617669732d63692e6f72672f6d696e6f6e642f436f6e66696775726172652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/minond/Configurare)[![Coverage Status](https://camo.githubusercontent.com/41bb7845ec53b6de25f01f279fcf2a8f4c6eab633b43bbbd5198d4ff55e42d4d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d696e6f6e642f436f6e66696775726172652f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/minond/Configurare?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/03127838b0b5d17e1d3bd0673dc06f4245e737106b4a233298c81da83494de72/68747470733a2f2f706f7365722e707567782e6f72672f6d696e6f6e642f636f6e66696775726172652f762f737461626c652e706e67)](https://packagist.org/packages/minond/configurare)[![Dependencies Status](https://camo.githubusercontent.com/2248673ac22dabb5d1ab9ab466ed1066dedea818a892393f66f6e7ddc2c07c9d/68747470733a2f2f646570656e64696e672e696e2f6d696e6f6e642f436f6e66696775726172652e706e67)](http://depending.in/minond/Configurare)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/29179e183b593445b7fa7c1341ae56b1e0b1f1491889eb1e1eb17e04aa74e8c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696e6f6e642f436f6e66696775726172652f6261646765732f7175616c6974792d73636f72652e706e673f733d36666535663838666563303131356633666365653862663362633234626432363965343537623963)](https://scrutinizer-ci.com/g/minond/Configurare/)[![SensioLabsInsight](https://camo.githubusercontent.com/619cf433d8d542b952f96e13d58a61197d40eca5f693c99befbc00717cd2391f/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33656434653465622d306331362d343665612d613239662d6231636132303431663135632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/3ed4e4eb-0c16-46ea-a29f-b1ca2041f15c)

Sample usage
------------

[](#sample-usage)

#### Initializing configuration

[](#initializing-configuration)

```
use Efficio\Configurare\Configuration;

$conf = new Configuration;
$conf->setDirectory('./config/');
```

```
# config/app.yml
name: 'My Application'
usa:
  utah:
    provo:
      author: 'Marcos Minond'
```

#### Configuring configuratio file formats and parsers

[](#configuring-configuratio-file-formats-and-parsers)

```
// available parsers
use Efficio\Configurare\Parser\Json;

$conf->setExtension('.json'); // default is '.yml'
$conf->setParser(new Json); // default is Efficio\Configurare\Parser\Yaml
```

#### Using custom formats

[](#using-custom-formats)

```
use Efficio\Configurare\Parser\Parser;

class CustomParser implements Parser
{
    /**
     * takes a raw string, parses it, and returns the array representing the
     * data
     * @param string $raw
     * @return array
     */
    public function decode($raw)
    {
        return unserialize($raw);
    }

    /**
     * takes an array or an object and converts it into a string that can be
     * saved in a file
     * @param mixed $obj
     * @return string
     */
    public function encode($obj)
    {
        return serialize($obj);
    }
}

$conf->setExtension('.custom');
$conf->setParser(new CustomParser);
```

#### Getting values

[](#getting-values)

```
// looks for in ./config/app.yml
// this gets [ 'name': ]
echo $conf->get('app:name'); // => My Application

// this gets [ 'usa': 'utah': 'provo': 'author': ]
echo $conf->get('app:usa:utah:provo:author'); // => Marcos Minond

// you can also get nested configuration files
// looks in config/users/2014/jan.yml
echo $conf->get('users/2014/jan:activities:music');
```

#### Setting values

[](#setting-values)

```
// if a key(s) already exists, just set it
$conf->set('app:name', 'My Other Application');

// if they do not then the write must be forced by passing a third parameter
// set to true
$conf->set('app:does:not:exists:yet', 'yes', true);
```

```
# config/app.yml
name: 'My Other Application'
usa:
  utah:
    provo:
      author: 'Marcos Minond'
does:
  not:
    exists:
      yet: 'yes'
```

#### Enviroments

[](#enviroments)

Adding enviroments allows additional configuration files, which may or may not be tracked by version control, to be used. For example, you may commit a "default" config/app.yml configuration file which makes assumptions about the enviroments (ie. database connection information) and overwrite it using config/app.prod.yml. This "prod" file has data which is sensative and is only stored in the production server where your application is running. This allows you to use the same configuration retrieval code, get the correct configuration for your enviroments, AND not have to check that into source control.

```
// I can have one enviroment or multiple
$conf->setEnvironments([ 'dev', 'test' ]);

// the following files will be parsed and merged before the configuration
// value is sent back
// - config/database.yaml
// - config/database.dev.yaml
// - config/database.test.yaml
$conf->get('database:connection:username');
```

#### Caching

[](#caching)

Configurare is compatible with the [Cache](https://github.com/minond/Cache) package

```
use Efficio\Cache\NullCache;
$conf->setCache(new NullCache);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

3

Last Release

4479d ago

Major Versions

v1.0.1 → v2.0.02014-02-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/3edcb2fa5ed594ffb1c9d8d8c36c06540b74755f4cdef4d4e69d71c3c7c7495e?d=identicon)[minond](/maintainers/minond)

---

Top Contributors

[![minond](https://avatars.githubusercontent.com/u/601509?v=4)](https://github.com/minond "minond (48 commits)")

### Embed Badge

![Health badge](/badges/minond-configurare/health.svg)

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

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[lullabot/drainpipe

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

41716.4k2](/packages/lullabot-drainpipe)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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