// Throw an exception if the module name is too long.
if (strlen($module) > DRUPAL_EXTENSION_NAME_MAX_LENGTH
) { throw new ExtensionNameLengthException("Module name '
$module' is over the maximum allowed length of " . DRUPAL_EXTENSION_NAME_MAX_LENGTH . ' characters'
);
} // Load a new config object for each iteration, otherwise changes made
// in hook_install() are not reflected in $extension_config.
$extension_config = \Drupal::
configFactory()->
getEditable('core.extension'
);
// Check the validity of the default configuration. This will throw
// exceptions if the configuration is not valid.
$config_installer->
checkConfigurationToInstall('module',
$module);
// Save this data without checking schema. This is a performance
// improvement for module installation.
$extension_config ->
set("module.
$module", 0
) ->
set('module',
module_config_sort($extension_config->
get('module'
))) ->
save(TRUE
);
// Prepare the new module list, sorted by weight, including filenames.
// This list is used for both the ModuleHandler and DrupalKernel. It
// needs to be kept in sync between both. A DrupalKernel reboot or