You are here

function patchinfo_system_info_alter in PatchInfo 8

Same name and namespace in other branches
  1. 8.2 patchinfo.module \patchinfo_system_info_alter()
  2. 7 patchinfo.module \patchinfo_system_info_alter()

Implements hook_system_info_alter().

File

./patchinfo.module, line 18
Patch Info primary module file.

Code

function patchinfo_system_info_alter(array &$info, Extension $file, $type) {

  // Get patch information from .info.yml files and save it to the database.
  if (in_array($type, [
    'module',
    'theme',
  ])) {
    _patchinfo_clear_db($file
      ->getName());
    if (isset($info['patches']) && is_array($info['patches']) && count($info['patches']) > 0) {
      _patchinfo_process_module($file
        ->getName(), $info['patches']);
    }
  }
}