Need help with dflydev-dot-access-configuration?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

135 Stars 4 Forks MIT License 18 Commits 3 Opened issues


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

Services available


Need anything else?

Contributors list

Dot Access Configuration

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

This library combines dflydev/dot-access-data and dflydev/placeholder-resolver to provide a complete configuration solution.



Generally one will use an implementation of

to build
instances. For example, to build a Configuration out of a YAML file, one would use the
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.

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

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

class or use an entirely different implementation altogether.

In order to build instances of custom

implementations with the standard builders, one would need to implement
and inject it into any

If a Configuration is declared as follows: ```php namespace MyProject;

use Dflydev\DotAccessConfiguration\Configuration;

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

Create the following factory: ```php 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: ```php 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(); ```


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


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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.