From 7e48a7f15dbd924e44db1f5856a08caad8468c57 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Wed, 8 Jun 2022 15:23:34 +0800 Subject: [PATCH] boot plugin when class exists --- nexus/Plugin/Plugin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nexus/Plugin/Plugin.php b/nexus/Plugin/Plugin.php index 9c244a7b..211396c1 100644 --- a/nexus/Plugin/Plugin.php +++ b/nexus/Plugin/Plugin.php @@ -34,7 +34,9 @@ class Plugin $parts = explode('\\', $provider); if ($parts[0] == 'NexusPlugin') { $className = str_replace('ServiceProvider', 'Repository', $provider); - call_user_func([new $className, 'boot']); + if (class_exists($className)) { + call_user_func([new $className, 'boot']); + } } } }