protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!Installer::isConfigured()) {
         $output->writeln('<error>Kanboard is not configured to install plugins itself</error>');
     }
     try {
         $installer = new Installer($this->container);
         $installer->install($input->getArgument('url'));
         $output->writeln('<info>Plugin installed successfully</info>');
     } catch (PluginInstallerException $e) {
         $output->writeln('<error>' . $e->getMessage() . '</error>');
     }
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!Installer::isConfigured()) {
         $output->writeln('<error>Kanboard is not configured to upgrade plugins itself</error>');
     }
     $installer = new Installer($this->container);
     $availablePlugins = $this->httpClient->getJson(PLUGIN_API_URL);
     foreach ($this->pluginLoader->getPlugins() as $installedPlugin) {
         $pluginDetails = $this->getPluginDetails($availablePlugins, $installedPlugin);
         if ($pluginDetails === null) {
             $output->writeln('<error>* Plugin not available in the directory: ' . $installedPlugin->getPluginName() . '</error>');
         } elseif ($pluginDetails['version'] > $installedPlugin->getPluginVersion()) {
             $output->writeln('<comment>* Updating plugin: ' . $installedPlugin->getPluginName() . '</comment>');
             $installer->update($pluginDetails['download']);
         } else {
             $output->writeln('<info>* Plugin up to date: ' . $installedPlugin->getPluginName() . '</info>');
         }
     }
 }
示例#3
0
 /**
  * Remove a plugin
  *
  * @throws \Kanboard\Core\Controller\AccessForbiddenException
  */
 public function uninstall()
 {
     $this->checkCSRFParam();
     $pluginId = $this->request->getStringParam('pluginId');
     try {
         $installer = new Installer($this->container);
         $installer->uninstall($pluginId);
         $this->flash->success(t('Plugin removed successfully.'));
     } catch (PluginInstallerException $e) {
         $this->flash->failure($e->getMessage());
     }
     $this->response->redirect($this->helper->url->to('PluginController', 'show'));
 }