-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
64 lines (53 loc) · 1.52 KB
/
Plugin.php
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php namespace Renick\AirTable;
use Exception;
use Renick\AirTable\Classes\AirTable\AsyncAirTable;
use Renick\AirTable\Console\Backup;
use Renick\AirTable\Console\Tables;
use Renick\AirTable\Console\Records;
use System\Classes\PluginBase;
/**
* Plugin Information File
*
* @link https://docs.octobercms.com/3.x/extend/system/plugins.html
*/
class Plugin extends PluginBase
{
/**
* pluginDetails about this plugin.
*/
public function pluginDetails(): array
{
return [
'name' => 'renick.airtable::lang.plugin.name',
'description' => 'renick.airtable::lang.plugin.description',
'author' => 'Renick Büttner',
'icon' => 'icon-database'
];
}
public function register()
{
// no-op
}
public function boot(): void
{
parent::boot();
$this->registerConsoleCommand('airtable.tables', Tables::class);
$this->registerConsoleCommand('airtable.records', Records::class);
$this->registerConsoleCommand('airtable.backup', Backup::class);
}
public function registerComponents(): array
{
return [
\Renick\AirTable\Components\Tables::class => 'airTables',
\Renick\AirTable\Components\Records::class => 'airRecords'
];
}
private static AsyncAirTable $asyncInstance;
/**
* @throws Exception
*/
public static function asyncInstance(): AsyncAirTable
{
return self::$asyncInstance ??= AsyncAirTable::instance(null, null);
}
}