mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
plugin compatible judgement
This commit is contained in:
@@ -35,6 +35,10 @@ class Plugin
|
|||||||
if ($parts[0] == 'NexusPlugin') {
|
if ($parts[0] == 'NexusPlugin') {
|
||||||
$className = str_replace('ServiceProvider', 'Repository', $provider);
|
$className = str_replace('ServiceProvider', 'Repository', $provider);
|
||||||
if (class_exists($className)) {
|
if (class_exists($className)) {
|
||||||
|
$constantName = "$className::COMPATIBLE_VERSION";
|
||||||
|
if (defined($constantName) && version_compare(VERSION_NUMBER, constant($constantName), '<')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
call_user_func([new $className, 'boot']);
|
call_user_func([new $className, 'boot']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user