Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--composer.json2
-rw-r--r--composer.lock17
-rwxr-xr-xcore/Twig.php24
-rw-r--r--plugins/Diagnostics/ConfigReader.php157
-rw-r--r--plugins/Diagnostics/Controller.php72
-rw-r--r--plugins/Diagnostics/Diagnostics.php15
-rw-r--r--plugins/Diagnostics/Menu.php28
-rw-r--r--plugins/Diagnostics/Test/Integration/ConfigReaderTest.php238
-rw-r--r--plugins/Diagnostics/lang/en.json8
-rw-r--r--plugins/Diagnostics/plugin.json5
-rw-r--r--plugins/Diagnostics/stylesheets/configfile.less22
-rw-r--r--plugins/Diagnostics/templates/configfile.twig55
-rw-r--r--tests/UI/specs/UIIntegration_spec.js6
-rw-r--r--tests/resources/Config/global.ini.php4
14 files changed, 642 insertions, 11 deletions
diff --git a/composer.json b/composer.json
index e7cc14f778..3c6521b827 100644
--- a/composer.json
+++ b/composer.json
@@ -46,7 +46,7 @@
"piwik/decompress": "~1.0",
"piwik/network": "~0.1.0",
"piwik/cache": "~0.2.5",
- "piwik/ini": "^1.0.3",
+ "piwik/ini": "^1.0.6",
"php-di/php-di": "5.0.0-beta1",
"psr/log": "~1.0",
"monolog/monolog": "~1.11",
diff --git a/composer.lock b/composer.lock
index 263c85b4ab..fc23cdfa2d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "09112ef01f28686b387148c407503c7c",
- "content-hash": "ff9b83524f413ac80daad8eb47099042",
+ "hash": "de61be52972a0fe8fe751306c271f4b8",
+ "content-hash": "68130b067cdceef8346b47d858b763a3",
"packages": [
{
"name": "container-interop/container-interop",
@@ -300,7 +300,6 @@
"phpdoc",
"reflection"
],
- "abandoned": "php-di/phpdoc-reader",
"time": "2014-08-21 08:20:45"
},
{
@@ -875,16 +874,16 @@
},
{
"name": "piwik/ini",
- "version": "1.0.4",
+ "version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/piwik/component-ini.git",
- "reference": "9269255fd187e5bda2e5778041c8d143eb615b0a"
+ "reference": "bd2711ba4d5e20e4ca09b6829dc2831576b59dc3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/piwik/component-ini/zipball/9269255fd187e5bda2e5778041c8d143eb615b0a",
- "reference": "9269255fd187e5bda2e5778041c8d143eb615b0a",
+ "url": "https://api.github.com/repos/piwik/component-ini/zipball/bd2711ba4d5e20e4ca09b6829dc2831576b59dc3",
+ "reference": "bd2711ba4d5e20e4ca09b6829dc2831576b59dc3",
"shasum": ""
},
"require": {
@@ -904,7 +903,7 @@
"license": [
"LGPL-3.0"
],
- "time": "2015-04-21 04:59:09"
+ "time": "2016-01-14 21:13:33"
},
{
"name": "piwik/network",
@@ -1551,7 +1550,7 @@
"performance",
"profiling"
],
- "time": "2015-02-26 14:37:51"
+ "time": "2014-08-28 17:34:52"
},
{
"name": "guzzle/guzzle",
diff --git a/core/Twig.php b/core/Twig.php
index 06706d7b44..5968b965eb 100755
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -104,6 +104,8 @@ class Twig
$this->twig->addTokenParser(new RenderTokenParser());
$this->addTest_false();
+ $this->addTest_true();
+ $this->addTest_emptyString();
}
private function addTest_false()
@@ -117,6 +119,28 @@ class Twig
$this->twig->addTest($test);
}
+ private function addTest_true()
+ {
+ $test = new Twig_SimpleTest(
+ 'true',
+ function ($value) {
+ return true === $value;
+ }
+ );
+ $this->twig->addTest($test);
+ }
+
+ private function addTest_emptyString()
+ {
+ $test = new Twig_SimpleTest(
+ 'emptyString',
+ function ($value) {
+ return '' === $value;
+ }
+ );
+ $this->twig->addTest($test);
+ }
+
protected function addFunction_getJavascriptTranslations()
{
$getJavascriptTranslations = new Twig_SimpleFunction(
diff --git a/plugins/Diagnostics/ConfigReader.php b/plugins/Diagnostics/ConfigReader.php
new file mode 100644
index 0000000000..ca47af2f69
--- /dev/null
+++ b/plugins/Diagnostics/ConfigReader.php
@@ -0,0 +1,157 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Diagnostics;
+
+use Piwik\Development;
+use Piwik\Ini\IniReader;
+use Piwik\Application\Kernel\GlobalSettingsProvider;
+use Piwik\Settings;
+
+/**
+ * A diagnostic report contains all the results of all the diagnostics.
+ */
+class ConfigReader
+{
+ /**
+ * @var GlobalSettingsProvider
+ */
+ private $settings;
+
+ /**
+ * @var IniReader
+ */
+ private $iniReader;
+
+ public function __construct(GlobalSettingsProvider $settings, IniReader $iniReader)
+ {
+ $this->settings = $settings;
+ $this->iniReader = $iniReader;
+ }
+
+ public function getConfigValuesFromFiles()
+ {
+ $ini = $this->settings->getIniFileChain();
+ $descriptions = $this->iniReader->readComments($this->settings->getPathGlobal());
+
+ $copy = array();
+ foreach ($ini->getAll() as $category => $values) {
+ if ($this->shouldSkipCategory($category)) {
+ continue;
+ }
+
+ $local = $this->getFromLocalConfig($category);
+ if (empty($local)) {
+ $local = array();
+ }
+
+ $global = $this->getFromGlobalConfig($category);
+ if (empty($global)) {
+ $global = array();
+ }
+
+ $copy[$category] = array();
+ foreach ($values as $key => $value) {
+
+ $newValue = $value;
+ if (strpos(strtolower($key), 'password') !== false) {
+ $newValue = str_pad('', strlen($value), '*');
+ }
+
+ $defaultValue = null;
+ if (array_key_exists($key, $global)) {
+ $defaultValue = $global[$key];
+ }
+
+ $description = '';
+ if (!empty($descriptions[$category][$key])) {
+ $description = trim($descriptions[$category][$key]);
+ }
+
+ $copy[$category][$key] = array(
+ 'value' => $newValue,
+ 'description' => $description,
+ 'isCustomValue' => array_key_exists($key, $local),
+ 'defaultValue' => $defaultValue,
+ );
+ }
+ }
+
+ return $copy;
+ }
+
+ private function shouldSkipCategory($category)
+ {
+ $category = strtolower($category);
+ if ($category === 'database') {
+ return true;
+ }
+
+ $developmentOnlySections = array('database_tests', 'tests', 'debugtests');
+
+ return !Development::isEnabled() && in_array($category, $developmentOnlySections);
+ }
+
+ public function getFromGlobalConfig($name)
+ {
+ return $this->settings->getIniFileChain()->getFrom($this->settings->getPathGlobal(), $name);
+ }
+
+ public function getFromLocalConfig($name)
+ {
+ return $this->settings->getIniFileChain()->getFrom($this->settings->getPathLocal(), $name);
+ }
+
+ /**
+ * Adds config values that can be used to overwrite a plugin system setting and adds a description + default value
+ * for already existing configured config values that overwrite a plugin system setting.
+ *
+ * @param array $configValues
+ * @param \Piwik\Plugin\Settings[] $pluginSettings
+ * @return array
+ */
+ public function addConfigValuesFromPluginSettings($configValues, $pluginSettings)
+ {
+ foreach ($pluginSettings as $pluginSetting) {
+ $pluginName = $pluginSetting->getPluginName();
+ $configs[$pluginName] = array();
+
+ foreach ($pluginSetting->getSettings() as $setting) {
+ if ($setting instanceof Settings\SystemSetting && $setting->isReadableByCurrentUser()) {
+
+ $description = '';
+ if (!empty($setting->description)) {
+ $description .= $setting->description . ' ';
+ }
+
+ if (!empty($setting->inlineHelp)) {
+ $description .= $setting->inlineHelp;
+ }
+
+ if (isset($configValues[$pluginName][$setting->getName()])) {
+ $configValues[$pluginName][$setting->getName()]['defaultValue'] = $setting->defaultValue;
+ $configValues[$pluginName][$setting->getName()]['description'] = trim($description);
+ } else {
+ $defaultValue = $setting->getValue();
+ $configValues[$pluginName][$setting->getName()] = array(
+ 'value' => null,
+ 'description' => trim($description),
+ 'isCustomValue' => false,
+ 'defaultValue' => $defaultValue
+ );
+ }
+ }
+ }
+
+ if (empty($configValues[$pluginName])) {
+ unset($configValues[$pluginName]);
+ }
+ }
+
+ return $configValues;
+ }
+}
diff --git a/plugins/Diagnostics/Controller.php b/plugins/Diagnostics/Controller.php
new file mode 100644
index 0000000000..be166ccdf9
--- /dev/null
+++ b/plugins/Diagnostics/Controller.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Diagnostics;
+
+use Piwik\Config;
+use Piwik\Piwik;
+use Piwik\View;
+use Piwik\Settings;
+
+/**
+ * A controller let's you for example create a page that can be added to a menu. For more information read our guide
+ * http://developer.piwik.org/guides/mvc-in-piwik or have a look at the our API references for controller and view:
+ * http://developer.piwik.org/api-reference/Piwik/Plugin/Controller and
+ * http://developer.piwik.org/api-reference/Piwik/View
+ */
+class Controller extends \Piwik\Plugin\ControllerAdmin
+{
+ /**
+ * @var ConfigReader
+ */
+ private $configReader;
+
+ public function __construct(ConfigReader $configReader)
+ {
+ $this->configReader = $configReader;
+ parent::__construct();
+ }
+
+ public function configfile()
+ {
+ Piwik::checkUserHasSuperUserAccess();
+
+ $allSettings = Settings\Manager::getAllPluginSettings();
+
+ $configValues = $this->configReader->getConfigValuesFromFiles();
+ $configValues = $this->configReader->addConfigValuesFromPluginSettings($configValues, $allSettings);
+ $configValues = $this->sortConfigValues($configValues);
+
+ return $this->renderTemplate('configfile', array(
+ 'allConfigValues' => $configValues
+ ));
+ }
+
+ private function sortConfigValues($configValues)
+ {
+ // we sort by sections alphabetically
+ uksort($configValues, function ($section1, $section2) {
+ return strcasecmp($section1, $section2);
+ });
+
+ foreach ($configValues as $category => &$settings) {
+ // we sort keys alphabetically but list the ones that are changed first
+ uksort($settings, function ($setting1, $setting2) use ($settings) {
+ if ($settings[$setting1]['isCustomValue'] && !$settings[$setting2]['isCustomValue']) {
+ return -1;
+ } elseif (!$settings[$setting1]['isCustomValue'] && $settings[$setting2]['isCustomValue']) {
+ return 1;
+ }
+ return strcasecmp($setting1, $setting2);
+ });
+ }
+
+ return $configValues;
+ }
+
+}
diff --git a/plugins/Diagnostics/Diagnostics.php b/plugins/Diagnostics/Diagnostics.php
index f69d1f45d1..9760be5b05 100644
--- a/plugins/Diagnostics/Diagnostics.php
+++ b/plugins/Diagnostics/Diagnostics.php
@@ -12,4 +12,19 @@ use Piwik\Plugin;
class Diagnostics extends Plugin
{
+ /**
+ * @see Piwik\Plugin::registerEvents
+ */
+ public function registerEvents()
+ {
+ return array(
+ 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
+ );
+ }
+
+ public function getStylesheetFiles(&$stylesheets)
+ {
+ $stylesheets[] = "plugins/Diagnostics/stylesheets/configfile.less";
+ }
+
}
diff --git a/plugins/Diagnostics/Menu.php b/plugins/Diagnostics/Menu.php
new file mode 100644
index 0000000000..52c28699b5
--- /dev/null
+++ b/plugins/Diagnostics/Menu.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Diagnostics;
+
+use Piwik\Menu\MenuAdmin;
+use Piwik\Piwik;
+
+/**
+ * This class allows you to add, remove or rename menu items.
+ * To configure a menu (such as Admin Menu, Reporting Menu, User Menu...) simply call the corresponding methods as
+ * described in the API-Reference http://developer.piwik.org/api-reference/Piwik/Menu/MenuAbstract
+ */
+class Menu extends \Piwik\Plugin\Menu
+{
+ public function configureAdminMenu(MenuAdmin $menu)
+ {
+ if (Piwik::hasUserSuperUserAccess()) {
+ $menu->addDiagnosticItem('Diagnostics_ConfigFileTitle', $this->urlForAction('configfile'), $orderId = 30);
+ }
+ }
+
+}
diff --git a/plugins/Diagnostics/Test/Integration/ConfigReaderTest.php b/plugins/Diagnostics/Test/Integration/ConfigReaderTest.php
new file mode 100644
index 0000000000..a44da5cd7e
--- /dev/null
+++ b/plugins/Diagnostics/Test/Integration/ConfigReaderTest.php
@@ -0,0 +1,238 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Diagnostics\Test\Integration\Commands;
+
+use Piwik\Application\Kernel\GlobalSettingsProvider;
+use Piwik\Ini\IniReader;
+use Piwik\Plugins\Diagnostics\ConfigReader;
+use Piwik\Plugins\ExampleSettingsPlugin\Settings;
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+
+/**
+ * TODO: This could be a unit test if we could inject the ArchiveTableDao in the command
+ * @group Diagnostics
+ * @group Plugins
+ */
+class ConfigReaderTest extends IntegrationTestCase
+{
+ /**
+ * @var ConfigReader
+ */
+ private $configReader;
+
+ public function setUp()
+ {
+ $settings = new GlobalSettingsProvider($this->configPath('global.ini.php'), $this->configPath('config.ini.php'), $this->configPath('common.config.ini.php'));
+ $this->configReader = new ConfigReader($settings, new IniReader());
+ }
+
+ public function test_getConfigValuesFromFiles()
+ {
+ $fileConfig = $this->configReader->getConfigValuesFromFiles();
+
+ $expected = array (
+ 'Category' =>
+ array (
+ 'key1' =>
+ array (
+ 'value' => 'value_overwritten',
+ 'description' => '',
+ 'isCustomValue' => true,
+ 'defaultValue' => 'value1',
+ ),
+ 'key2' =>
+ array (
+ 'value' => 'valueCommon',
+ 'description' => '',
+ 'isCustomValue' => false,
+ 'defaultValue' => 'value2',
+ ),
+ 'key3' =>
+ array (
+ 'value' => '${@piwik(crash))}',
+ 'description' => '',
+ 'isCustomValue' => false,
+ 'defaultValue' => NULL,
+ ),
+ ),
+ 'CategoryOnlyInGlobalFile' =>
+ array (
+ 'key3' =>
+ array (
+ 'value' => 'value3',
+ 'description' => 'test comment',
+ 'isCustomValue' => false,
+ 'defaultValue' => 'value3',
+ ),
+ 'key4' =>
+ array (
+ 'value' => 'value4',
+ 'description' => 'test comment 4',
+ 'isCustomValue' => false,
+ 'defaultValue' => 'value4',
+ ),
+ ),
+ 'TestArray' =>
+ array (
+ 'installed' =>
+ array (
+ 'value' =>
+ array (
+ 0 => 'plugin"1',
+ 1 => 'plugin2',
+ 2 => 'plugin3',
+ ),
+ 'description' => 'test comment 2
+with multiple lines',
+ 'isCustomValue' => true,
+ 'defaultValue' =>
+ array (
+ 0 => 'plugin1',
+ 1 => 'plugin4',
+ ),
+ ),
+ ),
+ 'TestArrayOnlyInGlobalFile' =>
+ array (
+ 'my_array' =>
+ array (
+ 'value' =>
+ array (
+ 0 => 'value1',
+ 1 => 'value2',
+ ),
+ 'description' => '',
+ 'isCustomValue' => false,
+ 'defaultValue' =>
+ array (
+ 0 => 'value1',
+ 1 => 'value2',
+ ),
+ ),
+ ),
+ 'GeneralSection' =>
+ array (
+ 'password' =>
+ array (
+ 'value' => '****',
+ 'description' => '',
+ 'isCustomValue' => true,
+ 'defaultValue' => NULL,
+ ),
+ 'login' =>
+ array (
+ 'value' => 'tes"t',
+ 'description' => '',
+ 'isCustomValue' => true,
+ 'defaultValue' => NULL,
+ ),
+ ),
+ 'TestOnlyInCommon' =>
+ array (
+ 'value' =>
+ array (
+ 'value' => 'commonValue',
+ 'description' => '',
+ 'isCustomValue' => false,
+ 'defaultValue' => NULL,
+ ),
+ ),
+ 'Tracker' =>
+ array (
+ 'commonConfigTracker' =>
+ array (
+ 'value' => 'commonConfigTrackerValue',
+ 'description' => '',
+ 'isCustomValue' => false,
+ 'defaultValue' => NULL,
+ ),
+ ),
+ );
+ $this->assertEquals($expected, $fileConfig);
+ }
+
+ public function test_addConfigValuesFromPluginSettings()
+ {
+ $settings = new Settings();
+
+ $configValues = $this->configReader->addConfigValuesFromPluginSettings(array(), array($settings));
+
+ $expected = array (
+ 'ExampleSettingsPlugin' =>
+ array (
+ 'metric' =>
+ array (
+ 'value' => NULL,
+ 'description' => 'Choose the metric that should be displayed in the browser tab',
+ 'isCustomValue' => false,
+ 'defaultValue' => 'nb_visits',
+ ),
+ 'browsers' =>
+ array (
+ 'value' => NULL,
+ 'description' => 'The value will be only displayed in the following browsers',
+ 'isCustomValue' => false,
+ 'defaultValue' =>
+ array (
+ 0 => 'firefox',
+ 1 => 'chromium',
+ 2 => 'safari',
+ ),
+ ),
+ 'description' =>
+ array (
+ 'value' => NULL,
+ 'description' => 'This description will be displayed next to the value',
+ 'isCustomValue' => false,
+ 'defaultValue' => 'This is the value:
+Another line',
+ ),
+ 'password' =>
+ array (
+ 'value' => NULL,
+ 'description' => 'Password for the 3rd API where we fetch the value',
+ 'isCustomValue' => false,
+ 'defaultValue' => NULL,
+ ),
+ ),
+ );
+ $this->assertEquals($expected, $configValues);
+ }
+
+ public function test_addConfigValuesFromPluginSettings_shouldAddDescriptionAndDefaultValueForExistingConfigValues()
+ {
+ $settings = new Settings();
+
+ $existing = array(
+ 'ExampleSettingsPlugin' =>
+ array (
+ 'metric' =>
+ array (
+ 'value' => NULL,
+ 'description' => '',
+ 'isCustomValue' => false,
+ 'defaultValue' => null,
+ ),
+ )
+ );
+
+ $configValues = $this->configReader->addConfigValuesFromPluginSettings($existing, array($settings));
+
+ $this->assertSame('Choose the metric that should be displayed in the browser tab', $configValues['ExampleSettingsPlugin']['metric']['description']);
+ $this->assertSame('nb_visits', $configValues['ExampleSettingsPlugin']['metric']['defaultValue']);
+ }
+
+ private function configPath($file)
+ {
+ return PIWIK_INCLUDE_PATH . '/tests/resources/Config/' . $file;
+ }
+}
+
+AnalyzeArchiveTableTest::$fixture = new OneVisitorTwoVisits(); \ No newline at end of file
diff --git a/plugins/Diagnostics/lang/en.json b/plugins/Diagnostics/lang/en.json
new file mode 100644
index 0000000000..3154699723
--- /dev/null
+++ b/plugins/Diagnostics/lang/en.json
@@ -0,0 +1,8 @@
+{
+ "Diagnostics": {
+ "ConfigFileTitle": "Config file",
+ "ConfigFileIntroduction": "Here you can view the Piwik configuration. If you are running Piwik in a load balanced environment the page might be different depending from which server this page is loaded. Rows with a different background color are changed config values that are specified for example in the %s file.",
+ "HideUnchanged": "If you want to see only changed values you can %shide all unchanged values%s.",
+ "Sections": "Sections"
+ }
+} \ No newline at end of file
diff --git a/plugins/Diagnostics/plugin.json b/plugins/Diagnostics/plugin.json
index da53096d70..da6ccab3fa 100644
--- a/plugins/Diagnostics/plugin.json
+++ b/plugins/Diagnostics/plugin.json
@@ -1,3 +1,6 @@
{
- "description": "Performs diagnostics to check that Piwik is installed and runs correctly."
+ "description": "Performs diagnostics to check that Piwik is installed and runs correctly.",
+ "require": {
+ "piwik": ">=2.16.0-b2"
+ }
} \ No newline at end of file
diff --git a/plugins/Diagnostics/stylesheets/configfile.less b/plugins/Diagnostics/stylesheets/configfile.less
new file mode 100644
index 0000000000..f399ce3596
--- /dev/null
+++ b/plugins/Diagnostics/stylesheets/configfile.less
@@ -0,0 +1,22 @@
+.diagnostics.configfile {
+ .custom-value {
+ background-color: @theme-color-background-tinyContrast;
+ }
+
+ .defaultValue {
+ font-style: italic;
+ }
+
+ td.name {
+ max-width: 330px;
+ word-wrap: break-word;
+ width: 25%;
+ }
+
+ td.value {
+ word-wrap: break-word;
+ max-width: 400px;
+ width: 25%;
+ }
+
+}
diff --git a/plugins/Diagnostics/templates/configfile.twig b/plugins/Diagnostics/templates/configfile.twig
new file mode 100644
index 0000000000..46113b51da
--- /dev/null
+++ b/plugins/Diagnostics/templates/configfile.twig
@@ -0,0 +1,55 @@
+{% extends 'admin.twig' %}
+
+{% macro humanReadableValue(value) %}
+ {% if value is false %}
+ false
+ {% elseif value is true %}
+ true
+ {% elseif value is null %}
+ {% elseif value is emptyString %}
+ ''
+ {% else %}
+ {{ value|join(', ') }}
+ {% endif %}
+{% endmacro %}
+
+{% block content %}
+ <h2 piwik-enriched-headline>{{ 'Diagnostics_ConfigFileTitle'|translate }}</h2>
+ <p>
+ {{ 'Diagnostics_ConfigFileIntroduction'|translate('<code>"config/config.ini.php"</code>')|raw }}
+ {{ 'Diagnostics_HideUnchanged'|translate('<a ng-click="hideGlobalConfigValues=!hideGlobalConfigValues">', '</a>')|raw }}
+
+ <h3>{{ 'Diagnostics_Sections'|translate }}</h3>
+ {% for category, values in allConfigValues %}
+ <a href="#{{ category|e('html_attr') }}">{{ category }}</a><br />
+ {% endfor %}
+ </p>
+
+ <table class="simple-table diagnostics configfile">
+ <tbody>
+ {% for category, configValues in allConfigValues %}
+ <tr><td colspan="3"><a name="{{ category|e('html_attr') }}"></a><h3>{{ category }}</h3></td></tr>
+
+ {% for key, configEntry in configValues %}
+ <tr {% if configEntry.isCustomValue %}class="custom-value"{% else %}ng-hide="hideGlobalConfigValues"{% endif %}>
+ <td class="name">{{ key }}{% if configEntry.value is iterable %}[]{% endif %}</td>
+ <td class="value">
+ {{ _self.humanReadableValue(configEntry.value) }}
+ </td>
+ <td class="description">
+ {{ configEntry.description }}
+
+ {% if (configEntry.isCustomValue or configEntry.value is null) and configEntry.defaultValue is not null %}
+ {% if configEntry.description %}<br />{% endif %}
+
+ {{ 'General_Default'|translate }}:
+ <span class="defaultValue">{{ _self.humanReadableValue(configEntry.defaultValue) }}<span>
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ {% endfor %}
+ </tbody>
+ </table>
+
+{% endblock %} \ No newline at end of file
diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js
index 65fa37d721..9703f28814 100644
--- a/tests/UI/specs/UIIntegration_spec.js
+++ b/tests/UI/specs/UIIntegration_spec.js
@@ -498,6 +498,12 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik?
}, done);
});
+ it('should load the config file page correctly', function (done) {
+ expect.screenshot('admin_diagnostics_configfile').to.be.captureSelector('.pageWrap', function (page) {
+ page.load("?" + generalParams + "&module=Diagnostics&action=configfile");
+ }, done);
+ });
+
it('should load the Settings > Visitor Generator admin page correctly', function (done) {
expect.screenshot('admin_visitor_generator').to.be.captureSelector('.pageWrap', function (page) {
page.load("?" + generalParams + "&module=VisitorGenerator&action=index");
diff --git a/tests/resources/Config/global.ini.php b/tests/resources/Config/global.ini.php
index 20271ed43d..87e1437453 100644
--- a/tests/resources/Config/global.ini.php
+++ b/tests/resources/Config/global.ini.php
@@ -3,10 +3,14 @@ key1 = value1
key2 = value2
[CategoryOnlyInGlobalFile]
+; test comment
key3 = "value3"
+; test comment 4
key4 = value4
[TestArray]
+; test comment 2
+; with multiple lines
installed[] = plugin1
installed[] = plugin4