function externalauth_post_update_add_view_authmap in External Authentication 2.0.x
Imports new view for authmap entries.
File
- ./
externalauth.post_update.php, line 15 - Post update functions for the externalauth module.
Code
function externalauth_post_update_add_view_authmap() {
if (\Drupal::moduleHandler()
->moduleExists('views') && !View::load('authmap')) {
$module_path = \Drupal::moduleHandler()
->getModule('externalauth')
->getPath();
$file_storage = new FileStorage($module_path . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY);
$view = \Drupal::entityTypeManager()
->getStorage('view')
->create($file_storage
->read('views.view.authmap'));
$view
->save();
}
}