-
Notifications
You must be signed in to change notification settings - Fork 690
Expand file tree
/
Copy pathPluginTrait.php
More file actions
141 lines (120 loc) · 4.18 KB
/
PluginTrait.php
File metadata and controls
141 lines (120 loc) · 4.18 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\base;
use craft\enums\CmsEdition;
/**
* PluginTrait implements the common methods and properties for plugin classes.
*
* @author Pixel & Tonic, Inc. <[email protected]>
* @since 3.0.0
*/
trait PluginTrait
{
/**
* @var string|null The plugin’s package name
*/
public ?string $packageName = null;
/**
* @var string|null The plugin’s display name
*/
public ?string $name = null;
/**
* @var string The plugin’s schema version number
*/
public string $schemaVersion = '1.0.0';
/**
* @var string|null The plugin’s description
*/
public ?string $description = null;
/**
* @var string|null The plugin developer’s name
*/
public ?string $developer = null;
/**
* @var string|null The plugin developer’s website URL
*/
public ?string $developerUrl = null;
/**
* @var string|null The plugin developer’s support email
*/
public ?string $developerEmail = null;
/**
* @var string|null The plugin’s documentation URL
*/
public ?string $documentationUrl = null;
/**
* @var string|null The plugin’s changelog URL.
*
* The URL should begin with `https://` and point to a plain text Markdown-formatted changelog.
* Version headers must follow the general format:
*
* ```
* ## X.Y.Z - YYYY-MM-DD
* ```
*
* with the following possible deviations:
*
* - other text can come before the version number, like the plugin’s name
* - a 4th version number is allowed (e.g. `1.2.3.4`)
* - pre-release versions are allowed (e.g. `1.0.0-alpha.1`)
* - the version can start with `v` (e.g. `v1.2.3`)
* - the version can be hyperlinked (e.g. `[1.2.3]`)
* - dates can use dots as separators, rather than hyphens (e.g. `YYYY.MM.DD`)
* - a `[CRITICAL]` flag can be appended after the date to indicate a critical release
*
* More notes:
*
* - Releases should be listed in descending order (newest on top). Craft will stop parsing the changelog as soon as it hits a version that is older than or equal to the installed version.
* - Any content that does not follow a version header line will be ignored.
* - For consistency and clarity, release notes should follow [keepachangelog.com](http://keepachangelog.com/), but it’s not enforced.
* - Release notes can contain notes using the format `> {note} Some note`. `{warning}` and `{tip}` are also supported.
*/
public ?string $changelogUrl = null;
/**
* @var string|null The plugin’s download URL
*/
public ?string $downloadUrl = null;
/**
* @var string|null The translation category that this plugin’s translation messages should use. Defaults to the lowercased plugin handle.
*/
public ?string $t9nCategory = null;
/**
* @var string The language that the plugin’s messages were written in
*/
public string $sourceLanguage = 'en-US';
/**
* @var bool Whether the plugin has a settings page in the control panel
*/
public bool $hasCpSettings = false;
/**
* @var bool Whether the plugin supports a read-only settings page in the control panel, which
* can be shown when admin changes are disallowed.
* @since 5.6.0
*/
public bool $hasReadOnlyCpSettings = false;
/**
* @var bool Whether the plugin has its own section in the control panel
*/
public bool $hasCpSection = false;
/**
* @var bool Whether the plugin is currently installed. (Will only be false when a plugin is currently being installed.)
*/
public bool $isInstalled = false;
/**
* @var string The minimum required version the plugin has to be so it can be updated.
*/
public string $minVersionRequired = '';
/**
* @var CmsEdition The minimum required Craft CMS edition.
* @since 5.0.0
*/
public CmsEdition $minCmsEdition = CmsEdition::Solo;
/**
* @var string The active edition.
*/
public string $edition = 'standard';
}