diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-02-11 11:05:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 11:05:27 +0300 |
commit | ab1e70016dde3ef93498bca99d0aa8b38e6d7f38 (patch) | |
tree | 5561b2d822215453c8d4e4fb4fe8e43b09b1faac /plugins/CorePluginsAdmin/Commands | |
parent | 4f2292b7eb500ddaf1dd0440220647f645b3d289 (diff) |
Renames CustomPiwikJs plugin to CustomJsTracker (#15505)
* Renames CustomPiwikJs plugin to CustomTrackerJs
* adds bc for old api class name
* adds update to rename plugin in exisiting config
* update ui tests
* rename again
* remove old events
* improve changelog
* remove bc fallback
* Improve migration
* use tagmanager submodule
* updates UI files
Diffstat (limited to 'plugins/CorePluginsAdmin/Commands')
-rw-r--r-- | plugins/CorePluginsAdmin/Commands/DeactivatePlugin.php | 2 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/Commands/UninstallPlugin.php | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/plugins/CorePluginsAdmin/Commands/DeactivatePlugin.php b/plugins/CorePluginsAdmin/Commands/DeactivatePlugin.php index 08e35d1b62..2adb85684a 100644 --- a/plugins/CorePluginsAdmin/Commands/DeactivatePlugin.php +++ b/plugins/CorePluginsAdmin/Commands/DeactivatePlugin.php @@ -23,7 +23,7 @@ class DeactivatePlugin extends ConsoleCommand { $this->setName('plugin:deactivate'); $this->setDescription('Deactivate a plugin.'); - $this->addArgument('plugin', InputArgument::IS_ARRAY, 'The plugin name you want to activate. Multiple plugin names can be specified separated by a space.'); + $this->addArgument('plugin', InputArgument::IS_ARRAY, 'The plugin name you want to deactivate. Multiple plugin names can be specified separated by a space.'); } protected function execute(InputInterface $input, OutputInterface $output) diff --git a/plugins/CorePluginsAdmin/Commands/UninstallPlugin.php b/plugins/CorePluginsAdmin/Commands/UninstallPlugin.php new file mode 100644 index 0000000000..8ccf2e2c0a --- /dev/null +++ b/plugins/CorePluginsAdmin/Commands/UninstallPlugin.php @@ -0,0 +1,46 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link https://matomo.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 UninstallPlugin extends ConsoleCommand +{ + protected function configure() + { + $this->setName('plugin:uninstall'); + $this->setDescription('Uninstall a plugin.'); + $this->addArgument('plugin', InputArgument::IS_ARRAY, 'The plugin name you want to uninstall. Multiple plugin names can be specified separated by a space.'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $pluginManager = Manager::getInstance(); + + $plugins = $input->getArgument('plugin'); + + foreach ($plugins as $plugin) { + if ($pluginManager->isPluginLoaded($plugin)) { + $output->writeln(sprintf('<comment>The plugin %s is still active.</comment>', $plugin)); + continue; + } + + $pluginManager->uninstallPlugin($plugin); + + $output->writeln("Uninstalled plugin <info>$plugin</info>"); + } + } +} |