Same name and namespace in other branches
- 7.x includes/install.inc \drupal_install_profile_distribution_name()
- 8.9.x core/includes/install.inc \drupal_install_profile_distribution_name()
- 9 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
5 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.
- ModulesListForm::buildForm in core/
modules/ system/ src/ Form/ ModulesListForm.php - Form constructor.
- Tasks::getFormOptions in core/
modules/ sqlite/ src/ Driver/ Database/ sqlite/ Install/ Tasks.php - Returns driver specific configuration options.
- template_preprocess_install_page in core/
includes/ theme.inc - Prepares variables for install page templates.
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 101 - 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'];
}
}
elseif ($profile = \Drupal::installProfile()) {
$info = \Drupal::service('extension.list.profile')
->getExtensionInfo($profile);
}
return $info['distribution']['name'] ?? 'Drupal';
}