-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWidgetBot.php
More file actions
48 lines (42 loc) · 1.13 KB
/
WidgetBot.php
File metadata and controls
48 lines (42 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace App\Addons\widgetbot;
use App\Plugins\Events\Events\AppEvent;
use App\Plugins\AppPlugin;
use App\Addons\widgetbot\Events\App\AppReadyEvent;
class WidgetBot implements AppPlugin
{
/**
* @inheritDoc
*/
public static function processEvents(\App\Plugins\PluginEvents $event): void
{
// Process plugin events here
// Example: $event->on('app.boot', function() { ... });
}
/**
* @inheritDoc
*/
public static function pluginInstall(): void
{
// Plugin installation logic
// Create tables, directories, etc.
}
/**
* @inheritDoc
*/
public static function pluginUpdate(?string $oldVersion, ?string $newVersion): void
{
// Plugin update logic
// Migrate data, update configurations, etc.
// $oldVersion contains the previous version (e.g., '1.0.0')
// $newVersion contains the new version being installed (e.g., '1.0.1')
}
/**
* @inheritDoc
*/
public static function pluginUninstall(): void
{
// Plugin uninstallation logic
// Clean up tables, files, etc.
}
}