W3cubDocs

/Drupal 8

protected function 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 587

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!ConfigInstaller.php/function/ConfigInstaller::getProfileStorages/8.1.x