plugin compatible judgement

This commit is contained in:
xiaomlove
2022-08-11 01:04:38 +08:00
parent 19b5809af3
commit f5053a3f8e

View File

@@ -35,6 +35,10 @@ class Plugin
if ($parts[0] == 'NexusPlugin') {
$className = str_replace('ServiceProvider', 'Repository', $provider);
if (class_exists($className)) {
$constantName = "$className::COMPATIBLE_VERSION";
if (defined($constantName) && version_compare(VERSION_NUMBER, constant($constantName), '<')) {
continue;
}
call_user_func([new $className, 'boot']);
}
}