You are here

public static function ConfigurationManagement::importToActiveStore in Configuration Management 7.2

Loads the configuration from the DataStore into the ActiveStore.

Parameters

array $list: The list of components that have to will be imported.

boolean $import_dependencies: If TRUE, dependencies of each proccessed configuration will be imported too.

boolean $import_optionals: If TRUE, optionals configurations of each proccessed configuration will be imported too.

boolean $start_tracking: If TRUE, after import the configuration, it will be also tracked.

$source: Optional. An optional path to load configurations.

Return value

ConfigIteratorSettings An ConfigIteratorSettings object that contains the imported configurations.

16 calls to ConfigurationManagement::importToActiveStore()
ConfigurationApiTest::testimportToActiveStore in tests/configuration.test
ConfigurationHandlerBaseTestCase::testCheckModifications in tests/handlers/ConfigurationHandlerBaseTestCase.test
Import a configuration. Make modifications on it, and then revert it.
ConfigurationHandlerBaseTestCase::testImportToActiveStore in tests/handlers/ConfigurationHandlerBaseTestCase.test
Import a configuration from the DataStore into the ActiveStore.
ConfigurationHandlerMenuLinksTestCase::testCheckModifications in tests/handlers/menu_links.test
ConfigurationHandlerMenuLinksTestCase::testImportToActiveStore in tests/handlers/menu_links.test

... See full list

File

lib/Drupal/configuration/Config/ConfigurationManagement.php, line 258
Definition of Drupal\configuration\Config\ConfigurationManagement.

Class

ConfigurationManagement

Namespace

Drupal\configuration\Config

Code

public static function importToActiveStore($list = array(), $import_dependencies = TRUE, $import_optionals = TRUE, $start_tracking = FALSE, $source = NULL) {
  $excluded = static::excludedConfigurations();
  $settings = new ConfigIteratorSettings(array(
    'build_callback' => 'loadFromStorage',
    'callback' => 'import',
    'process_dependencies' => $import_dependencies,
    'process_optionals' => $import_optionals,
    'settings' => array(
      'start_tracking' => $start_tracking,
      'source' => $source,
      'excluded' => $excluded,
    ),
    'info' => array(
      'imported' => array(),
      'fail' => array(),
      'no_handler' => array(),
    ),
  ));
  module_invoke_all('configuration_pre_import', $settings);
  $handlers = static::getConfigurationHandler();
  foreach ($list as $component) {
    if (in_array($component, $excluded)) {
      continue;
    }
    $part = explode('.', $component, 2);
    if (empty($handlers[$part[0]])) {
      $settings
        ->addInfo('no_handler', $part[0]);
    }
    else {
      $config = static::createConfigurationInstance($component);

      // Make sure the object is built before start to iterate on its
      // dependencies.
      $config
        ->setContext($settings);
      $config
        ->loadFromStorage();
      $config
        ->iterate($settings);
    }
  }
  drupal_flush_all_caches();
  if ($start_tracking) {
    static::exportToDataStore($list, $import_dependencies, $import_optionals, TRUE);
  }
  module_invoke_all('configuration_post_import', $settings);
  return $settings;
}