# QuilldEvent events

> 8 FeatherPanel plugin events on QuilldEvent (8 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.

Source: https://featherpanel.com/docs/plugins/events/quilld/

Part of the [plugin events reference](https://featherpanel.com/docs/plugins/events/). Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions.

## Setup

Import `QuilldEvent` in your entry class and register listeners in `processEvents()`:

```php
<?php

namespace App\Addons\myplugin;

use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\QuilldEvent;

class MyPlugin implements AppPlugin
{
    public static function processEvents(PluginEvents $event): void
    {
        $event->on(QuilldEvent::onQuilldInstallRetrieved(), function ($webspace, $install): void {
            App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:install:retrieved ' . json_encode(['webspace' => $webspace, 'install' => $install]));
        });
    }

    public static function pluginInstall(): void
    {
    }

    public static function pluginUninstall(): void
    {
    }
}
```

## `QuilldEvent::onQuilldActivityLogged()`

- Name: `featherpanel:quilld:activity:logged`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L75)

Docblock: array activity.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `processed_count` | `$processedCount` | `int` |

When it fires (1 site)

-   [`QuilldActivityController::logActivity`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/QuilldActivityController.php#L106) via `emitPluginEvent()`[`POST /api/quilld-remote/activity`](https://featherpanel.com/docs/api/reference/quilld/remote/#post-quilld-remote-activity)

```php
$event->on(QuilldEvent::onQuilldActivityLogged(), function ($processedCount): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:activity:logged ' . json_encode(['processed_count' => $processedCount]));
});
```

## `QuilldEvent::onQuilldConfigRetrieved()`

- Name: `featherpanel:quilld:config:retrieved`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L83)

Docblock: array config. (the emitter passes 2 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `web_node_id` | `$webNodeId` | not declared |
| 2 | `panel_url` | `$panelUrl` | not declared |

When it fires (1 site)

-   [`FeatherQuilldConfigController::getConfig`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/FeatherQuilldConfigController.php#L47) via `emitPluginEvent()`[`GET /api/quilld-remote/config`](https://featherpanel.com/docs/api/reference/quilld/remote/#get-quilld-remote-config)

```php
$event->on(QuilldEvent::onQuilldConfigRetrieved(), function ($webNodeId, $panelUrl): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:config:retrieved');
});
```

## `QuilldEvent::onQuilldInstallCompleted()`

- Name: `featherpanel:quilld:install:completed`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L59)

Docblock: array webspace. (the emitter passes 4 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `webspace` | `$webspace` | not declared |
| 2 | `successful` | `$successful` | `bool` |
| 3 | `reinstall` | `$reinstall` | not declared |
| 4 | `status` | `$status` | not declared |

When it fires (1 site)

-   [`FeatherQuilldWebSpaceController::postInstall`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/FeatherQuilldWebSpaceController.php#L143) via `emitPluginEvent()`[`POST /api/quilld-remote/webspaces/{uuid}/install`](https://featherpanel.com/docs/api/reference/quilld/remote/#post-quilld-remote-webspaces-uuid-install)

```php
$event->on(QuilldEvent::onQuilldInstallCompleted(), function ($webspace, $successful, $reinstall, $status): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:install:completed ' . json_encode(['successful' => $successful]));
});
```

## `QuilldEvent::onQuilldInstallRetrieved()`

- Name: `featherpanel:quilld:install:retrieved`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L51)

Docblock: array webspace, array install.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `webspace` | `$webspace` | `array`from docblock |
| 2 | `install` | `$install` | `array`from docblock |

When it fires (1 site)

-   [`FeatherQuilldWebSpaceController::getInstall`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/FeatherQuilldWebSpaceController.php#L68) via `emitPluginEvent()`[`GET /api/quilld-remote/webspaces/{uuid}/install`](https://featherpanel.com/docs/api/reference/quilld/remote/#get-quilld-remote-webspaces-uuid-install)

```php
$event->on(QuilldEvent::onQuilldInstallRetrieved(), function ($webspace, $install): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:install:retrieved ' . json_encode(['webspace' => $webspace, 'install' => $install]));
});
```

## `QuilldEvent::onQuilldSftpAuthenticated()`

- Name: `featherpanel:quilld:sftp:authenticated`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L27)

Docblock: array auth context. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `webspace_uuid` | `$webspaceUuid` | not declared |
| 2 | `user_uuid` | `$userUuid` | not declared |
| 3 | `permissions` | `$permissions` | not declared |

When it fires (1 site)

-   [`SftpAuthController::authenticate`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/Sftp/SftpAuthController.php#L100) via `emitPluginEvent()`

```php
$event->on(QuilldEvent::onQuilldSftpAuthenticated(), function ($webspaceUuid, $userUuid, $permissions): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:sftp:authenticated');
});
```

## `QuilldEvent::onQuilldTransferStatusReported()`

- Name: `featherpanel:quilld:transfer:status`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L67)

Docblock: array transfer. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `webspace_uuid` | `$webspaceUuid` | `string` |
| 2 | `successful` | `$successful` | `bool` |
| 3 | `error` | `$error` | `bool` |

When it fires (1 site)

-   [`FeatherQuilldTransferController::postStatus`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/FeatherQuilldTransferController.php#L40) via `emitPluginEvent()`[`POST /api/quilld-remote/transfers/{uuid}`](https://featherpanel.com/docs/api/reference/quilld/remote/#post-quilld-remote-transfers-uuid)

```php
$event->on(QuilldEvent::onQuilldTransferStatusReported(), function ($webspaceUuid, $successful, $error): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:transfer:status ' . json_encode(['webspace_uuid' => $webspaceUuid, 'successful' => $successful, 'error' => $error]));
});
```

## `QuilldEvent::onQuilldWebSpaceRetrieved()`

- Name: `featherpanel:quilld:webspace:retrieved`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L35)

Docblock: array webspace.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `webspace` | `$webspace` | `array`from docblock |

When it fires (1 site)

-   [`FeatherQuilldWebSpaceController::getWebSpace`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/FeatherQuilldWebSpaceController.php#L43) via `emitPluginEvent()`[`GET /api/quilld-remote/webspaces/{uuid}`](https://featherpanel.com/docs/api/reference/quilld/remote/#get-quilld-remote-webspaces-uuid)

```php
$event->on(QuilldEvent::onQuilldWebSpaceRetrieved(), function ($webspace): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:webspace:retrieved ' . json_encode(['webspace' => $webspace]));
});
```

## `QuilldEvent::onQuilldWebSpaceUpdated()`

- Name: `featherpanel:quilld:webspace:updated`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/QuilldEvent.php#L43)

Docblock: array webspace.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `webspace` | `$webspace` | `array`from docblock |

When it fires (1 site)

-   [`FeatherQuilldWebSpaceController::patchWebSpace`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Quilld/FeatherQuilldWebSpaceController.php#L107) via `emitPluginEvent()`[`PATCH /api/quilld-remote/webspaces/{uuid}`](https://featherpanel.com/docs/api/reference/quilld/remote/#patch-quilld-remote-webspaces-uuid)

```php
$event->on(QuilldEvent::onQuilldWebSpaceUpdated(), function ($webspace): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:quilld:webspace:updated ' . json_encode(['webspace' => $webspace]));
});
```
