1.20.x common.inc backdrop_get_profile()

Gets the name of the currently active installation profile.

When this function is called during Backdrop'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 standard Backdrop system.core config file contains the name of the current profile.

Return value

$profile: The name of the installation profile.

File

includes/common.inc, line 182
Common functions that many Backdrop modules will need to reference.

Code

function backdrop_get_profile() {
  global $install_state;

  if (isset($install_state['parameters']['profile'])) {
    $profile = $install_state['parameters']['profile'];
  }
  else {
    try {
      $profile = config_get('system.core', 'install_profile');
    }
    catch (ConfigException $e) {
    }
  }
  if (empty($profile)) {
    $profile = 'standard';
  }

  return $profile;
}