mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-12 11:15:34 +08:00
add --disable-plugins option for server command
This commit is contained in:
@@ -32,6 +32,8 @@ class PluginMeta implements \JsonSerializable
|
||||
/** @var array 元信息原文 */
|
||||
private array $metas;
|
||||
|
||||
private bool $enabled = true;
|
||||
|
||||
private ?ZMPlugin $entity = null;
|
||||
|
||||
/**
|
||||
@@ -56,6 +58,21 @@ class PluginMeta implements \JsonSerializable
|
||||
$this->root_dir = $root_dir;
|
||||
}
|
||||
|
||||
public function enablePlugin(): void
|
||||
{
|
||||
$this->enabled = true;
|
||||
}
|
||||
|
||||
public function disablePlugin(): void
|
||||
{
|
||||
$this->enabled = false;
|
||||
}
|
||||
|
||||
public function isEnabled(): bool
|
||||
{
|
||||
return $this->enabled;
|
||||
}
|
||||
|
||||
public function bindEntity(ZMPlugin $plugin): void
|
||||
{
|
||||
$this->entity = $plugin;
|
||||
|
||||
Reference in New Issue
Block a user