setDescription('Activate a plugin.'); $this->setHelp('This command activates a plugin.'); $this->addArgument('pluginname', InputArgument::REQUIRED, 'name of the plugin'); } protected function execute(InputInterface $input, OutputInterface $output): int { $pluginname = $input->getArgument('pluginname'); $pluginManager = \PluginManager::getInstance(); $plugin = $this->findPluginByName($pluginManager, $pluginname); if (null === $plugin) { $output->writeln('Could not find plugin of that name.'); return Command::FAILURE; } $pluginManager->setPluginEnabled($plugin['id'], true); $output->writeln('Plugin activated.'); return Command::SUCCESS; } }