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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-01-12 02:39:41 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-01-12 02:39:41 +0300
commit636d5400a7aee9fff5b3966b06c5d4e248ce825c (patch)
tree5b4ba382285c344fd5d2b947906a878dc722cca5 /plugins/CoreConsole
parentc144a0dd58d8cd47b09b477bb9bc82b1e9cd77f9 (diff)
#6915 Renamed plugin management commands
Diffstat (limited to 'plugins/CoreConsole')
-rw-r--r--plugins/CoreConsole/Commands/ManagePlugin.php38
1 files changed, 24 insertions, 14 deletions
diff --git a/plugins/CoreConsole/Commands/ManagePlugin.php b/plugins/CoreConsole/Commands/ManagePlugin.php
index 00dcd29c0a..1c2a4de0b7 100644
--- a/plugins/CoreConsole/Commands/ManagePlugin.php
+++ b/plugins/CoreConsole/Commands/ManagePlugin.php
@@ -9,7 +9,10 @@
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Plugin\ConsoleCommand;
-use Piwik\Plugin\Manager;
+use Piwik\Plugins\CorePluginsAdmin\Commands\ActivatePlugin;
+use Piwik\Plugins\CorePluginsAdmin\Commands\DeactivatePlugin;
+use Piwik\Plugins\CorePluginsAdmin\Commands\ListPlugins;
+use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -17,6 +20,8 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* core:plugin console command.
+ *
+ * @deprecated This command has been replaced with `plugin:*` commands.
*/
class ManagePlugin extends ConsoleCommand
{
@@ -72,27 +77,32 @@ class ManagePlugin extends ConsoleCommand
private function activatePlugin(InputInterface $input, OutputInterface $output, $plugin)
{
- Manager::getInstance()->activatePlugin($plugin, $input, $output);
+ $output->writeln('<comment>Warning: the command core:plugin is deprecated, use plugin:activate instead.</comment>');
- $output->writeln("Activated plugin <info>$plugin</info>");
+ $command = new ActivatePlugin();
+ $input = new ArrayInput(array(
+ 'plugin' => $plugin,
+ ));
+ return $command->run($input, $output);
}
private function deactivatePlugin(InputInterface $input, OutputInterface $output, $plugin)
{
- Manager::getInstance()->deactivatePlugin($plugin, $input, $output);
+ $output->writeln('<comment>Warning: the command core:plugin is deprecated, use plugin:deactivate instead.</comment>');
- $output->writeln("Deactivated plugin <info>$plugin</info>");
+ $command = new DeactivatePlugin();
+ $input = new ArrayInput(array(
+ 'plugin' => $plugin,
+ ));
+ return $command->run($input, $output);
}
- private function listPlugins(InputInterface $input, OutputInterface $output, $plugin)
+ private function listPlugins(InputInterface $input, OutputInterface $output)
{
- $plugins = Manager::getInstance()->getPluginsLoadedAndActivated();
-
- $count = count($plugins);
- $output->writeln("Listing $count activated plugins:");
- foreach($plugins as $plugin) {
- $pluginName = $plugin->getPluginName();
- $output->writeln("<info>$pluginName</info>");
- };
+ $output->writeln('<comment>Warning: the command core:plugin is deprecated, use plugin:list instead.</comment>');
+
+ $command = new ListPlugins();
+ $input = new ArrayInput(array());
+ return $command->run($input, $output);
}
} \ No newline at end of file