PHPackages                             dflydev/dot-access-configuration - 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. dflydev/dot-access-configuration

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

dflydev/dot-access-configuration
================================

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

v2.0.1(1y ago)13414.5M↓20.7%7[3 issues](https://github.com/dflydev/dflydev-dot-access-configuration/issues)4MITPHPPHP &gt;=7.4CI passing

Since Jul 17Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dflydev/dflydev-dot-access-configuration)[ Packagist](https://packagist.org/packages/dflydev/dot-access-configuration)[ Docs](https://github.com/dflydev/dflydev-dot-access-configuration)[ RSS](/packages/dflydev-dot-access-configuration/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (9)Used By (4)

Dot Access Configuration
========================

[](#dot-access-configuration)

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

This library combines [dflydev/dot-access-data](https://github.com/dflydev/dflydev-dot-access-data)and [dflydev/placeholder-resolver](https://github.com/dflydev/dflydev-placeholder-resolver)to provide a complete configuration solution.

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

[](#requirements)

- PHP (5.3+)
- [dflydev/dot-access-data](https://github.com/dflydev/dflydev-dot-access-data) (^3)
- [dflydev/placeholder-resolver](https://github.com/dflydev/dflydev-placeholder-resolver) (1.x)
- [symfony/yaml](https://github.com/symfony/Yaml) (&gt;2,&lt;2.2) *(suggested)*

Usage
-----

[](#usage)

Generally one will use an implementation of `ConfigurationBuilderInterface`to build `ConfigurationInterface` instances. For example, to build a Configuration out of a YAML file, one would use the `YamlFileConfigurationBuilder`:

```
use Dflydev\DotAccessConfiguration\YamlFileConfigurationBuilder;

$configurationBuilder = new YamlFileConfigurationBuilder('config/config.yml');
$configuration = $configurationBuilder->build();
```

Once created, the Configuration instance behaves similarly to a Data instance from [dflydev/dot-access-data](https://github.com/dflydev/dflydev-dot-access-data).

```
$configuration->set('a.b.c', 'ABC');
$configuration->get('a.b.c');
$configuration->set('a.b.e', array('A', 'B', 'C'));
$configuration->append('a.b.e', 'D');
```

Custom Configurations
---------------------

[](#custom-configurations)

Configuration Builders use Configuration Factories and Placeholder Resolver Factories behind the scenes in order to build a working configuration.

Under normal circumstances one should not need to do anything with the Placeholder Resolver Factory. However, one may wish to extend the default `Configuration` class or use an entirely different implementation altogether.

In order to build instances of custom `ConfigurationInterface` implementations with the standard builders, one would need to implement `ConfigurationFactoryInterface` and inject it into any `ConfigurationBuilderInterface`.

If a Configuration is declared as follows:

```
namespace MyProject;

use Dflydev\DotAccessConfiguration\Configuration;

class MyConf extends Configuration
{
    public function someSpecialMethod()
    {
        // Whatever you want here.
    }
}
```

Create the following factory:

```
namespace MyProject;

use Dflydev\DotAccessConfiguration\ConfigurationFactoryInterface;

class MyConfFactory implements ConfigurationFactoryInterface
{
    /**
     * {@inheritdocs}
     */
    public function create()
    {
        return new MyConf;
    }
}
```

To use the factory with any builder, inject it as follows:

```
use Dflydev\DotAccessConfiguration\YamlFileConfigurationBuilder;
use MyProject\MyConfFactory;

$configurationBuilder = new YamlFileConfigurationBuilder('config/config.yml');

// Inject your custom Configuration Factory
$configurationBuilder->setConfigurationFactory(new MyConfFactory);

// Will now build instances of MyConfFactory instead of
// the standard Configuration implementation.
$configuration = $configurationBuilder->build();
```

License
-------

[](#license)

This library is licensed under the New BSD License - see the LICENSE file for details.

Community
---------

[](#community)

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance46

Moderate activity, may be stable

Popularity59

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% 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 ~664 days

Recently: every ~760 days

Total

8

Last Release

401d ago

Major Versions

1.x-dev → v2.0.02023-01-06

PHP version history (2 changes)v1.0.0-BETA1PHP &gt;=5.3.2

1.x-devPHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d6029bd16a0e8a9b97358a75b54affa6baadc1d9b0ca7eab2b6dd6c681ad7a8?d=identicon)[simensen](/maintainers/simensen)

---

Top Contributors

[![simensen](https://avatars.githubusercontent.com/u/191200?v=4)](https://github.com/simensen "simensen (18 commits)")[![zaherg](https://avatars.githubusercontent.com/u/27624?v=4)](https://github.com/zaherg "zaherg (3 commits)")[![jmolivas](https://avatars.githubusercontent.com/u/366275?v=4)](https://github.com/jmolivas "jmolivas (1 commits)")[![ArnaudLigny](https://avatars.githubusercontent.com/u/80580?v=4)](https://github.com/ArnaudLigny "ArnaudLigny (1 commits)")[![pronskiy](https://avatars.githubusercontent.com/u/1196825?v=4)](https://github.com/pronskiy "pronskiy (1 commits)")[![mikeSimonson](https://avatars.githubusercontent.com/u/907613?v=4)](https://github.com/mikeSimonson "mikeSimonson (1 commits)")[![beryllium](https://avatars.githubusercontent.com/u/602491?v=4)](https://github.com/beryllium "beryllium (1 commits)")

---

Tags

configurationconfig

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dflydev-dot-access-configuration/health.svg)

```
[![Health](https://phpackages.com/badges/dflydev-dot-access-configuration/health.svg)](https://phpackages.com/packages/dflydev-dot-access-configuration)
```

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

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

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

564302.2M24](/packages/league-config)[dmishh/settings-bundle

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

115254.9k1](/packages/dmishh-settings-bundle)[caseyamcl/configula

A simple, but versatile, PHP config loader

42146.6k6](/packages/caseyamcl-configula)[illuminatech/array-factory

Allows DI aware object creation from array definition

2159.6k6](/packages/illuminatech-array-factory)[michaels/data-manager

Simple data manager for nested data, dot notation array access, extendability, and container interoperability.

121.9k2](/packages/michaels-data-manager)

PHPackages © 2026

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