hook_uninstall()
This hook will remove any tables or variables that the module has set. The uninstall hook will fire when the module gets uninstalled. Parameters None Return value None Usage sample function videopage_uninstall() { drupal_uninstall_schema(‘videoshows’); variable_del(‘video_types’); }
@ sign in front of variable
Sometimes in your programming you’ll need to use @ sign in front of a variable. For example, @$_REQUEST[“username”]; The @ sign is an error control operator. When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored. For example: $value = @$cache[$key]; // will not issue a notice if the index $key doesn’t exist.
hook_update_last_removed()
Return a number which is no longer available as hook_update_N(). If you remove some update functions from your mycustommodule.install file, you should notify Drupal of those missing functions. This way, Drupal can ensure that no update is accidentally skipped. Parameters none Return value An integer, corresponding to hook_update_N() which has been removed from mycustommodule.install. Usage sample function hook_update_last_removed() { // We’ve removed the 6.x-1.x version of mycustommodule, including database updates. // The next update function is mycustommodule_update_6200() return 6105; }
hook_enable()
This hook is optional. Perform necessary actions after module is enabled. The hook is called everytime module is enabled. Parameters none Return value none Usage sample function hook_enable() { mycustommodule_cache_rebuild(); }
hook_disable()
This hook is optional. Perform necessary actions before module is disabled. The hook is called everytime module is disabled. Parameters none Return value none Usage sample function hook_disable() { mycustommodule_cache_rebuild(); }