Including a file on every page in a module I have a module that provides about two dozen pages (in a site with 1000s of pages). I have a file that contains a number of large functions. I want to include this file on every page used by my module. My options appear to be:


Call module_load_include in every page callback - seems a slight pain
Add the file option to every item in hook_menu (which would be fine as long as I don't want the page callbacks to go in a separate files from my .module file)
Wrap all the functions in a class, include the file using files[] in my .info file and then call the functions like myclass::myfunction() [which sorta seems a slight misuse of the class system as most functions are returning arrays of data unconnected to each other]
Load the file in hook_init, which means it would be loaded for every page in my site, not just the dozen specialist pages


It looks like 3 may be the best bet, but I'm just wondering if I'm missing something that allows me to include the file in one place just for my module pages without lots of duplicate calls to module_load_include and without using classes.
If the file needs to be included on every page, the correct way is to use PHP's include or require, I don't think the fact that this is in a Drupal site should really make any difference.

I've seen plenty of modules that literally put the following at the top of the module file:

require_once('module.inc');
require_once('test.inc');


If you really want to do it  a 'Drupal' way, you can use module_load_include() (which just wraps around require_once internally), directly at the top of the file instead of inside your page callback. This is what I tend to do normally.

module_load_include('inc', 'MYMODULE', 'MYMODULE.something');


Adding the file in hook_init() is perfectly fine too, I can't think of any justification to use one over the other, it would be down to personal preference.