drupal_install_profile_distribution_version

drupal_install_profile_distribution_version()

Loads the installation profile, extracting its defined version.

Return value

string Distribution version defined in the profile's .info.yml file. Defaults to \Drupal::VERSION if no version is explicitly provided by the installation profile.

See also

install_profile_info()

File

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

Code

function drupal_install_profile_distribution_version() {
  // During installation, the profile information is stored in the global
  // installation state (it might not be saved anywhere yet).
  if (drupal_installation_attempted()) {
    global $install_state;
    return isset($install_state['profile_info']['version']) ? $install_state['profile_info']['version'] : \Drupal::VERSION;
  }
  // At all other times, we load the profile via standard methods.
  else {
    $profile = drupal_get_profile();
    $info = system_get_info('module', $profile);
    return $info['version'];
  }
}
doc_Drupal
2016-10-29 09:03:16
Comments
Leave a Comment

Please login to continue.