function drupal_check_profile

Same name in other branches
  1. 9 core/includes/install.inc \drupal_check_profile()
  2. 8.9.x core/includes/install.inc \drupal_check_profile()
  3. 10 core/includes/install.inc \drupal_check_profile()
  4. 11.x core/includes/install.inc \drupal_check_profile()

Checks an installation profile's requirements.

Parameters

$profile: Name of installation profile to check.

Return value

Array of the installation profile's requirements.

1 call to drupal_check_profile()
install_check_requirements in includes/install.core.inc
Checks installation requirements and reports any errors.

File

includes/install.inc, line 1178

Code

function drupal_check_profile($profile) {
    include_once DRUPAL_ROOT . '/includes/file.inc';
    $profile_file = DRUPAL_ROOT . "/profiles/{$profile}/{$profile}.profile";
    if (!isset($profile) || !file_exists($profile_file)) {
        throw new Exception(install_no_profile_error());
    }
    $info = install_profile_info($profile);
    // Collect requirement testing results.
    $requirements = array();
    foreach ($info['dependencies'] as $module) {
        module_load_install($module);
        $function = $module . '_requirements';
        if (function_exists($function)) {
            $requirements = array_merge($requirements, $function('install'));
        }
    }
    return $requirements;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.