function ConfigInstaller::installCollectionDefaultConfig

Same name in this branch
  1. 10 core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php \Drupal\Core\ProxyClass\Config\ConfigInstaller::installCollectionDefaultConfig()
Same name in other branches
  1. 9 core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php \Drupal\Core\ProxyClass\Config\ConfigInstaller::installCollectionDefaultConfig()
  2. 9 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::installCollectionDefaultConfig()
  3. 8.9.x core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php \Drupal\Core\ProxyClass\Config\ConfigInstaller::installCollectionDefaultConfig()
  4. 8.9.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::installCollectionDefaultConfig()
  5. 11.x core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php \Drupal\Core\ProxyClass\Config\ConfigInstaller::installCollectionDefaultConfig()
  6. 11.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::installCollectionDefaultConfig()

File

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

Class

ConfigInstaller

Namespace

Drupal\Core\Config

Code

public function installCollectionDefaultConfig($collection) {
    $storage = new ExtensionInstallStorage($this->getActiveStorages(StorageInterface::DEFAULT_COLLECTION), InstallStorage::CONFIG_INSTALL_DIRECTORY, $collection, InstallerKernel::installationAttempted(), $this->installProfile);
    // Only install configuration for enabled extensions.
    $enabled_extensions = $this->getEnabledExtensions();
    $config_to_install = array_filter($storage->listAll(), function ($config_name) use ($enabled_extensions) {
        $provider = mb_substr($config_name, 0, strpos($config_name, '.'));
        return in_array($provider, $enabled_extensions);
    });
    if (!empty($config_to_install)) {
        $this->createConfiguration($collection, $storage->readMultiple($config_to_install));
        // Reset all the static caches and list caches.
        $this->configFactory
            ->reset();
    }
}

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