ConfigInstaller::getProfileStorages

protected ConfigInstaller::getProfileStorages($installing_name = '')

Gets the profile storage to use to check for profile overrides.

The install profile can override module configuration during a module install. Both the install and optional directories are checked for matching configuration. This allows profiles to override default configuration for modules they do not depend on.

Parameters

string $installing_name: (optional) The name of the extension currently being installed.

Return value

\Drupal\Core\Config\StorageInterface[]|null Storages to access configuration from the installation profile. If we're installing the profile itself, then it will return an empty array as the profile storage should not be used.

File

core/lib/Drupal/Core/Config/ConfigInstaller.php, line 591

Class

ConfigInstaller

Namespace

Drupal\Core\Config

Code

protected function getProfileStorages($installing_name = '') {
  $profile = $this->drupalGetProfile();
  $profile_storages = [];
  if ($profile && $profile != $installing_name) {
    $profile_path = $this->drupalGetPath('module', $profile);
    foreach ([InstallStorage::CONFIG_INSTALL_DIRECTORY, InstallStorage::CONFIG_OPTIONAL_DIRECTORY] as $directory) {
      if (is_dir($profile_path . '/' . $directory)) {
        $profile_storages[] = new FileStorage($profile_path . '/' . $directory, StorageInterface::DEFAULT_COLLECTION);
      }
    }
  }
  return $profile_storages;
}
doc_Drupal
2016-10-29 08:53:54
Comments
Leave a Comment

Please login to continue.