What hook should I use to define a class? If I want to define a class, like the one below, for a custom module, and make it available to all the functions in my module, which hook should I use?

class foo {
  public $bar;
  function display_bar() {
    return $this-&gt;bar; 
  }
}
You wouldn't use a hook to define a class, that doesn't really make sense.

If you're talking about autoloading, you have two options:


In-built - you can add a file called, for example, foo.class.inc, in your module's root, and add the following to your module's .info file

files[] = foo.class.inc


Once you've cleared the caches, any time you request a new foo(), the appropriate file will automatically be included.

See Writing module .info files for more information.
XAutoload - PSR-0 &amp; PSR-4 style autoloading. If you're into OO this is a much better option in my opinion.