mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +01:00
add plugin dev mode
This commit is contained in:
parent
4759c62432
commit
e970ae3767
@ -22,6 +22,7 @@ use Filament\Panel;
|
||||
* @method static void updateLoadOrder(array<int, string> $order)
|
||||
* @method static bool hasThemePluginEnabled()
|
||||
* @method static string[] getPluginLanguages()
|
||||
* @method static bool isDevModeActive()
|
||||
*
|
||||
* @see \App\Services\Helpers\PluginService
|
||||
*/
|
||||
|
||||
@ -113,6 +113,10 @@ class PluginService
|
||||
});
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
if ($this->isDevModeActive()) {
|
||||
throw ($exception);
|
||||
}
|
||||
|
||||
report($exception);
|
||||
|
||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||
@ -144,6 +148,10 @@ class PluginService
|
||||
|
||||
$this->enablePlugin($plugin);
|
||||
} catch (Exception $exception) {
|
||||
if ($this->isDevModeActive()) {
|
||||
throw ($exception);
|
||||
}
|
||||
|
||||
report($exception);
|
||||
|
||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||
@ -181,6 +189,10 @@ class PluginService
|
||||
|
||||
return true;
|
||||
} catch (Exception $exception) {
|
||||
if ($this->isDevModeActive()) {
|
||||
throw ($exception);
|
||||
}
|
||||
|
||||
report($exception);
|
||||
}
|
||||
|
||||
@ -200,6 +212,10 @@ class PluginService
|
||||
$this->enablePlugin($plugin);
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
if ($this->isDevModeActive()) {
|
||||
throw ($exception);
|
||||
}
|
||||
|
||||
report($exception);
|
||||
|
||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||
@ -215,6 +231,10 @@ class PluginService
|
||||
|
||||
cache()->forget("plugins.$plugin->id.update");
|
||||
} catch (Exception $exception) {
|
||||
if ($this->isDevModeActive()) {
|
||||
throw ($exception);
|
||||
}
|
||||
|
||||
report($exception);
|
||||
|
||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||
@ -328,4 +348,9 @@ class PluginService
|
||||
|
||||
return array_unique($languages);
|
||||
}
|
||||
|
||||
public function isDevModeActive(): bool
|
||||
{
|
||||
return config('panel.plugin.dev_mode', false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,4 +68,8 @@ return [
|
||||
'webhook' => [
|
||||
'prune_days' => env('APP_WEBHOOK_PRUNE_DAYS', 30),
|
||||
],
|
||||
|
||||
'plugin' => [
|
||||
'dev_mode' => env('PANEL_PLUGIN_DEV_MODE', false),
|
||||
],
|
||||
];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user