View .md

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()

Name: featherpanel:cloud:plugin:installedemitted at 2 sitesCancel or modify: nodefinition

Docblock: string identifier, array plugin data, string user uuid.

#Payload keyListener parameterType
1identifier$identifierstringfrom docblock
2plugin_data$pluginDataarrayfrom docblock
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:cloud:plugin:uninstallednot emittedCancel or modify: nodefinition

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.