Respect / Config

A powerful, small, deadly simple configurator and dependency injection container DSL made to be easy
http://respect.github.io/Config
Other
98 stars 7 forks source link

Allow configuration inheritance #13

Closed augustohp closed 12 years ago

augustohp commented 12 years ago

It should be very useful, mainly for testing purposes, that we could inherit another configuration file, like:

database.staging.ini

[con Pdo]
dsn = mysql:host=localhost;dbname=test
username = root
password = ''

database.testing.ini

[con Pdo]
dsn = sqlite::memory:

ZendFramework does this in the same configuration file by using : in the section, this could be also be a way.

alganet commented 12 years ago

It is already possible to do this:

$container = new Respect\Config\Container;
$container->loadFile('staging.ini');
$container->loadFile('testing.ini');

One spec is merged onto the first one. You can load as many file as you want. Do we need more?

augustohp commented 12 years ago

Actually this works fine, just need to check if it suffers from I described in issue #14.

augustohp commented 12 years ago

That suffers from the issue #14, but this feature works like it should so I'm closing the issue.