-
Notifications
You must be signed in to change notification settings - Fork 4
/
Plugin.php
50 lines (44 loc) · 1.26 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
<?php
namespace Samuell\Cdn;
use Samuell\Cdn\Classes\TwigExtension;
use System\Classes\PluginBase;
/**
* Cdn Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Cdn',
'description' => 'Sync theme assets with cdn.',
'author' => 'Samuell',
'icon' => 'icon-refresh'
];
}
public function register(): void
{
$this->registerConsoleCommand('cdn:sync', 'Samuell\Cdn\Console\Sync');
$this->registerConsoleCommand('cdn:push', 'Samuell\Cdn\Console\Push');
$this->registerConsoleCommand('cdn:clear', 'Samuell\Cdn\Console\Clear');
$this->registerConsoleCommand('cdn:clear-manifest-cache', 'Samuell\Cdn\Console\ClearManifestCache');
}
public function registerMarkupTags(): array
{
return [
'functions' => [
'asset_cdn' => function ($path) {
return (new TwigExtension)->assetCdn($path);
},
'cdn' => function ($path) {
return (new TwigExtension)->cdn($path);
},
]
];
}
}