drupal_verify_profile

Versions
5 – 6
drupal_verify_profile($profile, $locale)
7
drupal_verify_profile($install_state)

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 function calls 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...

Code

includes/install.inc, line 261

<?php
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;
  }
}
?>
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.