piwik/piwik — pull request #6648 by mnapoli (2014-11-12 03:45:24+00:00)
Title: Import INI config in DI config

I've added a compatibility layer for the INI config so that it can be used in PHP-DI config.

In order to avoid conflicts in config keys (between DI config and INI config), INI config is prefixed with `old_config` (so that it's easy to see which configs will be eventually replaced)

Entry names are formatted like this: `old_config.

.`, for example: `old_config.database.host` would be the same as calling `Config::getInstance()->database['host']`.

FYI you can also get a whole section as array, i.e. `old_config.database` is the same as `Config::getInstance()->database`.

That also mean that we can alias INI config entries into DI config, e.g.:

```php
return array(
'logger.level' => DI\link('old_config.log.log_level'),
);
```

(in that example `logger.level` is an alias to the old config key, if you are lost by the syntax [read here](http://php-di.org/doc/definition.html))

I'm not saying we should do all aliases now, but that will be useful to work on #6622 (configuring the logger in DI config while still using the old INI values for BC).