drupal_get_profile

Versions
7
drupal_get_profile()

Get the name of the currently active install 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 standard Drupal systems variable table contains the name of the current profile, and we can call variable_get() to determine what one is active.

Return value

$profile The name of the install profile.

▾ 8 functions call drupal_get_profile()

drupal_required_modules in includes/module.inc
Array of modules required by core.
drupal_system_listing in includes/common.inc
Return an array of system file objects.
drupal_verify_profile in includes/install.inc
Verify an install profile for installation.
install_finished in ./install.php
Installation task; perform final steps and display a 'finished' page.
install_system_module in ./install.php
Installation task; install the Drupal system module.
system_requirements in modules/system/system.install
Test and report Drupal installation requirements.
update_fix_d7_install_profile in includes/update.inc
Register the currently installed profile in the system table.
_system_rebuild_module_data in modules/system/system.module
Helper function to scan and collect module .info data.

Code

includes/common.inc, line 223

<?php
function drupal_get_profile() {
  global $install_state;

  if (isset($install_state['parameters']['profile'])) {
    $profile = $install_state['parameters']['profile'];
  }
  else {
    $profile = variable_get('install_profile', 'default');
  }

  return $profile;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.