function config_install_default_config

Installs the default configuration of a given extension.

Parameters

string $type: The extension type; e.g., 'module' or 'theme'.

string $name: The name of the module or theme to install default configuration for.

14 calls to config_install_default_config()
ConfigDiffTest::testDiff in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
Tests calculating the difference between two sets of configuration.
ConfigImporterTest::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
Sets up Drupal unit test environment.
ConfigLocaleOverride::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
Sets up Drupal unit test environment.
ConfigOverrideTest::testConfOverride in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
Tests configuration override.
ConfigSchemaTest::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
Sets up Drupal unit test environment.

... See full list

File

drupal/core/includes/config.inc, line 24
This is the API for configuration storage.

Code

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();
  }
}