From 44d7a0b617acfc6f4dde38d856adafab419701a9 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 25 Nov 2018 02:15:18 -0500 Subject: [PATCH] [piwik] Update config file style/name --- piwik/README.md | 24 ++++++++++++++---------- piwik/config/piwik.config.php | 29 +++++++++++++++++++++++++++++ piwik/config/piwik.ini.php | 29 ----------------------------- piwik/piwik.php | 6 +++--- 4 files changed, 46 insertions(+), 42 deletions(-) create mode 100644 piwik/config/piwik.config.php delete mode 100644 piwik/config/piwik.ini.php diff --git a/piwik/README.md b/piwik/README.md index 44d906b6..9b35cc4b 100644 --- a/piwik/README.md +++ b/piwik/README.md @@ -20,20 +20,24 @@ Configuration The easiest way to configure this addon is by activating the admin panels of your ~friendica server and then enter the needed details on the config page for the addon. -If you don't want to use the admin panel, you can configure the addon through the config/local.ini.php file. +If you don't want to use the admin panel, you can configure the addon through the `config/local.config.php` file. -Open the config/local.ini.php file and add "piwik" to the list of activated addons. +Open the `config/local.config.php` file and add "piwik" to the list of activated addons. - [system] - addon = ...,piwik + 'system' => [ + ... + 'addon' => '...,piwik' + ... + ] -You can change 4 more configuration variables for the addon in the config/addon.ini.php file: +You can change 4 more configuration variables for the addon in the `config/addon.config.php` file: - [piwik] - baseurl = example.com/piwik/ - sideid = 1 - optout = true - async = false + 'piwik' => [ + 'baseurl' => 'example.com/piwik/', + 'sideid' => 1, + 'optout' => true, + 'async' => false, + ], Configuration fields --------------------- diff --git a/piwik/config/piwik.config.php b/piwik/config/piwik.config.php new file mode 100644 index 00000000..7543097c --- /dev/null +++ b/piwik/config/piwik.config.php @@ -0,0 +1,29 @@ + [ + // baseurl (String) + // This URL points to your Piwik installation. + // Use the absolute path, remember trailing slashes but ignore the protocol (http/s) part of the URL. + // Example: baseurl = example.com/piwik/ + 'baseurl' => '', + + // siteid (Integer) + // Change the *sideid* parameter to whatever ID you want to use for tracking your Friendica installation. + 'sideid' => '', + + // optout (Boolean) + // This defines whether or not a short notice about the utilization of Piwik will be displayed on every + // page of your Friendica site (at the bottom of the page with some spacing to the other content). + // Part of the note is a link that allows the visitor to set an opt-out cookie which will prevent visits + // from that user be tracked by Piwik. + 'optout' => true, + + // async (Boolean) + // This defines whether or not to use asynchronous tracking so pages load (or appear to load) faster. + 'async' => false, + ], +]; diff --git a/piwik/config/piwik.ini.php b/piwik/config/piwik.ini.php deleted file mode 100644 index b66c69c6..00000000 --- a/piwik/config/piwik.ini.php +++ /dev/null @@ -1,29 +0,0 @@ -loadConfigFile(__DIR__. '/config/piwik.ini.php'); + $a->loadConfigFile(__DIR__ . '/config/piwik.config.php'); } function piwik_analytics($a,&$b) { @@ -66,7 +66,7 @@ function piwik_analytics($a,&$b) { $a->page['htmlhead'] .= ''; /* - * Get the configuration variables from the config/addon.ini.php file. + * Get the configuration variables from the config/addon.config.php file. */ $baseurl = Config::get('piwik', 'baseurl'); $siteid = Config::get('piwik', 'siteid');