Forked from
project / component_library
4 commits behind, 1 commit ahead of the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
component_library.install 1.05 KiB
<?php // phpcs:ignore Drupal.Commenting.FileComment.Missing
declare(strict_types=1);
/**
* @file
* Install, update and uninstall functions for the Component Library module.
*/
use Drupal\component_library\CodeMirrorSettings;
/**
* Implements hook_install().
*/
function component_library_install($is_syncing) {
// Enable CSS, JS, and TWIG CodeMirror support.
\Drupal::classResolver(CodeMirrorSettings::class)->enableLanguages();
// Clear caches so that pages will be rebuilt and contain the details needed
// to override templates.
drupal_flush_all_caches();
}
/**
* Change override mode config namespace.
*/
function component_library_update_9000(): void {
$config = \Drupal::configFactory()->getEditable('override_mode.settings');
$data = $config->getRawData();
if (!empty($data)) {
$namespaced_config = \Drupal::configFactory()->getEditable('component_library.override_mode.settings');
foreach ($data as $key => $value) {
$namespaced_config->set($key, $value);
}
$namespaced_config->save();
$config->delete();
}
}