mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 13:32:41 +08:00
fix claim get create at last month
This commit is contained in:
@@ -5,6 +5,8 @@ class Plugin
|
||||
{
|
||||
private static mixed $providers = null;
|
||||
|
||||
private static array $plugins = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->loadProviders();
|
||||
@@ -16,6 +18,11 @@ class Plugin
|
||||
return !empty(self::$providers[$name]['providers']);
|
||||
}
|
||||
|
||||
public static function getById($id) :BasePlugin|null
|
||||
{
|
||||
return self::$plugins[$id] ?? null;
|
||||
}
|
||||
|
||||
public function getMainClass($name)
|
||||
{
|
||||
if (isset(self::$providers[$name]['providers'][0])) {
|
||||
@@ -39,7 +46,12 @@ class Plugin
|
||||
if (defined($constantName) && version_compare(VERSION_NUMBER, constant($constantName), '<')) {
|
||||
continue;
|
||||
}
|
||||
call_user_func([new $className, 'boot']);
|
||||
$plugin = new $className;
|
||||
call_user_func([$plugin, 'boot']);
|
||||
$pluginIdName = "$className::ID";
|
||||
if (defined($pluginIdName)) {
|
||||
self::$plugins[constant($pluginIdName)] = $plugin;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,4 +70,6 @@ class Plugin
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user