[various] Remove config/addon.config.php in favor of per-addon configuration file

This commit is contained in:
Hypolite Petovan 2022-11-20 11:43:42 -05:00
parent 5b25b03ea3
commit 46d4d0b51e
29 changed files with 137 additions and 206 deletions

View file

@ -30,14 +30,16 @@ Open the `config/local.config.php` file and add "piwik" to the list of activated
...
]
You can change 4 more configuration variables for the addon in the `config/addon.config.php` file:
You can change 4 more configuration variables for the addon in the `config/piwik.config.php` file:
'piwik' => [
'baseurl' => 'example.com/piwik/',
'sideid' => 1,
'optout' => true,
'async' => false,
],
return [
'piwik' => [
'baseurl' => 'example.com/piwik/',
'sideid' => 1,
'optout' => true,
'async' => false,
],
];
Configuration fields
---------------------

View file

@ -1,7 +1,7 @@
<?php
// Warning: Don't change this file! It only holds the default config values for this addon.
// Instead overwrite these config values in config/addon.config.php in your Friendica directory
// Instead, copy this file to config/piwik.config.php in your Friendica directory and set the correct values there
return [
'piwik' => [

View file

@ -16,14 +16,17 @@
*
* Configuration:
* Use the administration panel to configure the Piwik tracking addon, or
* in case you don't use this add the following lines to your config/addon.config.php
* in case you don't use this, add the following lines to your config/piwik.config.php
* file:
*
* [piwik]
* baseurl = example.com/piwik/
* sideid = 1
* optout = true ;set to false to disable
* async = false ;set to true to enable
* return [
* 'piwik' => [
* 'baseurl' => '',
* 'sideid' => '',
* 'optout' => true,
* 'async' => false,
* ],
* ];
*
* Change the siteid to the ID that the Piwik tracker for your Friendica
* installation has. Alter the baseurl to fit your needs, don't care
@ -60,7 +63,7 @@ function piwik_analytics(App $a, string &$b)
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/piwik/piwik.css' . '" media="all" />';
/*
* Get the configuration variables from the config/addon.config.php file.
* Get the configuration values.
*/
$baseurl = DI::config()->get('piwik', 'baseurl');
$siteid = DI::config()->get('piwik', 'siteid');