mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +01:00
add enable param to installPlugin function
This commit is contained in:
parent
85f8f11481
commit
819422acc8
@ -13,7 +13,7 @@ use Filament\Panel;
|
||||
* @method static void loadPanelPlugins(Panel $panel)
|
||||
* @method static void requireComposerPackages(Plugin $plugin)
|
||||
* @method static void runPluginMigrations(Plugin $plugin)
|
||||
* @method static void installPlugin(Plugin $plugin)
|
||||
* @method static void installPlugin(Plugin $plugin, bool $enable = true)
|
||||
* @method static void updatePlugin(Plugin $plugin)
|
||||
* @method static void downloadPluginFromFile(UploadedFile $file)
|
||||
* @method static void downloadPluginFromUrl(string $url)
|
||||
|
||||
@ -187,7 +187,7 @@ class PluginService
|
||||
return false;
|
||||
}
|
||||
|
||||
public function installPlugin(Plugin $plugin): void
|
||||
public function installPlugin(Plugin $plugin, bool $enable = true): void
|
||||
{
|
||||
try {
|
||||
$this->requireComposerPackages($plugin);
|
||||
@ -196,7 +196,9 @@ class PluginService
|
||||
|
||||
$this->buildAssets();
|
||||
|
||||
$this->enablePlugin($plugin);
|
||||
if ($enable) {
|
||||
$this->enablePlugin($plugin);
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
report($exception);
|
||||
|
||||
@ -209,11 +211,7 @@ class PluginService
|
||||
try {
|
||||
$this->downloadPluginFromUrl($plugin->getDownloadUrlForUpdate(), true);
|
||||
|
||||
$this->requireComposerPackages($plugin);
|
||||
|
||||
$this->runPluginMigrations($plugin);
|
||||
|
||||
$this->buildAssets();
|
||||
$this->installPlugin($plugin, false);
|
||||
|
||||
cache()->forget("plugins.$plugin->id.update");
|
||||
} catch (Exception $exception) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user