protected ConfigInstaller::findPreExistingConfiguration(StorageInterface $storage)
Finds pre-existing configuration objects for the provided extension.
Extensions can not be installed if configuration objects exist in the active storage with the same names. This can happen in a number of ways, commonly:
array Array of configuration object names that already exist keyed by collection.
protected function findPreExistingConfiguration(StorageInterface $storage) {
$existing_configuration = array();
// Gather information about all the supported collections.
$collection_info = $this->configManager->getConfigCollectionInfo();
foreach ($collection_info->getCollectionNames() as $collection) {
$config_to_create = array_keys($this->getConfigToCreate($storage, $collection));
$active_storage = $this->getActiveStorages($collection);
foreach ($config_to_create as $config_name) {
if ($active_storage->exists($config_name)) {
$existing_configuration[$collection][] = $config_name;
}
}
}
return $existing_configuration;
}
© 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::findPreExistingConfiguration/8.1.x