function ConfigInstaller::getProfileStorages
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::getProfileStorages()
- 10 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::getProfileStorages()
- 8.9.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::getProfileStorages()
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 690
Class
Namespace
Drupal\Core\ConfigCode
protected function getProfileStorages($installing_name = '') {
$profile = $this->drupalGetProfile();
$profile_storages = [];
if ($profile && $profile != $installing_name) {
$profile_path = $this->extensionPathResolver
->getPath('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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.