String$moduleName: The machine name for the module.
String$modulesListKey: Optional list key which to get the list of modules from. Default 'install'. It can be changed on managed cases like (managed, when_module_name_enabled)
Boolean$setModuleWeight: A flag to auto set the weight of the module after installation of a list of modules.
String$moduleName: The machine name for the module.
Array$listOfConfigFiles: The list of config files.
String$configDirectory: The config directory which to partial import the list from.
It could be used in some cases to change the default View for the Content or People with multilingual sites or extra filters by other modules. It is important which manage the Assemble components and install installation step.
Example 2: In Use Import of Configs
Having a custom config for a disabled module, which will be Enabled and Disabled many times with development and deployments, but they need to have the basic extra change for config over the default settings or configs for the used module.
/**
* Implements hook_modules_installed().
*/
function varbase_security_modules_installed($modules, $is_syncing) {
if (in_array('security_review', $modules)) {
// The module will be Enabled and Disabled many times
// with development and deployments to production sites.
// But the need to have the basic extra change for config over
// the Security Review default configs.
// -------------------------------------------------
// Managed configs for the Security Review module.
$managed_configs = [
'security_review.settings',
'security_review.check.security_review-admin_permissions',
'security_review.check.security_review-error_reporting',
'security_review.check.security_review-executable_php',
'security_review.check.security_review-failed_logins',
'security_review.check.security_review-field',
'security_review.check.security_review-file_perms',
'security_review.check.security_review-input_formats',
'security_review.check.security_review-private_files',
'security_review.check.security_review-query_errors',
'security_review.check.security_review-temporary_files',
'security_review.check.security_review-trusted_hosts',
'security_review.check.security_review-upload_extensions',
'security_review.check.security_review-views_access',
];
// Import managed configs to the site active configs.
ModuleInstallerFactory::importConfigsFromList('varbase_security', $managed_configs, 'config/managed/security_review');
// 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();
}
}