From f5053a3f8eddc4c8408bc83c39ae5bb08c408f3a Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Thu, 11 Aug 2022 01:04:38 +0800 Subject: [PATCH] plugin compatible judgement --- nexus/Plugin/Plugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nexus/Plugin/Plugin.php b/nexus/Plugin/Plugin.php index 211396c1..6e0c78e6 100644 --- a/nexus/Plugin/Plugin.php +++ b/nexus/Plugin/Plugin.php @@ -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']); } }