Skip to content

Commit

Permalink
plugin check
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Jan 6, 2022
1 parent 93af3c4 commit 10abf85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions support/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public static function install($event)
}
$namespace = key($autoload['psr-4']);
$install_function = "\\{$namespace}Install::install";
if (is_callable($install_function)) {
$plugin_const = "\\{$namespace}Install::WEBMAN_PLUGIN";
if (defined($plugin_const) && is_callable($install_function)) {
$install_function();
}
}
Expand All @@ -30,8 +31,8 @@ public static function uninstall($event)
}
$namespace = key($autoload['psr-4']);
$uninstall_function = "\\{$namespace}Install::uninstall";
require_once __DIR__ . '/../vendor/autoload.php';
if (is_callable($uninstall_function)) {
$plugin_const = "\\{$namespace}Install::WEBMAN_PLUGIN";
if (defined($plugin_const) && is_callable($uninstall_function)) {
$uninstall_function();
}
}
Expand Down

0 comments on commit 10abf85

Please sign in to comment.