You are here

protected function ConfigDevelCommands::importConfig in Configuration development 8

Imports a list of configuration entities.

Parameters

array $config_list: An array of configuration entities.

string $type: The type of extension we're importing, one of 'module'. 'profile' or 'theme'.

string $extension: The module, theme or install profile we're importing.

string $directory: The subdirectory within the extension that we're importing from. One of \Drupal\Core\Config\InstallStorage\InstallStorage::CONFIG_INSTALL_DIRECTORY or \Drupal\Core\Config\InstallStorage\InstallStorage::CONFIG_OPTIONAL_DIRECTORY.

1 call to ConfigDevelCommands::importConfig()
ConfigDevelCommands::import in src/Commands/ConfigDevelCommands.php
Import configuration from module's config directory to active storage.

File

src/Commands/ConfigDevelCommands.php, line 374

Class

ConfigDevelCommands
Drush integration for the Configuration Development module.

Namespace

Drupal\config_devel\Commands

Code

protected function importConfig($config_list, $type, $extension, $directory) {
  $config_path = drupal_get_path($type, $extension) . "/{$directory}";
  foreach ($config_list as $name) {
    $file_name = $config_path . '/' . $name . '.yml';
    $this
      ->importSingle($file_name);
  }
}