function drupal_install_profile_distribution_name

Same name in other branches
  1. 7.x includes/install.inc \drupal_install_profile_distribution_name()
  2. 9 core/includes/install.inc \drupal_install_profile_distribution_name()
  3. 8.9.x core/includes/install.inc \drupal_install_profile_distribution_name()
  4. 11.x core/includes/install.inc \drupal_install_profile_distribution_name()

Loads the installation profile, extracting its defined distribution name.

Return value

string 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()

8 calls to drupal_install_profile_distribution_name()
ConfigOverride::loadOverrides in core/lib/Drupal/Core/Installer/ConfigOverride.php
InstallCommand::install in core/lib/Drupal/Core/Command/InstallCommand.php
Installs Drupal with specified installation profile.
install_check_requirements in core/includes/install.core.inc
Checks installation requirements and reports any errors.
install_database_errors in core/includes/install.core.inc
Checks a database connection and returns any errors.
install_finished in core/includes/install.core.inc
Performs final installation steps and displays a 'finished' page.

... See full list

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

File

core/includes/install.inc, line 101

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'];
        }
    }
    elseif ($profile = \Drupal::installProfile()) {
        $info = \Drupal::service('extension.list.profile')->getExtensionInfo($profile);
    }
    return $info['distribution']['name'] ?? 'Drupal';
}

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