Home ›
Drupal's Enable hook can be tucked away in the .install fileDrupal's Enable hook can be tucked away in the .install file
Submitted by Benjamin Melançon on July 13, 2009 - 3:46pm
A cool thing about hook_enable is that Drupal can find it in your .install file, even when the module has already been installed and you are just enabling it.
(As evidenced by implementation of hook_enable in comment.install and all over contrib dot install files.)
So you can keep it out of your main .module file and throw it in your .install file.
Drupal's hook_enable can be in .install.
More like this
- Set a module weight using its .install file
- Drupal's Installation Profile repository should allow include files
- hook_module_implements_alter called before schema is installed
- Why isn't Drupal's one run-time menu item altering hook getting run?
- Modules to exclude selected content types from Drupal's search

