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

Let plugins provide their own config #6609

Closed
tsteur opened this issue Nov 6, 2014 · 3 comments
Closed

Let plugins provide their own config #6609

tsteur opened this issue Nov 6, 2014 · 3 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@tsteur
Copy link
Member

tsteur commented Nov 6, 2014

See #6607

Plugins, even our plugins shipped with core, should ideally not add any config entries to /config/global.ini.php. Sometimes plugins can maybe use the Settings API instead of a config but this is not always possible or not always wanted see ThaDafinser/Piwik-IntranetGeoIP#5.

As a plugin should represent the core they could provide their own config/global.ini.php eg /plugins/ScheduledReports/config/global.ini.php.

It is still nice to have all possible config entries in one file for users. Therefore we could maybe merge it automatically into a section [PluginName] config entries from plugin... in /config/global.ini.php. Although a plugin would then have to know that it needs to access its config entries with $config['PluginName]->configentry. So we'd maybe have to provide a Plugin Config API.

Maybe we could also allow plugins to change default settings this way? Although this can be already done using the Config API (only kinda, not in the same way as of "Global Config overwritten by Plugin Config overwritten by User Config").

There might be better solutions... I've only identified this "problem" so far but haven't thought so much about possible solutions.

@tsteur tsteur added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Nov 6, 2014
@tsteur
Copy link
Member Author

tsteur commented Nov 6, 2014

Another possibility could be to let users retrieve the config via a command and also let users change config entries via a command so it wouldn't matter whether they are in different files or not.

eg
config:list, config:get configentry, config:set configentry value etc. There could be also options / arguments for searching for config entries etc

@tsteur tsteur added this to the Short term milestone Nov 7, 2014
@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Dec 1, 2014
@mnapoli
Copy link
Contributor

mnapoli commented Dec 2, 2014

Have a look at #6656 I'm suggesting to add configs in plugins

@tsteur
Copy link
Member Author

tsteur commented Jan 16, 2018

With DI this is implemented.

@tsteur tsteur closed this as completed Jan 16, 2018
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Mar 27, 2018
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. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

3 participants