Are there any hooks that get called before modules are loaded?
I don't recommend using hook_init() as it doesn't run on cached pages. Try using hook_boot(). As per the documentation it runs at the beginning of the page request when Drupal is still in the bootstrap. Hope this helps!