diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index aaafdbc..2f175d2 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -843,6 +843,9 @@ function drupal_installation_attempted() { * 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. + * + * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * Use Settings::getInstallProfile instead. */ function drupal_get_profile() { global $install_state; diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 331af95..7328702 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1207,7 +1207,7 @@ function _install_select_profile(&$install_state) { } // Check for a Distribution. if ($distribution = drupal_get_distribution()) { - return $distribution->getName(); + return $distribution; } // Get all visible (not hidden) profiles. diff --git a/core/lib/Drupal/Core/Site/Settings.php b/core/lib/Drupal/Core/Site/Settings.php index df2a975..d097915 100644 --- a/core/lib/Drupal/Core/Site/Settings.php +++ b/core/lib/Drupal/Core/Site/Settings.php @@ -150,16 +150,17 @@ public static function getHashSalt() { } /** - * Get the configured install profile, or fall back to the first Distribution - * that was declared. If neither is available, return NULL. + * Get the active install profile. * * @return string|null - * The name of the active install profile or distribution. + * The name of the any active install profile or distribution. */ public static function getInstallProfile() { $install_profile = self::$instance->get('install_profile'); if (empty($install_profile)) { $install_profile = drupal_get_distribution(); + // Stash install_profile as a Setting. + new Settings(self::$instance->getAll() + array('install_profile' => $install_profile)); } return $install_profile;