drupal_check_profile

Versions
5 – 7
drupal_check_profile($profile)

Check an install profile's requirements.

Parameters

$profile Name of install profile to check.

Return value

Array of the install profile's requirements.

Code

includes/install.inc, line 984

<?php
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);

  // Get a list of all .install files.
  $installs = drupal_get_install_files($info['dependencies']);

  // Collect requirement testing results
  $requirements = array();
  foreach ($installs as $install) {
    require_once DRUPAL_ROOT . '/' . $install->uri;
    $function = $install->name . '_requirements';
    if (function_exists($function)) {
      $requirements = array_merge($requirements, $function('install'));
    }
  }
  return $requirements;
}
?>
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.