If the implementation of hook_install() of my module needs to use a class defined in the module file, should the code first load the module file with drupal_load()?
I would think that when the hook is invoked, the Drupal registry has not been yet updated to contain any reference to the PHP classes defined in the modules used by my module, and which are referred in the .info file. I looked at Drupal code, but I could not find any proof for what I think Drupal does.
Should I use drupal_load()
or the file will be loaded automatically when I try to create an instance of the PHP class defined in the module file? Is it different with hook_update_N()
?