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

@ -0,0 +1,44 @@
<?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\CorePluginsAdmin\Commands;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugin\Manager;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* plugin:activate console command.
*/
class ActivatePlugin extends ConsoleCommand
{
protected function configure()
{
$this->setName('plugin:activate');
$this->setDescription('Activate a plugin.');
$this->addArgument('plugin', InputArgument::REQUIRED, 'The plugin name.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginManager = Manager::getInstance();
$plugin = $input->getArgument('plugin');
if ($pluginManager->isPluginActivated($plugin)) {
$output->writeln('<comment>The plugin is already activated.</comment>');
return;
}
$pluginManager->activatePlugin($plugin);
$output->writeln("Activated plugin <info>$plugin</info>");
}
}

View file

@ -0,0 +1,44 @@
<?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\CorePluginsAdmin\Commands;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugin\Manager;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* plugin:deactivate console command.
*/
class DeactivatePlugin extends ConsoleCommand
{
protected function configure()
{
$this->setName('plugin:deactivate');
$this->setDescription('Deactivate a plugin.');
$this->addArgument('plugin', InputArgument::REQUIRED, 'The plugin name.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginManager = Manager::getInstance();
$plugin = $input->getArgument('plugin');
if (!$pluginManager->isPluginActivated($plugin)) {
$output->writeln('<comment>The plugin is already deactivated.</comment>');
return;
}
$pluginManager->deactivatePlugin($plugin);
$output->writeln("Deactivated plugin <info>$plugin</info>");
}
}

View file

@ -0,0 +1,54 @@
<?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\CorePluginsAdmin\Commands;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugin\Manager;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* plugin:list console command.
*/
class ListPlugins extends ConsoleCommand
{
protected function configure()
{
$this->setName('plugin:list');
$this->setDescription('List installed plugins.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pluginManager = Manager::getInstance();
$plugins = $pluginManager->getInstalledPluginsName();
$plugins = array_map(function ($plugin) use ($pluginManager) {
return array(
'<info>' . $plugin . '</info>',
$pluginManager->isPluginBundledWithCore($plugin) ? 'Core' : 'Optional',
$pluginManager->isPluginActivated($plugin) ? 'Activated' : '<comment>Not activated</comment>',
);
}, $plugins);
// Sort Core plugins first
usort($plugins, function ($a, $b) {
return strcmp($a[1], $b[1]);
});
$table = new Table($output);
$table
->setHeaders(array('Plugin', 'Core or optional?', 'Status'))
->setRows($plugins)
;
$table->render();
}
}