Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Extension/module.api.php \hook_system_info_alter()
  2. 7.x modules/system/system.api.php \hook_system_info_alter()
  3. 8.9.x core/lib/Drupal/Core/Extension/module.api.php \hook_system_info_alter()
  4. 9 core/lib/Drupal/Core/Extension/module.api.php \hook_system_info_alter()

Alter the information parsed from module and theme .info files

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

Parameters

&$info: The .info 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

Related topics

2 invocations of hook_system_info_alter()
module_rebuild_cache in includes/module.inc
Rebuild the database cache of module files.
_system_theme_data in modules/system/system.module
Helper function to scan and collect theme .info data and their engines.

File

developer/hooks/core.php, line 1372
These are the hooks that are invoked by the Drupal core.

Code

function hook_system_info_alter(&$info, $file) {

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