OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace Leantime\Command;
use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputArgument;
/**
* Class RemovePluginCommand
*
* This class represents a command that removes plugins.
*/
#[AsCommand(
name: 'plugin:remove',
description: 'Remove a plugin',
)]
class RemovePluginCommand extends AbstractPluginCommand
{
/**
* {@inheritdoc}
*/
protected function configure(): void
{
$this->addArgument('plugin', InputArgument::REQUIRED, 'The plugin name');
}
/**
* {@inheritdoc}
*/
protected function executeCommand(): int
{
$name = $this->input->getArgument('plugin');
$plugin = $this->getPlugin($name);
if (! isset($plugin->id)) {
throw new RuntimeException(sprintf('Plugin %s is not installed', $plugin->name));
}
if (! $this->confirm(sprintf('Remove plugin %s', $plugin->name))) {
return Command::SUCCESS;
}
return $this->plugins->removePlugin($plugin->id) ? Command::SUCCESS : Command::FAILURE;
}
}