mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 08:05:34 +08:00
refactor plugin command and add plugin:install command
This commit is contained in:
18
src/ZM/Bootstrap/LoadPlugins.php
Normal file
18
src/ZM/Bootstrap/LoadPlugins.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZM\Bootstrap;
|
||||
|
||||
use ZM\Plugin\PluginManager;
|
||||
|
||||
class LoadPlugins
|
||||
{
|
||||
public function bootstrap(array $config): void
|
||||
{
|
||||
// 先遍历下插件目录下是否有这个插件,没有这个插件则不能打包
|
||||
$plugin_dir = config('global.plugin.load_dir', SOURCE_ROOT_DIR . '/plugins');
|
||||
// 模拟加载一遍插件
|
||||
PluginManager::addPluginsFromDir($plugin_dir);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user