From 1c5279f7c7f412f982e4fff1b590580fbd770f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 28 Feb 2022 10:13:27 +0800 Subject: [PATCH] modify plugin name --- function.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/function.php b/function.php index 99d2a2af..dcfef820 100644 --- a/function.php +++ b/function.php @@ -255,15 +255,15 @@ if (!function_exists('injectRuntime')) { $methods = $target->getMethodsAttribute(); foreach ($methods as $method => $attribute) { - if (str_contains($class, 'SiteController')) { echo $class, ' ', $method, ' ', var_export($attribute, 'true'), PHP_EOL; } - + /** @var ReflectionAttribute $item */ foreach ($attribute as $item) { + if (!class_exists($item->getName())) { + continue; + } $item = $item->newInstance(); - - if ($item instanceof Route) { $router[] = [$item, $class, $method]; } else {