Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import INI config in DI config #6648

Merged
merged 4 commits into from Nov 27, 2014
Merged

Import INI config in DI config #6648

merged 4 commits into from Nov 27, 2014

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Nov 12, 2014

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.<section>.<key>, 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.:

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)

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).

@mnapoli mnapoli added c: Performance For when we could improve the performance / speed of Matomo. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. and removed c: Performance For when we could improve the performance / speed of Matomo. labels Nov 12, 2014
mnapoli added a commit that referenced this pull request Nov 27, 2014
Import INI config in DI config
@mnapoli mnapoli merged commit 315b6fe into master Nov 27, 2014
@mnapoli mnapoli deleted the di-config branch November 27, 2014 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant