function ConfigInstaller::getEnabledExtensions

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::getEnabledExtensions()
  2. 10 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::getEnabledExtensions()
  3. 11.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::getEnabledExtensions()

Gets the list of enabled extensions including both modules and themes.

Return value

array A list of enabled extensions which includes both modules and themes.

4 calls to ConfigInstaller::getEnabledExtensions()
ConfigInstaller::checkConfigurationToInstall in core/lib/Drupal/Core/Config/ConfigInstaller.php
Checks the configuration that will be installed for an extension.
ConfigInstaller::installCollectionDefaultConfig in core/lib/Drupal/Core/Config/ConfigInstaller.php
Installs all default configuration in the specified collection.
ConfigInstaller::installDefaultConfig in core/lib/Drupal/Core/Config/ConfigInstaller.php
Installs the default configuration of a given extension.
ConfigInstaller::installOptionalConfig in core/lib/Drupal/Core/Config/ConfigInstaller.php
Installs optional configuration.

File

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

Class

ConfigInstaller

Namespace

Drupal\Core\Config

Code

protected function getEnabledExtensions() {
    // Read enabled extensions directly from configuration to avoid circular
    // dependencies on ModuleHandler and ThemeHandler.
    $extension_config = $this->configFactory
        ->get('core.extension');
    $enabled_extensions = (array) $extension_config->get('module');
    $enabled_extensions += (array) $extension_config->get('theme');
    // Core can provide configuration.
    $enabled_extensions['core'] = 'core';
    return array_keys($enabled_extensions);
}

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