-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.module
More file actions
39 lines (36 loc) · 1.15 KB
/
Copy pathdeploy.module
File metadata and controls
39 lines (36 loc) · 1.15 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
<?php
/**
* @file
* Site deployment functions.
*/
use Drupal\Core\Extension\InfoParser;
/**
* Updates dependencies based on the site deployment's info file.
*
* If during the course of development, you add a dependency to your
* site deployment module's .info file, increment the update hook
* (see the .install module) and this function will be called, making
* sure dependencies are enabled.
*/
function deploy_update_dependencies() {
$parser = new InfoParser;
$info_file = $parser->parse(drupal_get_path('module', 'deploy') . '/deploy.info.yml');
if (isset($info_file['dependencies'])) {
\Drupal::service('module_installer')->install($info_file['dependencies'], TRUE);
}
}
/**
* Set the UUID of this website.
*
* By default, reinstalling a site will assign it a new random UUID, making
* it impossible to sync configuration with other instances. This function
* is called by site deployment module's .install hook.
*
* @param $uuid
* A uuid string, for example 'e732b460-add4-47a7-8c00-e4dedbb42900'.
*/
function deploy_set_uuid($uuid) {
\Drupal::configFactory()->getEditable('system.site')
->set('uuid', $uuid)
->save();
}