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

Add support to nested variables #38

Closed henriquemoody closed 11 years ago

henriquemoody commented 11 years ago

I have to do more tests, but I wanna see what you think about the idea to have nested variables.

file.ini

db.driver = "mysql"
db.host   = "localhost"
db.name   = "my_database"
db.dsn    = "[db.driver]:host=[db.host];dbname=[db.name]"

file.php

$container = new Container('file.ini');
var_export($container->db);

output

array(
    'driver' => 'mysql',
    'host' => 'localhost',
    'name' => 'my_database',
    'dsn' => 'mysql:host=localhost;dbname=my_database',
)
nickl- commented 11 years ago

@henriquemoody I like this, why did you close?

Merge it =)

henriquemoody commented 11 years ago

I do not remember exactly why, but discussing with @augustohp he told me something and then I close it.

nickl- commented 11 years ago

@henriquemoody Hmmm hence why we should keep convos on-line. For us and the rest of the community.

I thought this was clever.

As you wish...

henriquemoody commented 11 years ago

I was just waiting @augustohp remind what he told me and write something here, that's why I mentioned him, but...

nickl- commented 11 years ago

giant panda photo credit zack neher 10 google-panda-update-228x250 5661176303_0b2aa82ecb panda_on_a_tree

I can't find @augustohp either!