function InstallerKernel::getInstallThemes

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Installer/InstallerKernel.php \Drupal\Core\Installer\InstallerKernel::getInstallThemes()

Gets the theme that renders installer pages, with its base themes.

Parameters

\Drupal\Core\Extension\Extension|false|null $profile: The profile being installed, or NULL if none has been selected yet, or FALSE if the installation uses no profile.

Return value

string[] The name of the install theme, followed by the names of its base themes.

2 calls to InstallerKernel::getInstallThemes()
InstallerKernel::getExtensions in core/lib/Drupal/Core/Installer/InstallerKernel.php
Get the core.extension config object.
InstallerKernel::updateThemes in core/lib/Drupal/Core/Installer/InstallerKernel.php
Updates the kernel's list of themes to the new list.

File

core/lib/Drupal/Core/Installer/InstallerKernel.php, line 192

Class

InstallerKernel
Extend DrupalKernel to handle force some kernel behaviors.

Namespace

Drupal\Core\Installer

Code

private function getInstallThemes(null|false|Extension $profile) : array {
  if (!$profile) {
    // Without a profile there is no distribution that could request another
    // theme.
    return [
      static::INSTALL_THEME,
    ];
  }
  $theme = $profile->info['distribution']['install']['theme'] ?? static::INSTALL_THEME;
  if ($theme === static::INSTALL_THEME) {
    // The default install theme declares "base theme: false", so scanning
    // the file system for base themes is not needed.
    return [
      $theme,
    ];
  }
  return array_merge([
    $theme,
  ], $this->getBaseThemes($profile, $theme));
}

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