-
Notifications
You must be signed in to change notification settings - Fork 1
/
varbase_faqs.install
39 lines (30 loc) · 1.25 KB
/
varbase_faqs.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
<?php
/**
* @file
* Install, update and uninstall functions for the Varbase FAQs 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_faqs_install() {
// Processor for install: in varbase_faqs.info.yml file using ModuleInstallerFactory.
// ---------------------------------------------------------------------------.
ModuleInstallerFactory::installList('varbase_faqs');
// Install optional configs.
ModuleInstallerFactory::importConfigsFromScanedDirectory('varbase_faqs', '/^field.storage.*\\.(yml)$/i');
// Configure FAQ settings.
varbase_faqs__configure_faq_settings();
// --------------------------------------------------------------------------.
// 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_faqs');
}