Skip to content

Commit

Permalink
installScript及uninstallScript无法调用问题
Browse files Browse the repository at this point in the history
  • Loading branch information
初学者3 committed Jun 14, 2024
1 parent 4439ea0 commit b666046
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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'])) {
Expand Down

0 comments on commit b666046

Please sign in to comment.