public function ConfigInstaller::checkConfigurationToInstall in Drupal 10
Same name in this branch
- 10 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::checkConfigurationToInstall()
- 10 core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php \Drupal\Core\ProxyClass\Config\ConfigInstaller::checkConfigurationToInstall()
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::checkConfigurationToInstall()
- 9 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::checkConfigurationToInstall()
File
- core/lib/Drupal/Core/Config/ConfigInstaller.php, line 504
Class
- ConfigInstaller
Namespace
Drupal\Core\Config
Code
public function checkConfigurationToInstall($type, $name) {
if ($this
->isSyncing()) {
return;
}
$config_install_path = $this
->getDefaultConfigDirectory($type, $name);
if (!is_dir($config_install_path)) {
return;
}
$storage = new FileStorage($config_install_path, StorageInterface::DEFAULT_COLLECTION);
$enabled_extensions = $this
->getEnabledExtensions();
$enabled_extensions[] = $name;
$profile_storages = $this
->getProfileStorages($name);
[
$invalid_default_config,
$missing_dependencies,
] = $this
->findDefaultConfigWithUnmetDependencies($storage, $enabled_extensions, $profile_storages);
if (!empty($invalid_default_config)) {
throw UnmetDependenciesException::create($name, array_unique($missing_dependencies, SORT_REGULAR));
}
if ($name != $this
->drupalGetProfile()) {
$existing_configuration = $this
->findPreExistingConfiguration($storage);
if (!empty($existing_configuration)) {
throw PreExistingConfigException::create($name, $existing_configuration);
}
}
}