function ConfigInstaller::validateDependencies

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::validateDependencies()
  2. 10 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::validateDependencies()
  3. 11.x 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 572

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.