forked from dpc-sdp/tide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtide.install
52 lines (47 loc) · 1.57 KB
/
tide.install
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
<?php
/**
* @file
* Install and uninstall functions for the Tide profile installation profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for Tide profile Profile.
*
* @see system_install()
*/
function tide_install() {
// Don't do anything else during config sync.
if (\Drupal::isConfigSyncing()) {
return;
}
// Set the default and admin theme to Seven. It is important to set themes
// only to enabled ones (and we are enabling Seven in profile dependencies).
\Drupal::configFactory()
->getEditable('system.theme')
->set('default', 'seven')
->set('admin', 'seven')
->save(TRUE);
// Set the path to the logo and favicon files based on install directory.
$profile_path = drupal_get_path('profile', 'tide');
\Drupal::configFactory()
->getEditable('system.theme.global')
->set('logo', [
'path' => $profile_path . '/logo.png',
'url' => '',
'use_default' => FALSE,
])
->set('favicon', [
'mimetype' => 'image/vnd.microsoft.icon',
'path' => $profile_path . '/favicon.ico',
'url' => '',
'use_default' => FALSE,
])
->save(TRUE);
// Workaround for redis module: it must be enabled before configuration can
// be bootstrapped. We are already using installation phase to exclude redis
// configuration in /bay/settings.php and to install the module itself.
if (file_exists(DRUPAL_ROOT . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'contrib' . DIRECTORY_SEPARATOR . 'redis')) {
\Drupal::service('module_installer')->install(['redis']);
}
}