-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
256 lines (228 loc) · 5.15 KB
/
config.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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
/**
* Plugin configuration
*
* The constants defined here do not override any default behavior
* or default user interfaces. However, the corresponding behavior
* can be overridden in the system config file (e.g. `wp-config`,
* `app-config` ).
*
* The reason for using constants in the config file rather than
* in a settings file is to prevent site administrators wrongly
* or incorrectly configuring the site built by developers.
*
* @package Site_Core
* @subpackage Configuration
* @category Core
* @since 1.0.0
*/
namespace SiteCore;
// Alias namespaces.
use SiteCore\Classes as Classes;
// Restrict direct access.
if ( ! defined( 'ABSPATH' ) ) {
die;
}
/**
* Constant: Minimum PHP version
*
* @since 1.0.0
* @var string The minimum required PHP version.
*/
define( 'SCP_MIN_PHP_VERSION', '7.4' );
/**
* Function: Minimum PHP version
*
* Checks the PHP version running on the current host
* against the minimum version required by this plugin.
*
* @since 1.0.0
* @return boolean Returns false if the minimum is not met.
*/
function min_php_version() {
if ( version_compare( phpversion(), SCP_MIN_PHP_VERSION, '<' ) ) {
return false;
}
return true;
}
/**
* Constant: Plugin version
*
* Keeping the version at 1.0.0 as this is a starter plugin but
* you may want to start counting as you develop for your use case.
*
* Remember to find and replace the `@version x.x.x` in docblocks.
*
* @since 1.0.0
* @var string The latest plugin version.
*/
define( 'SCP_VERSION', '1.0.0' );
/**
* Plugin name
*
* @since 1.0.0
* @var string The name of the plugin.
*/
if ( ! defined( 'SCP_NAME' ) ) {
define( 'SCP_NAME', __( 'Site Core', 'sitecore' ) );
}
/**
* Constant: Plugin folder path
*
* @since 1.0.0
* @var string The filesystem directory path (with trailing slash)
* for the plugin __FILE__ passed in.
*/
define( 'SCP_PATH', plugin_dir_path( __FILE__ ) );
/**
* Constant: Plugin folder URL
*
* @since 1.0.0
* @var string The URL directory path (with trailing slash)
* for the plugin __FILE__ passed in.
*/
define( 'SCP_URL', plugin_dir_url( __FILE__ ) );
/**
* PHP version check
*
* Stop here if the minimum PHP version is not met.
* The following array definitions wi break sites
* running older PHP versions.
*
* @since 1.0.0
* @return void
*/
if ( ! min_php_version() ) {
return;
}
/**
* Constant: Plugin configuration.
*
* @since 1.0.0
* @var array Plugin identification, support, settings.
*/
if ( ! defined( 'SCP_CONFIG' ) ) {
define( 'SCP_CONFIG', [
/**
* Plugin name
*
* Remember to replace in the plugin header.
*
* @since 1.0.0
* @var string The name of the plugin.
*/
'name' => SCP_NAME,
/**
* Developer name
*
* @since 1.0.0
* @var string The name of the developer/agency.
*/
'dev_name' => __( 'Controlled Chaos', 'sitecore' ),
/**
* Developer URL
*
* @since 1.0.0
* @var string The URL of the developer/agency.
*/
'dev_url' => esc_url( 'https://ccdzine.com/' ),
/**
* Developer email
*
* @since 1.0.0
* @var string The URL of the developer/agency.
*/
'dev_email' => sanitize_email( '[email protected]' ),
/**
* Plugin URL
*
* @since 1.0.0
* @var string The URL of the plugin.
*/
'plugin_url' => esc_url( 'https://github.com/ControlledChaos/sitecore' ),
/**
* Allow Site Health
*
* @since 1.0.0
* @var boolean Whether to allow the Site Health feature.
*/
'site_health' => false,
/**
* Allow Customizer
*
* @since 1.0.0
* @var boolean Whether to allow the Customizer.
*/
'customizer' => true,
/**
* User admin color picker
*
* @since 1.0.0
* @var boolean Whether to allow admin color pickers.
*/
'color_picker' => true
] );
}
/**
* Developer name
*
* @since 1.0.0
* @var string The name of the developer/agency.
*/
if ( ! defined( 'SCP_DEV_NAME' ) ) {
define( 'SCP_DEV_NAME', SCP_CONFIG['dev_name'] );
}
/**
* Developer URL
*
* @since 1.0.0
* @var string The URL of the developer/agency.
*/
if ( ! defined( 'SCP_DEV_URL' ) ) {
define( 'SCP_DEV_URL', SCP_CONFIG['dev_url'] );
}
/**
* Developer email
*
* @since 1.0.0
* @var string The URL of the developer/agency.
*/
if ( ! defined( 'SCP_DEV_EMAIL' ) ) {
define( 'SCP_DEV_EMAIL', SCP_CONFIG['dev_email'] );
}
/**
* Plugin URL
*
* @since 1.0.0
* @var string The URL of the plugin.
*/
if ( ! defined( 'SCP_PLUGIN_URL' ) ) {
define( 'SCP_PLUGIN_URL', SCP_CONFIG['plugin_url'] );
}
/**
* Allow Site Health
*
* @since 1.0.0
* @var boolean Whether to allow the Site Health feature.
*/
if ( ! defined( 'SCP_DISABLE_SITE_HEALTH' ) ) {
define( 'SCP_DISABLE_SITE_HEALTH', SCP_CONFIG['site_health'] );
}
/**
* Allow Customizer
*
* @since 1.0.0
* @var boolean Whether to allow the Customizer.
*/
if ( ! defined( 'SCP_ALLOW_CUSTOMIZER' ) ) {
define( 'SCP_ALLOW_CUSTOMIZER', SCP_CONFIG['customizer'] );
}
/**
* User admin color picker
*
* @since 1.0.0
* @var boolean Whether to allow admin color pickers.
*/
if ( ! defined( 'SCP_ALLOW_ADMIN_COLOR_PICKER' ) ) {
define( 'SCP_ALLOW_ADMIN_COLOR_PICKER', SCP_CONFIG['color_picker'] );
}