W3cubDocs

/Drupal 8

protected function ConfigInstaller::getEnabledExtensions

protected 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.

File

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

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!ConfigInstaller.php/function/ConfigInstaller::getEnabledExtensions/8.1.x