You are here

protected function SensorCoreRequirements::getRequirements in Monitoring 7

Executes the requirements hook of a module and returns the results.

Parameters

string $module: Name of the module to return requirements for.

Return value

array Array of requirements

Throws

\RuntimeException Thrown when the given module does not provide a requirements hook.

1 call to SensorCoreRequirements::getRequirements()
SensorCoreRequirements::runSensor in lib/Drupal/monitoring/Sensor/Sensors/SensorCoreRequirements.php
Runs the sensor, updating $sensor_result.

File

lib/Drupal/monitoring/Sensor/Sensors/SensorCoreRequirements.php, line 77
Contains \Drupal\monitoring\Sensor\Sensors\SensorCoreRequirements.

Class

SensorCoreRequirements
Monitors a specific module hook_requirements.

Namespace

Drupal\monitoring\Sensor\Sensors

Code

protected function getRequirements($module) {
  module_load_include('install', $module);
  $function = $module . '_requirements';
  if (!function_exists($function)) {
    throw new \RuntimeException(format_string('Requirement function @function not found', array(
      '@function' => $function,
    )));
  }
  return (array) $function('runtime');
}