Installs the default configuration of a given extension.
string $type: The extension type; e.g., 'module' or 'theme'.
string $name: The name of the module or theme to install default configuration for.
function config_install_default_config($type, $name) {
$config_dir = drupal_get_path($type, $name) . '/config';
if (is_dir($config_dir)) {
$source_storage = new FileStorage($config_dir);
$storage_comparer = new StorageComparer($source_storage, Drupal::service('config.storage'));
// Only import new config. Changed config is from previous enables and
// should not be overwritten.
$storage_comparer
->addChangelistCreate();
$installer = new ConfigInstaller($storage_comparer, Drupal::service('event_dispatcher'), Drupal::service('config.factory'), Drupal::entityManager(), Drupal::lock());
$installer
->import();
}
}