-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.php
35 lines (29 loc) · 988 Bytes
/
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
<?php
declare(strict_types=1);
namespace Vdlp\RedirectConditionsExample;
use System\Classes\PluginBase;
use Vdlp\Redirect\Classes\Contracts\RedirectManagerInterface;
use Vdlp\RedirectConditionsExample\Classes\IpAddressCondition;
class Plugin extends PluginBase
{
public $require = [
'Vdlp.Redirect',
'Vdlp.RedirectConditions',
];
public function pluginDetails(): array
{
return [
'name' => 'Redirect Condition Extension: Example',
'description' => 'A Redirect Condition implementation example plugin.',
'author' => 'Van der Let & Partners',
'icon' => 'icon-link',
'homepage' => 'https://github.com/vdlp/oc-redirectconditionsexample-plugin',
];
}
public function boot(): void
{
/** @var RedirectManagerInterface $manager */
$manager = resolve(RedirectManagerInterface::class);
$manager->addCondition(IpAddressCondition::class, 1);
}
}