-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
39 lines (31 loc) · 1.18 KB
/
Plugin.php
File metadata and controls
39 lines (31 loc) · 1.18 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
<?php
namespace App\Vito\Plugins\Arzola\ExtraPhpExtensions;
use App\Models\Service;
use App\Plugins\AbstractPlugin;
use App\Plugins\RegisterCommand;
use App\Vito\Plugins\Arzola\ExtraPhpExtensions\Actions\FetchExtensions;
use App\Vito\Plugins\Arzola\ExtraPhpExtensions\Commands\FetchCommand;
use App\Vito\Plugins\Arzola\ExtraPhpExtensions\Commands\UninstallCommand;
use App\Vito\Plugins\Arzola\ExtraPhpExtensions\Handlers\ExtraExtensionsHandler;
class Plugin extends AbstractPlugin
{
protected string $name = 'Extra PHP Extensions Plugin';
protected string $description = 'A Vito plugin that automatically fetches and manages available extra PHP extensions.';
public function boot(): void
{
RegisterCommand::make(FetchCommand::class)->register();
RegisterCommand::make(UninstallCommand::class)->register();
app(ExtraExtensionsHandler::class)->run();
}
public function enable(): void
{
$data = Service::where('type', 'php')->get();
$data->each(function ($php) {
app(FetchExtensions::class)->handle($php);
});
}
public function disable(): void
{
app(UninstallCommand::class)->handle();
}
}