FeatherZeroTrustEvent events
7 FeatherPanel plugin events on FeatherZeroTrustEvent (4 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. 3 of these events are declared but no code emits them yet; they are marked not emitted.
Setup
Import FeatherZeroTrustEvent 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\FeatherZeroTrustEvent;
class MyPlugin implements AppPlugin
{
public static function processEvents(PluginEvents $event): void
{
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustConfigRetrieved(), function ($config): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:config:retrieved ' . json_encode(['config' => $config]));
});
}
public static function pluginInstall(): void
{
}
public static function pluginUninstall(): void
{
}
}FeatherZeroTrustEvent::onFeatherZeroTrustConfigRetrieved()
Docblock: array config data.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | config | $config | arrayfrom docblock |
When it fires (1 site)
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustConfigRetrieved(), function ($config): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:config:retrieved ' . json_encode(['config' => $config]));
});FeatherZeroTrustEvent::onFeatherZeroTrustConfigUpdated()
Docblock: array old config, array new config. (the emitter passes 3 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | old_config | $oldConfig | not declared |
| 2 | new_config | $newConfig | not declared |
| 3 | updated_by | $updatedBy | not declared |
When it fires (1 site)
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustConfigUpdated(), function ($oldConfig, $newConfig, $updatedBy): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:config:updated');
});FeatherZeroTrustEvent::onFeatherZeroTrustError()
Docblock: string error message, array context.
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustError(), function (...$args): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:error ' . json_encode($args));
});No code emits this event yet, so the arguments are unknown. The listener accepts any.
FeatherZeroTrustEvent::onFeatherZeroTrustLogsRetrieved()
Docblock: array logs data.
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustLogsRetrieved(), function (...$args): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:logs:retrieved ' . json_encode($args));
});No code emits this event yet, so the arguments are unknown. The listener accepts any.
FeatherZeroTrustEvent::onFeatherZeroTrustScanCompleted()
Docblock: string server uuid, array scan results. (the emitter passes 3 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | server_uuid | $serverUuid | not declared |
| 2 | scan_results | $scanResults | not declared |
| 3 | detections_count | $detectionsCount | not declared |
When it fires (1 site)
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustScanCompleted(), function ($serverUuid, $scanResults, $detectionsCount): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:scan:completed');
});FeatherZeroTrustEvent::onFeatherZeroTrustScanError()
Docblock: string server uuid, string error message.
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustScanError(), function (...$args): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:scan:error ' . json_encode($args));
});No code emits this event yet, so the arguments are unknown. The listener accepts any.
FeatherZeroTrustEvent::onFeatherZeroTrustScanStarted()
Docblock: string server uuid, array scan data. (the emitter passes 4 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | server_uuid | $serverUuid | not declared |
| 2 | directory | $directory | not declared |
| 3 | max_depth | $maxDepth | not declared |
| 4 | started_by | $startedBy | not declared |
When it fires (1 site)
$event->on(FeatherZeroTrustEvent::onFeatherZeroTrustScanStarted(), function ($serverUuid, $directory, $maxDepth, $startedBy): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:featherzerotrust:scan:started');
});