CloudPluginsEvent events
2 FeatherPanel plugin events on CloudPluginsEvent (1 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.
Last synced from FeatherPanel 15b94e9 on .
On this page
Part of the plugin events reference. Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions. 1 of these events are declared but no code emits them yet; they are marked not emitted.
Setup
Import CloudPluginsEvent in your entry class and register listeners in processEvents():
<?php
namespace App\Addons\myplugin;
use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\CloudPluginsEvent;
class MyPlugin implements AppPlugin
{
public static function processEvents(PluginEvents $event): void
{
$event->on(CloudPluginsEvent::onPluginInstalled(), function ($identifier, $pluginData, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:cloud:plugin:installed ' . json_encode(['identifier' => $identifier, 'plugin_data' => $pluginData, 'user_uuid' => $userUuid]));
});
}
public static function pluginInstall(): void
{
}
public static function pluginUninstall(): void
{
}
}CloudPluginsEvent::onPluginInstalled()
Docblock: string identifier, array plugin data, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | identifier | $identifier | stringfrom docblock |
| 2 | plugin_data | $pluginData | arrayfrom docblock |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (2 sites)
$event->on(CloudPluginsEvent::onPluginInstalled(), function ($identifier, $pluginData, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:cloud:plugin:installed ' . json_encode(['identifier' => $identifier, 'plugin_data' => $pluginData, 'user_uuid' => $userUuid]));
});CloudPluginsEvent::onPluginUninstalled()
Docblock: string identifier, string user uuid.
$event->on(CloudPluginsEvent::onPluginUninstalled(), function (...$args): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:cloud:plugin:uninstalled ' . json_encode($args));
});No code emits this event yet, so the arguments are unknown. The listener accepts any.