In Installer::includeExtensions():
require "$IP/includes/DefaultSettings.php"; foreach ( $exts as $e ) { require_once "$IP/extensions/$e/$e.php"; } $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ? $wgHooks['LoadExtensionSchemaUpdates'] : array(); // Unset everyone else's hooks. Lord knows what someone might be doing // in ParserFirstCallInit (see bug 27171) $GLOBALS['wgHooks'] = array( 'LoadExtensionSchemaUpdates' => $hooksWeWant );
We can avoid most of the evilness of this code by reading extension.json files.