fixed items

This commit is contained in:
Edward Yang 2022-06-29 20:46:51 +08:00
parent c80be51a0d
commit 6299ca7754
2 changed files with 8 additions and 0 deletions

View File

@ -43,7 +43,9 @@ class Manager
$pluginPath = $this->getPluginsDir() . DIRECTORY_SEPARATOR . $dirname;
$plugin = new Plugin($pluginPath, $package);
$plugin->setDirname($dirname);
$plugin->setName(Arr::get($package, 'name'));
$plugin->setInstalled(true);
$plugin->setEnabled(false);
$plugin->setVersion(Arr::get($package, 'version'));
if ($plugins->has($plugin->code)) {

View File

@ -54,6 +54,12 @@ class Plugin implements Arrayable, \ArrayAccess
return $this;
}
public function setName(string $name): Plugin
{
$this->name = $name;
return $this;
}
public function setInstalled(bool $installed): Plugin
{
$this->installed = $installed;