forked from OFFLINE-GmbH/oc-mall-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.php
63 lines (54 loc) · 1.95 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
<?php declare(strict_types=1);
namespace OFFLINE\Mall;
use Illuminate\Support\Facades\View;
use Locale;
use OFFLINE\Mall\Classes\Registration\BootComponents;
use OFFLINE\Mall\Classes\Registration\BootEvents;
use OFFLINE\Mall\Classes\Registration\BootExtensions;
use OFFLINE\Mall\Classes\Registration\BootMails;
use OFFLINE\Mall\Classes\Registration\BootRelations;
use OFFLINE\Mall\Classes\Registration\BootServiceContainer;
use OFFLINE\Mall\Classes\Registration\BootSettings;
use OFFLINE\Mall\Classes\Registration\BootTwig;
use OFFLINE\Mall\Classes\Registration\BootValidation;
use OFFLINE\Mall\Console\CheckCommand;
use OFFLINE\Mall\Console\IndexCommand;
use OFFLINE\Mall\Console\PurgeCommand;
use OFFLINE\Mall\Console\SeedDataCommand;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public $require = ['RainLab.User', 'RainLab.Location', 'RainLab.Translate'];
use BootEvents;
use BootExtensions;
use BootServiceContainer;
use BootSettings;
use BootComponents;
use BootMails;
use BootValidation;
use BootTwig;
use BootRelations;
public function __construct($app)
{
parent::__construct($app);
// The morph map has to be registered in the constructor so it is available
// when plugin migrations are run.
$this->registerRelations();
}
public function register()
{
$this->registerServices();
$this->registerTwigEnvironment();
}
public function boot()
{
$this->registerExtensions();
$this->registerEvents();
$this->registerValidationRules();
$this->registerConsoleCommand('offline.mall.check', CheckCommand::class);
$this->registerConsoleCommand('offline.mall.index', IndexCommand::class);
$this->registerConsoleCommand('offline.mall.purge', PurgeCommand::class);
$this->registerConsoleCommand('offline.mall.seed', SeedDataCommand::class);
View::share('app_url', config('app.url'));
}
}