You are here

function drupal_get_profile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/bootstrap.inc \drupal_get_profile()

Gets the name of the currently active installation profile.

When this function is called during Drupal's initial installation process, the name of the profile that's about to be installed is stored in the global installation state. At all other times, the "install_profile" setting will be available in settings.php.

Return value

string|null $profile The name of the installation profile or NULL if no installation profile is currently active. This is the case for example during the first steps of the installer or during unit tests.

17 calls to drupal_get_profile()
drupal_install_profile_distribution_name in core/includes/install.inc
Loads the installation profile, extracting its defined distribution name.
drupal_install_profile_distribution_version in core/includes/install.inc
Loads the installation profile, extracting its defined version.
drupal_required_modules in core/includes/module.inc
Returns an array of modules required by core.
ExtensionDiscovery::setProfileDirectoriesFromSettings in core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
Sets installation profile directories based on current site settings.
ExtensionInstallStorage::getAllFolders in core/lib/Drupal/Core/Config/ExtensionInstallStorage.php
Returns a map of all config object names and their folders.

... See full list

File

core/includes/bootstrap.inc, line 722
Functions that need to be loaded on every Drupal request.

Code

function drupal_get_profile() {
  global $install_state;
  if (drupal_installation_attempted()) {

    // If the profile has been selected return it.
    if (isset($install_state['parameters']['profile'])) {
      $profile = $install_state['parameters']['profile'];
    }
    else {
      $profile = NULL;
    }
  }
  else {

    // Fall back to NULL, if there is no 'install_profile' setting.
    $profile = Settings::get('install_profile');
  }
  return $profile;
}