You are here

function drupal_install_profile_distribution_name in Drupal 8

Same name and namespace in other branches
  1. 7 includes/install.inc \drupal_install_profile_distribution_name()
  2. 9 core/includes/install.inc \drupal_install_profile_distribution_name()
  3. 10 core/includes/install.inc \drupal_install_profile_distribution_name()

Loads the installation profile, extracting its defined distribution name.

Return value

The distribution name defined in the profile's .info.yml file. Defaults to "Drupal" if none is explicitly provided by the installation profile.

See also

install_profile_info()

11 calls to drupal_install_profile_distribution_name()
ConfigOverride::loadOverrides in core/lib/Drupal/Core/Installer/ConfigOverride.php
Returns config overrides.
InstallCommand::install in core/lib/Drupal/Core/Command/InstallCommand.php
Installs Drupal with specified installation profile.
InstallerNonEnglishProfileWithoutLocaleModuleTest::testNonEnglishProfileWithoutLocaleModule in core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php
Tests installing a profile with non-English language and no locale module.
InstallerTest::testInstaller in core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
Ensures that the user page is available after installation.
install_check_requirements in core/includes/install.core.inc
Checks installation requirements and reports any errors.

... See full list

1 string reference to 'drupal_install_profile_distribution_name'
ConfigOverride::loadOverrides in core/lib/Drupal/Core/Installer/ConfigOverride.php
Returns config overrides.

File

core/includes/install.inc, line 103
API functions for installing modules and themes.

Code

function drupal_install_profile_distribution_name() {

  // During installation, the profile information is stored in the global
  // installation state (it might not be saved anywhere yet).
  $info = [];
  if (InstallerKernel::installationAttempted()) {
    global $install_state;
    if (isset($install_state['profile_info'])) {
      $info = $install_state['profile_info'];
    }
  }
  else {
    $profile = \Drupal::installProfile();
    $info = \Drupal::service('extension.list.profile')
      ->getExtensionInfo($profile);
  }
  return isset($info['distribution']['name']) ? $info['distribution']['name'] : 'Drupal';
}