What is the first function read by Drupal in a custom module? I've got a custom module working fine in Drupal 7.

In some pages, I have parameters in the URL that I'd like to get in order to perform certain actions.

For example, if a=logout or a=forgot_password or a=subscribe.

I'd like to know which function, in the mymodule.module file, is called first so I can check whether there's a special parameter and perform certain actions accordingly ?

Thanks in advance!
The first hook invoked is hook_boot(), if the Drupal variable page_cache_invoke_hooks is TRUE, otherwise is hook_language_init() (followed by hook_init()).

I am assuming the module is not implementing alternative versions of bootstrap functions; in that case, the version of cache_get() implemented by the module is called first.

About hook_boot() keep in mind that:


hook_boot() is invoked too early, when Drupal has not completed its bootstrap. This means that the only loaded modules are the ones implementing hook_boot(). Even in this case, your module can use function implemented from modules implementing hook_boot(), and already loaded from Drupal, which uses the following code.

foreach (module_list(FALSE, TRUE) as $module) {
  drupal_load('module', $module);
  module_invoke($module, $hook);
}


If your module is aaaa.module, and it tries to call zzzz_create_object() (where zzzz.module implements hook_boot()) from aaaa_boot(),  aaaa_boot() will cause an error message about a not existing function. 
When hook_boot() is invoked, Drupal has not yet initialized its database, its Drupal variables (only when $conf['page_cache_without_database'] is TRUE), and its session.


As consequence, the functions hook_boot() can call are restricted. For sure, the functions the hook can call are the ones that are part of bootstrap.inc, and all the PHP functions (with some restrictions too).

References


drupal_bootstrap()
_drupal_bootstrap_page_cache()
drupal_language_initialize()
_drupal_bootstrap_full()