Thread:Project talk:Support desk/Hooks Definitions are confusing to me/reply

No, you shouldn't create a global function for each hook. The "right way" (anno 2012) would be to have a  file in your extension folder, in which you create a class with public static methods. Then in your main extension php file: $wgAutoloadClasses['VectorHooks'] = dirname( __FILE__ ). '/Vector.hooks.php';

$wgHooks['GetPreferences'][] = 'VectorHooks::getPreferences'; $wgHooks['BeforePageDisplay'][] = 'VectorHooks::beforePageDisplay';

Look at the files in mediawiki/extensions/Vector.git as example.