The web installer loads extensions during
Installer::includeExtensions(), but then
DatabaseUpdater::loadExtensions() reloads them again. Use a constant
(MW_EXTENSIONS_LOADED) to indicate that we shouldn't load them again.
Also fix a minor issue in loadExtensions() that would accidentally
register a bogus yet harmless hook called 'wgHooks'.
Change-Id: Id72fc0ceea15ccea52b1709bef51918ce64f8b40
* LoadExtensionSchemaUpdates hook.
*/
private function loadExtensions() {
- if ( !defined( 'MEDIAWIKI_INSTALL' ) ) {
+ if ( !defined( 'MEDIAWIKI_INSTALL' ) || defined( 'MW_EXTENSIONS_LOADED' ) ) {
return; // already loaded
}
$vars = Installer::getExistingLocalSettings();
// This will automatically add "AutoloadClasses" to $wgAutoloadClasses
$data = $registry->readFromQueue( $queue );
- $hooks = [ 'wgHooks' => [ 'LoadExtensionSchemaUpdates' => [] ] ];
+ $hooks = [];
if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
$hooks = $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'];
}
$exts = $this->getVar( '_Extensions' );
$IP = $this->getVar( 'IP' );
+ // Marker for DatabaseUpdater::loadExtensions so we don't
+ // double load extensions
+ define( 'MW_EXTENSIONS_LOADED', true );
+
/**
* We need to include DefaultSettings before including extensions to avoid
* warnings about unset variables. However, the only thing we really