Closed (fixed)
Project:
Hook watch
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2020 at 19:47 UTC
Updated:
30 Oct 2020 at 03:49 UTC
Jump to comment: Most recent
This module is an interesting idea!
I see that it only watches .module files though:
$finder->files()
->name('*.module')
->in(DRUPAL_ROOT . '/modules/');
However hook implementations can live in several other files:
.theme files.profile files.install files.tokens.inc files.views.inc files.views_execution.inc filesHowever any contrib module can also define hook groups too.
Comments
Comment #2
prudloff commentedThanks for the suggestion!
I didn't want to watch too many files because it could ruin performances but these should be OK.
Comment #4
prudloff commentedComment #5
andrewmacpherson commentedWould you consider adding the .inc files from the core hook groups too? These are widely used by various popular contrib modules: pathauto, redirect, diff, entity_reference_revisions, address. They are also used widely in Drupal core itself.
The
*.views_execution.incfile is one I've frequently seen used in custom modules, to provide project-specific tweaks. (Far less so for the*.tokens.incand*.views.inc.)Comment #6
prudloff commentedI added every registered hook group.
This loop gets every hook group then adds the corresponding
.incfile to the watcher.Comment #7
andrewmacpherson commentedGreat! That approach looks robust.