update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit d885a4baa9
5833 changed files with 418860 additions and 226988 deletions

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -9,7 +9,6 @@
namespace Piwik\Plugin;
use Exception;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\Version;
@ -50,9 +49,17 @@ class MetadataLoader
*/
public function load()
{
$defaults = $this->getDefaultPluginInformation();
$plugin = $this->loadPluginInfoJson();
// use translated plugin description if available
if ($defaults['description'] != Piwik::translate($defaults['description'])) {
unset($plugin['description']);
}
return array_merge(
$this->getDefaultPluginInformation(),
$this->loadPluginInfoJson()
$defaults,
$plugin
);
}
@ -67,7 +74,7 @@ class MetadataLoader
{
$descriptionKey = $this->pluginName . '_PluginDescription';
return array(
'description' => Piwik::translate($descriptionKey),
'description' => $descriptionKey,
'homepage' => 'http://piwik.org/',
'authors' => array(array('name' => 'Piwik', 'homepage' => 'http://piwik.org/')),
'license' => 'GPL v3+',
@ -95,12 +102,13 @@ class MetadataLoader
return array();
}
$info = Common::json_decode($json, $assoc = true);
$info = json_decode($json, $assoc = true);
if (!is_array($info)
|| empty($info)
) {
throw new Exception("Invalid JSON file: $path");
}
return $info;
}
}