[piwik] Update config file style/name
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 25 Nov 2018 07:15:18 +0000 (02:15 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 25 Nov 2018 07:15:18 +0000 (02:15 -0500)
piwik/README.md
piwik/config/piwik.config.php [new file with mode: 0644]
piwik/config/piwik.ini.php [deleted file]
piwik/piwik.php

index 44d906b..9b35cc4 100644 (file)
@@ -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 (file)
index 0000000..7543097
--- /dev/null
@@ -0,0 +1,29 @@
+<?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
+
+return [
+       'piwik' => [
+               // 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 (file)
index b66c69c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php return <<<INI
-
-; Warning: Don't change this file! It only holds the default config values for this addon.
-; Instead overwrite these config values in config/addon.ini.php in your Friendica directory
-
-[piwik]
-; 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
-
-INI;
-//Keep this line
\ No newline at end of file
index 988c1e0..d96eba0 100644 (file)
@@ -16,7 +16,7 @@
  *
  *   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.ini.php
+ *     in case you don't use this add the following lines to your config/addon.config.php
  *     file:
  *
  *     [piwik]
@@ -53,7 +53,7 @@ function piwik_uninstall() {
 
 function piwik_load_config(\Friendica\App $a)
 {
-       $a->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'] .= '<link rel="stylesheet"  type="text/css" href="' . $a->getBaseURL() . '/addon/piwik/piwik.css' . '" media="all" />';
 
        /*
-        *   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');