function SystemManager::listRequirements

Same name in other branches
  1. 9 core/modules/system/src/SystemManager.php \Drupal\system\SystemManager::listRequirements()
  2. 8.9.x core/modules/system/src/SystemManager.php \Drupal\system\SystemManager::listRequirements()
  3. 11.x core/modules/system/src/SystemManager.php \Drupal\system\SystemManager::listRequirements()

Displays the site status report. Can also be used as a pure check.

Return value

array An array of system requirements.

1 call to SystemManager::listRequirements()
SystemManager::checkRequirements in core/modules/system/src/SystemManager.php
Checks for requirement severity.

File

core/modules/system/src/SystemManager.php, line 103

Class

SystemManager
System Manager Service.

Namespace

Drupal\system

Code

public function listRequirements() {
    // Load .install files
    include_once DRUPAL_ROOT . '/core/includes/install.inc';
    drupal_load_updates();
    // Check run-time requirements and status information.
    $requirements = $this->moduleHandler
        ->invokeAll('requirements', [
        'runtime',
    ]);
    $this->moduleHandler
        ->alter('requirements', $requirements);
    uasort($requirements, function ($a, $b) {
        if (!isset($a['weight'])) {
            if (!isset($b['weight'])) {
                return strcasecmp($a['title'], $b['title']);
            }
            return -$b['weight'];
        }
        return isset($b['weight']) ? $a['weight'] - $b['weight'] : $a['weight'];
    });
    return $requirements;
}

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