// new configuration that can be installed.
if ($profile_storage) { $config_to_create =
$profile_storage->
readMultiple($list) +
$config_to_create;
} // Sort $config_to_create in the order of the least dependent first.
$dependency_manager =
new ConfigDependencyManager();
$dependency_manager->
setData($config_to_create);
$config_to_create =
array_merge(array_flip($dependency_manager->
sortAll()),
$config_to_create);
if (!
empty($dependency)) { // In order to work out dependencies we need the full config graph.
$dependency_manager->
setData($this->
getActiveStorages()->
readMultiple($existing_config) +
$config_to_create);
$dependencies =
$dependency_manager->
getDependentEntities(key($dependency),
reset($dependency));
} foreach ($config_to_create as $config_name =>
$data) { // Remove configuration where its dependencies cannot be met.
$remove = !
$this->
validateDependencies($config_name,
$data,
$enabled_extensions,
$all_config);
// Remove configuration that is not dependent on $dependency, if it is
// defined.
if (!
$remove && !
empty($dependency)) { $remove = !
isset($dependencies[$config_name]);
}