drupal_install_profile

Versions
5
drupal_install_profile($profile, $module_list)

Install a profile (i.e. a set of modules) from scratch. The profile must be verified first using drupal_verify_profile().

Parameters

profile The name of the profile to install.

module_list An array of modules to install.

▾ 1 function calls drupal_install_profile()

install_main in ./install.php
The Drupal installation happens in a series of steps. We begin by verifying that the current environment meets our minimum requirements. We then go on to verify that settings.php is properly configured. From there we connect to the configured database...

Code

includes/install.inc, line 304

<?php
function drupal_install_profile($profile, $module_list) {
  // The system module is a special case; we can't bootstrap until it's
  // installed, so we can't use the normal installation function.
  $module_list = array_diff($module_list, array('system'));

  $system_path = dirname(drupal_get_filename('module', 'system', NULL));
  require_once './' . $system_path . '/system.install';
  module_invoke('system', 'install');
  $system_versions = drupal_get_schema_versions('system');
  $system_version = $system_versions ? max($system_versions) : SCHEMA_INSTALLED;
  db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', 'module', '', 1, 0, 0, %d)", $system_path . '/system.module', 'system', $system_version);

  // Now that we've installed things properly, bootstrap the full Drupal environment
  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

  // Install schemas for profile and all its modules.
  module_rebuild_cache();
  drupal_install_modules($module_list);

  // And now, run the profile's install function.
  $function = $profile .'_install';
  if (function_exists($function)) {
    $function();
  }
}
?>
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.