diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-03 05:37:31 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-03 05:37:31 +0400 |
commit | 031ad2ee5fc29aa859d1f88544513af879de2d15 (patch) | |
tree | 7c2a99e0152230a357291d41a39fb8a2127ab5a2 | |
parent | 38d6a8713244173d151ae7e0938ccb44130a454c (diff) |
Fixing couple small issues2.0-a11
-rw-r--r-- | core/Config.php | 102 | ||||
-rw-r--r-- | core/Version.php | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/getMultiRowEvolutionPopover.twig | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/getRowEvolutionPopover.twig | 2 |
4 files changed, 55 insertions, 53 deletions
diff --git a/core/Config.php b/core/Config.php index 5d5a9c3828..654828a4e5 100644 --- a/core/Config.php +++ b/core/Config.php @@ -408,77 +408,79 @@ class Config $output = "; <?php exit; ?> DO NOT REMOVE THIS LINE\n"; $output .= "; file automatically generated or modified by Piwik; you can manually override the default values in global.ini.php by redefining them in this file.\n"; - if ($configCache) { + if (!$configCache) { + return false; + } + if($configLocal) { foreach ($configLocal as $name => $section) { if (!isset($configCache[$name])) { $configCache[$name] = $this->decodeValues($section); } } + } - $sectionNames = array_unique(array_merge(array_keys($configGlobal), array_keys($configCache))); + $sectionNames = array_unique(array_merge(array_keys($configGlobal), array_keys($configCache))); - foreach ($sectionNames as $section) { - if (!isset($configCache[$section])) { - continue; - } + foreach ($sectionNames as $section) { + if (!isset($configCache[$section])) { + continue; + } - // Only merge if the section exists in global.ini.php (in case a section only lives in config.ini.php) + // Only merge if the section exists in global.ini.php (in case a section only lives in config.ini.php) - // get local and cached config - $local = isset($configLocal[$section]) ? $configLocal[$section] : array(); - $config = $configCache[$section]; + // get local and cached config + $local = isset($configLocal[$section]) ? $configLocal[$section] : array(); + $config = $configCache[$section]; - // remove default values from both (they should not get written to local) - if (isset($configGlobal[$section])) { - $config = $this->array_unmerge($configGlobal[$section], $configCache[$section]); - $local = $this->array_unmerge($configGlobal[$section], $local); - } + // remove default values from both (they should not get written to local) + if (isset($configGlobal[$section])) { + $config = $this->array_unmerge($configGlobal[$section], $configCache[$section]); + $local = $this->array_unmerge($configGlobal[$section], $local); + } - // if either local/config have non-default values and the other doesn't, - // OR both have values, but different values, we must write to config.ini.php - if (empty($local) xor empty($config) - || (!empty($local) - && !empty($config) - && self::compareElements($config, $configLocal[$section])) - ) { - $dirty = true; - } + // if either local/config have non-default values and the other doesn't, + // OR both have values, but different values, we must write to config.ini.php + if (empty($local) xor empty($config) + || (!empty($local) + && !empty($config) + && self::compareElements($config, $configLocal[$section])) + ) { + $dirty = true; + } - // no point in writing empty sections, so skip if the cached section is empty - if (empty($config)) { - continue; - } + // no point in writing empty sections, so skip if the cached section is empty + if (empty($config)) { + continue; + } - $output .= "[$section]\n"; + $output .= "[$section]\n"; - foreach ($config as $name => $value) { - $value = $this->encodeValues($value); + foreach ($config as $name => $value) { + $value = $this->encodeValues($value); - if (is_numeric($name)) { - $name = $section; - $value = array($value); - } + if (is_numeric($name)) { + $name = $section; + $value = array($value); + } - if (is_array($value)) { - foreach ($value as $currentValue) { - $output .= $name . "[] = \"$currentValue\"\n"; - } - } else { - if (!is_numeric($value)) { - $value = "\"$value\""; - } - $output .= $name . ' = ' . $value . "\n"; + if (is_array($value)) { + foreach ($value as $currentValue) { + $output .= $name . "[] = \"$currentValue\"\n"; } + } else { + if (!is_numeric($value)) { + $value = "\"$value\""; + } + $output .= $name . ' = ' . $value . "\n"; } - - $output .= "\n"; } - if ($dirty) { - return $output; - } + $output .= "\n"; } + if ($dirty) { + return $output; + } return false; } @@ -491,7 +493,7 @@ class Config * @param array $configCache * @param string $pathLocal */ - public function writeConfig($configLocal, $configGlobal, $configCache, $pathLocal) + protected function writeConfig($configLocal, $configGlobal, $configCache, $pathLocal) { if ($this->isTest) { return; diff --git a/core/Version.php b/core/Version.php index 65d6ef2d36..b93b90f345 100644 --- a/core/Version.php +++ b/core/Version.php @@ -22,5 +22,5 @@ final class Version * Current Piwik version * @var string */ - const VERSION = '2.0-a10'; + const VERSION = '2.0-a11'; } diff --git a/plugins/CoreHome/templates/getMultiRowEvolutionPopover.twig b/plugins/CoreHome/templates/getMultiRowEvolutionPopover.twig index c0a043aac8..306b5d44ae 100644 --- a/plugins/CoreHome/templates/getMultiRowEvolutionPopover.twig +++ b/plugins/CoreHome/templates/getMultiRowEvolutionPopover.twig @@ -18,7 +18,7 @@ <span class="evolution-graph-colors" data-name="series{{ (i % seriesColorCount) + 1 }}"> {{- metric.label|raw -}} </span> - <span class="details">{{ metric.details }}</span> + <span class="details">{{ metric.details|raw }}</span> </td> </tr> {% endfor %} diff --git a/plugins/CoreHome/templates/getRowEvolutionPopover.twig b/plugins/CoreHome/templates/getRowEvolutionPopover.twig index 74b6cbbfe4..aafd09632d 100644 --- a/plugins/CoreHome/templates/getRowEvolutionPopover.twig +++ b/plugins/CoreHome/templates/getRowEvolutionPopover.twig @@ -21,7 +21,7 @@ {{- metric.label|raw -}} </span> {% if metric.details %}: - <span class="details">{{ metric.details }}</span> + <span class="details">{{ metric.details|raw }}</span> {% endif %} </td> </tr> |