-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefaults.php
58 lines (50 loc) · 1.26 KB
/
Defaults.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
<?php
namespace Druidfi\Omen;
class Defaults
{
private array $config = [];
private array $settings = [
'config_exclude_modules' => [
'devel',
'stage_file_proxy',
'upgrade_status',
],
];
public function __construct(string $app_env)
{
$this->config['system.logging']['error_level'] = match ($app_env) {
'dev' => 'verbose',
default => 'hide',
};
$this->config['system.performance'] = match ($app_env) {
'dev' => [
'cache' => ['page' => ['max_age' => 0]],
'css' => ['preprocess' => 0],
'js' => ['preprocess' => 0],
],
default => [
'cache' => ['page' => ['max_age' => 900]],
'css' => ['preprocess' => 1],
'js' => ['preprocess' => 1],
],
};
$this->settings['skip_permissions_hardening'] = match ($app_env) {
'dev' => TRUE,
default => FALSE,
};
// Simple Environment Indicator.
$this->settings['simple_environment_indicator'] = match ($app_env) {
'dev' => 'Black Development',
'test' => 'Blue Testing',
'prod' => 'DarkRed Production',
default => FALSE,
};
}
public function getDefaults() : array
{
return [
'config' => $this->config,
'settings' => $this->settings,
];
}
}