function drush_core_requirements

8.0.x core.drush.inc drush_core_requirements()
6.x core.drush.inc drush_core_requirements()
7.x core.drush.inc drush_core_requirements()
5.x core.drush.inc drush_core_requirements()
master core.drush.inc drush_core_requirements()

Command callback. Provides information from the 'Status Reports' admin page.

File

commands/core/core.drush.inc, line 787
Core drush commands.

Code

function drush_core_requirements() {
  include_once DRUSH_DRUPAL_CORE . '/includes/install.inc';
  $severities = array(
    REQUIREMENT_INFO => t('Info'),
    REQUIREMENT_OK => t('OK'),
    REQUIREMENT_WARNING => t('Warning'),
    REQUIREMENT_ERROR => t('Error'),
  );

  drupal_load_updates();

  drush_include_engine('drupal', 'environment');
  $requirements = drush_module_invoke_all('requirements', 'runtime');
  // If a module uses "$requirements[] = " instead of
  // "$requirements['label'] = ", then build a label from
  // the title.
  foreach ($requirements as $key => $info) {
    if (is_numeric($key)) {
      unset($requirements[$key]);
      $new_key = strtolower(str_replace(' ', '_', $info['title']));
      $requirements[$new_key] = $info;
    }
  }
  $ignore_requirements = drush_get_option_list('ignore');
  foreach ($ignore_requirements as $ignore) {
    unset($requirements[$ignore]);
  }
  ksort($requirements);

  $min_severity = drush_get_option('severity', -1);
  foreach ($requirements as $key => $info) {
    $severity = array_key_exists('severity', $info) ? $info['severity'] : -1;
    $requirements[$key]['sid'] = $severity;
    $requirements[$key]['severity'] = $severities[$severity];
    if ($severity < $min_severity) {
      unset($requirements[$key]);
    }
  }
  return $requirements;
}