1 update_test.module update_test_system_info_alter(&$info, $file)

Implements hook_system_info_alter().

Checks the 'update_test_system_info' state value and sees if we need to alter the system info for the given $file based on the setting. The setting is expected to be a nested associative array. If the key '#all' is defined, its subarray will include .info keys and values for all modules and themes on the system. Otherwise, the settings array is keyed by the module or theme short name ($file->name) and the subarrays contain settings just for that module, theme, or layout.


core/modules/update/tests/update_test/update_test.module, line 50
Module for testing Update Manager functionality.


function update_test_system_info_alter(&$info, $file) {
  $setting = state_get('update_test_system_info', array());
  foreach (array('#all', $file->name) as $id) {
    if (!empty($setting[$id])) {
      foreach ($setting[$id] as $key => $value) {
        $info[$key] = $value;