function hook_system_info_alter

Alter the information parsed from module and theme .info.yml files

This hook is invoked in _system_rebuild_module_data() and in _system_rebuild_theme_data(). A module may implement this hook in order to add to or alter the data generated by reading the .info.yml file with drupal_parse_info_file().

Parameters

$info: The .info.yml file contents, passed by reference so that it can be altered.

$file: Full information about the module or theme, including $file->name, and $file->filename

$type: Either 'module' or 'theme', depending on the type of .info.yml file that was passed.

Related topics

11 functions implement hook_system_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_system_info_alter in drupal/core/modules/field/field.module
Implements hook_system_info_alter().
locale_test_system_info_alter in drupal/core/modules/locale/tests/modules/locale_test/locale_test.module
Implements hook_system_info_alter().
locale_test_translate_system_info_alter in drupal/core/modules/locale/tests/modules/locale_test_translate/locale_test_translate.module
Implements hook_system_info_alter().
module_test_system_info_alter in drupal/core/modules/system/tests/modules/module_test/module_test.module
Implements hook_system_info_alter().
node_system_info_alter in drupal/core/modules/node/node.module
Implements hook_system_info_alter().

... See full list

2 invocations of hook_system_info_alter()
_system_rebuild_module_data in drupal/core/modules/system/system.module
Helper function to scan and collect module .info.yml data.
_system_rebuild_theme_data in drupal/core/modules/system/system.module
Helper function to scan and collect theme .info.yml data and their engines.

File

drupal/core/modules/system/system.api.php, line 1485
Hooks provided by Drupal core and the System module.

Code

function hook_system_info_alter(&$info, $file, $type) {

  // Only fill this in if the .info.yml file does not define a 'datestamp'.
  if (empty($info['datestamp'])) {
    $info['datestamp'] = filemtime($file->filename);
  }
}