You are here

function drupal_verify_profile in Drupal 5

Same name and namespace in other branches
  1. 8 core/includes/install.inc \drupal_verify_profile()
  2. 6 includes/install.inc \drupal_verify_profile()
  3. 7 includes/install.inc \drupal_verify_profile()
  4. 9 core/includes/install.inc \drupal_verify_profile()
  5. 10 core/includes/install.inc \drupal_verify_profile()

Verify a profile for installation.

Parameters

profile: Name of profile to verify.

locale: Name of locale used (if any).

Return value

The list of modules to install.

1 call to drupal_verify_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…

File

includes/install.inc, line 261

Code

function drupal_verify_profile($profile, $locale) {
  include_once './includes/file.inc';
  include_once './includes/common.inc';
  $profile_file = "./profiles/{$profile}/{$profile}.profile";
  if (!isset($profile) || !file_exists($profile_file)) {
    install_no_profile_error();
  }
  require_once $profile_file;

  // Get a list of modules required by this profile.
  $function = $profile . '_profile_modules';
  $module_list = array_merge(array(
    'system',
  ), $function(), $locale ? array(
    'locale',
  ) : array());

  // Get a list of modules that exist in Drupal's assorted subdirectories.
  $present_modules = array();
  foreach (drupal_system_listing('\\.module$', 'modules', 'name', 0) as $present_module) {
    $present_modules[] = $present_module->name;
  }

  // Verify that all of the profile's required modules are present.
  $missing_modules = array_diff($module_list, $present_modules);
  if (count($missing_modules)) {
    foreach ($missing_modules as $module) {
      drupal_set_message(st('The %module module is required but was not found. Please move it into the <em>modules</em> subdirectory.', array(
        '%module' => $module,
      )), 'error');
    }
  }
  else {
    return $module_list;
  }
}