W3cubDocs

/Drupal 8

function drupal_install_profile_distribution_name

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

File

core/includes/install.inc, line 96
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 = array();
  if (drupal_installation_attempted()) {
    global $install_state;
    if (isset($install_state['profile_info'])) {
      $info = $install_state['profile_info'];
    }
  }
  // At all other times, we load the profile via standard methods.
  else {
    $profile = drupal_get_profile();
    $info = system_get_info('module', $profile);
  }
  return isset($info['distribution']['name']) ? $info['distribution']['name'] : 'Drupal';
}

© 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!includes!install.inc/function/drupal_install_profile_distribution_name/8.1.x