-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationPlugin.php
More file actions
74 lines (66 loc) · 2.26 KB
/
Copy pathNotificationPlugin.php
File metadata and controls
74 lines (66 loc) · 2.26 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
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
65
66
67
68
69
70
71
72
73
74
<?php
declare(strict_types=1);
namespace Crustum\Notification;
use Cake\Console\CommandCollection;
use Cake\Core\BasePlugin;
use Cake\Core\PluginApplicationInterface;
use Crustum\Notification\Command\NotificationCommand;
use Crustum\PluginManifest\Manifest\ManifestInterface;
use Crustum\PluginManifest\Manifest\ManifestTrait;
/**
* Plugin for Notification
*
* @uses \Crustum\PluginManifest\Manifest\ManifestTrait
*/
class NotificationPlugin extends BasePlugin implements ManifestInterface
{
use ManifestTrait;
/**
* Load all the plugin configuration and bootstrap logic.
*
* The host application is provided as an argument. This allows you to load
* additional plugin dependencies, or attach events.
*
* @param \Cake\Core\PluginApplicationInterface<\Cake\Core\BasePlugin> $app The host application
* @return void
*/
public function bootstrap(PluginApplicationInterface $app): void
{
}
/**
* Add commands for the plugin
*
* @param \Cake\Console\CommandCollection $commands The command collection to update
* @return \Cake\Console\CommandCollection
*/
public function console(CommandCollection $commands): CommandCollection
{
$commands = parent::console($commands);
$commands->add('bake notification', NotificationCommand::class);
return $commands;
}
/**
* Get the manifest for the plugin.
*
* @return array<int, array<string, mixed>>
*/
public static function manifest(): array
{
$pluginPath = dirname(__DIR__);
return array_merge(
static::manifestMigrations(
$pluginPath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'Migrations',
),
static::manifestConfig(
$pluginPath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'notification.php.example',
CONFIG . 'notification.php',
false,
),
static::manifestBootstrapAppend(
"if (file_exists(CONFIG . 'notification.php')) {\n Configure::load('notification', 'default');\n}",
'// Notification Plugin Configuration',
),
static::manifestStarRepo('Crustum/Notification'),
);
}
}