In a Drupal 7 (and Drupal 6?) system, what "kicks off" the hook calling process, or where are "top level" hook calls located?
As I currently understand the Drupal module system, any module is capable of creating a hook for another module to implement. That means much of Drupal's execution is modules implementing hooks for other modules, which in turn provide hooks for other modules to implement.
What I'm not clear on is if there's a initial, top level hook that gets called in the bootstrap to kick this process off, or if there's several non-module calls that kick-off the hook invoking process, or something else (apologies is this is vague and newbish, but like I said I don't understand)
I looked in the _drupal_bootstrap_full
function, and at the end there was a promising
module_invoke_all('init');
However, my search of the modules/
folder only turned up one "init" hook function, which didn't appear to be a kick off point
system/system.api.php
1737:function hook_init() {
function hook_init() {
drupal_add_css(drupal_get_path('module', 'book') . '/book.css');
}
So, that says to me something outside the module systems kicks this whole things off. Does this happen in a single place, or multiple places. And where are these places?
I'm not currently a heavy Drupal user. My end goal of all this is understanding Drupal's module system in isolation, so that I can then investigate and understand how Drupal uses it's modules the build the application most people think of as Drupal. Any/all explanations are welcome, but I'm trying to understand things from an architectural point of view. I understand you don't need this knowledge to use Drupal, but my brain is broken and won't let me move forward until I know what the base PHP code is doing.