You are here

protected function ConfigInstaller::validateDependencies in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::validateDependencies()

Validates an array of config data that contains dependency information.

Parameters

string $config_name: The name of the configuration object that is being validated.

array $data: Configuration data.

array $enabled_extensions: A list of all the currently enabled modules and themes.

array $all_config: A list of all the active configuration names.

Return value

bool TRUE if all dependencies are present, FALSE otherwise.

1 call to ConfigInstaller::validateDependencies()
ConfigInstaller::installOptionalConfig in core/lib/Drupal/Core/Config/ConfigInstaller.php
Installs optional configuration.

File

core/lib/Drupal/Core/Config/ConfigInstaller.php, line 589

Class

ConfigInstaller

Namespace

Drupal\Core\Config

Code

protected function validateDependencies($config_name, array $data, array $enabled_extensions, array $all_config) {
  if (!isset($data['dependencies'])) {

    // Simple config or a config entity without dependencies.
    list($provider) = explode('.', $config_name, 2);
    return in_array($provider, $enabled_extensions, TRUE);
  }
  $missing = $this
    ->getMissingDependencies($config_name, $data, $enabled_extensions, $all_config);
  return empty($missing);
}