mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 16:15:34 +08:00
refactor plugin command and add plugin:install command
This commit is contained in:
@@ -26,7 +26,7 @@ class LoadConfiguration
|
||||
|
||||
private function getConfigDir(array $config): string
|
||||
{
|
||||
$config_dir = $config['config-dir'];
|
||||
$config_dir = $config['config-dir'] ?? null;
|
||||
// 默认配置文件目录
|
||||
$find_dir = [
|
||||
WORKING_DIR . '/config',
|
||||
|
||||
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