update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -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,8 +9,6 @@
|
|||
|
||||
namespace Piwik\Plugins\CoreConsole\Commands;
|
||||
|
||||
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
|
@ -33,6 +31,7 @@ class GenerateVisualizationPlugin extends GeneratePlugin
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$pluginName = $this->getPluginName($input, $output);
|
||||
$this->checkAndUpdateRequiredPiwikVersion($pluginName, $output);
|
||||
$description = $this->getPluginDescription($input, $output);
|
||||
$version = $this->getPluginVersion($input, $output);
|
||||
$visualizationName = $this->getVisualizationName($input, $output);
|
||||
|
|
@ -43,7 +42,7 @@ class GenerateVisualizationPlugin extends GeneratePlugin
|
|||
$replace = array(
|
||||
'SimpleTable' => $visualizationName,
|
||||
'simpleTable' => lcfirst($visualizationName),
|
||||
'Simple Table' => $visualizationName,
|
||||
'Simple Table' => $this->makeTranslationIfPossible($pluginName, $visualizationName),
|
||||
'ExampleVisualization' => $pluginName,
|
||||
'ExampleVisualizationDescription' => $description
|
||||
);
|
||||
|
|
@ -60,7 +59,7 @@ class GenerateVisualizationPlugin extends GeneratePlugin
|
|||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @return string
|
||||
* @throws \RunTimeException
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
private function getVisualizationName(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
|
@ -68,11 +67,11 @@ class GenerateVisualizationPlugin extends GeneratePlugin
|
|||
|
||||
$validate = function ($visualizationName) use ($self) {
|
||||
if (empty($visualizationName)) {
|
||||
throw new \RunTimeException('You have to enter a visualization name');
|
||||
throw new \RuntimeException('You have to enter a visualization name');
|
||||
}
|
||||
|
||||
if (!ctype_alnum($visualizationName)) {
|
||||
throw new \RunTimeException(sprintf('The visualization name %s is not valid', $visualizationName));
|
||||
throw new \RuntimeException(sprintf('The visualization name %s is not valid (only AlNum allowed)', $visualizationName));
|
||||
}
|
||||
|
||||
return $visualizationName;
|
||||
|
|
@ -82,7 +81,7 @@ class GenerateVisualizationPlugin extends GeneratePlugin
|
|||
|
||||
if (empty($visualizationName)) {
|
||||
$dialog = $this->getHelperSet()->get('dialog');
|
||||
$visualizationName = $dialog->askAndValidate($output, 'Enter a visualization name: ', $validate);
|
||||
$visualizationName = $dialog->askAndValidate($output, 'Enter a visualization name (only AlNum allowed): ', $validate);
|
||||
} else {
|
||||
$validate($visualizationName);
|
||||
}
|
||||
|
|
@ -92,5 +91,4 @@ class GenerateVisualizationPlugin extends GeneratePlugin
|
|||
return $visualizationName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue