W3cubDocs

/Drupal 8

function drupal_check_profile

drupal_check_profile($profile)

Checks an installation profile's requirements.

Parameters

string $profile: Name of installation profile to check.

Return value

array Array of the installation profile's requirements.

File

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

Code

function drupal_check_profile($profile) {
  $info = install_profile_info($profile);

  // Collect requirement testing results.
  $requirements = array();

  // Performs an ExtensionDiscovery scan as the system module is unavailable and
  // we don't yet know where all the modules are located.
  // @todo Remove as part of https://www.drupal.org/node/2186491
  $listing = new ExtensionDiscovery(\Drupal::root());
  $module_list = $listing->scan('module');
  foreach ($info['dependencies'] as $module) {
    $file = \Drupal::root() . '/' . $module_list[$module]->getPath() . "/$module.install";
    if (is_file($file)) {
      require_once $file;
    }
    $function = $module . '_requirements';

    drupal_classloader_register($module, $module_list[$module]->getPath());
    if (function_exists($function)) {
      $requirements = array_merge($requirements, $function('install'));
    }
  }
  return $requirements;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!install.inc/function/drupal_check_profile/8.1.x