-
Notifications
You must be signed in to change notification settings - Fork 2
/
varbase_core.install
37 lines (29 loc) · 1.24 KB
/
varbase_core.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
<?php
/**
* @file
* Install, update and uninstall functions for the Varbase core module.
*/
use Vardot\Entity\EntityDefinitionUpdateManager;
use Vardot\Installer\ModuleInstallerFactory;
// Include all helpers and updates.
include_once __DIR__ . '/includes/helpers.inc';
include_once __DIR__ . '/includes/updates.inc';
/**
* Implements hook_install().
*/
function varbase_core_install() {
// Processor for install: in varbase_core.info.yml file.
// --------------------------------------------------------------------------.
ModuleInstallerFactory::installList('varbase_core');
// Install optional configs.
ModuleInstallerFactory::importConfigsFromScanedDirectory('varbase_core', '/^field.storage.*\\.(yml)$/i');
ModuleInstallerFactory::importConfigsFromScanedDirectory('varbase_core', '/^.*(settings.yml)$/i');
// --------------------------------------------------------------------------.
// Entity updates to clear up any mismatched entity and/or field definitions
// And Fix changes were detected in the entity type and field definitions.
\Drupal::classResolver()
->getInstanceFromDefinition(EntityDefinitionUpdateManager::class)
->applyUpdates();
// Add permissions.
ModuleInstallerFactory::addPermissions('varbase_core');
}