From b6660465179dba4f47a14ccbce30e04c6bbea1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=9D=E5=AD=A6=E8=80=853?= Date: Fri, 14 Jun 2024 20:07:30 +0800 Subject: [PATCH] =?UTF-8?q?installScript=E5=8F=8AuninstallScript=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=B0=83=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Plugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 3eecadf..dd2d251 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -228,8 +228,8 @@ public static function install(string $path): void $frontDirectory = self::getConfig('front_directory', BASE_PATH . '/web'); - if (! empty($info['installScript']) && class_exists($info['installScript'])) { - $installScript = ApplicationContext::getContainer()->make($info['installScript']); + if (! empty($info['composer']['installScript']) && class_exists($info['composer']['installScript'])) { + $installScript = ApplicationContext::getContainer()->make($info['composer']['installScript']); $installScript(); } @@ -303,8 +303,8 @@ public static function uninstall(string $path): void 'No installation behavior was detected for this plugin, and uninstallation could not be performed' ); } - if (! empty($info['uninstallScript']) && class_exists($info['uninstallScript'])) { - $uninstallScript = ApplicationContext::getContainer()->make($info['uninstallScript']); + if (! empty($info['composer']['uninstallScript']) && class_exists($info['composer']['uninstallScript'])) { + $uninstallScript = ApplicationContext::getContainer()->make($info['composer']['uninstallScript']); $uninstallScript(); } if (! empty($info['composer']['require'])) {