1 install.inc backdrop_check_profile($profile)

Checks an installation profile's requirements.

Parameters

$profile: Name of installation profile to check.

Return value

Array of the installation profile's requirements.

Throws

Exception

File

core/includes/install.inc, line 1325
API functions for installing modules and themes.

Code

function backdrop_check_profile($profile) {
  include_once BACKDROP_ROOT . '/core/includes/file.inc';

  $profile_file = _install_find_profile_file($profile);

  if (!isset($profile) || !$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;
}