Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found an interesting issue today re config... when the config is saved, we reload the config afterwards in https://github.com/matomo-org/matomo/blob/3.12.0-b2/core/Config.php#L447
The problem is, that any
plugins/*/config/config.php
orconfig/config.php
that is changing the config using DI is then ignored when reloading the config. Looks like something like this:We're using this quite intensively in various places. I wonder in that case how to best re-initialise the config to make sure DI is executed again. Like removing it from DI, and then initialising it again using DI... would that work somehow? Problem is that maybe there could be still outdated references to the old config instance... I wonder maybe by default we should not reload the config simply? Not sure why we do it. It was likely not really an issue before since it would have simply saved all changes in
Config
to the local config and then reloaded it again.However, in a new plugin I will have an event to not save some config parameters to the config file. I will have an event
postEvent('Config.beforeSave', array(&$config))
where I then do something likeunset($config['General']['force_ssl'])
to avoid saving some values in the config. Eg to not save DB credentials in the config etc.