diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:47 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:47 -0400 |
commit | 7e85254903c7c0cb49e381f16b18441ea7b058cc (patch) | |
tree | b22328fcf4c8408fc25a7acb73d1cb1089cd82ac /includes/installer | |
parent | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (diff) | |
parent | 1a365e77dfb8825136626202b1df462731b42060 (diff) |
Merge commit '1a365e'
Diffstat (limited to 'includes/installer')
-rw-r--r-- | includes/installer/DatabaseUpdater.php | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 702f850c..70707901 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -145,15 +145,26 @@ abstract class DatabaseUpdater { return; // already loaded } $vars = Installer::getExistingLocalSettings(); - if ( !$vars ) { - return; // no LocalSettings found + + $registry = ExtensionRegistry::getInstance(); + $queue = $registry->getQueue(); + // Don't accidentally load extensions in the future + $registry->clearQueue(); + + // This will automatically add "AutoloadClasses" to $wgAutoloadClasses + $data = $registry->readFromQueue( $queue ); + $hooks = array( 'wgHooks' => array( 'LoadExtensionSchemaUpdates' => array() ) ); + if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) { + $hooks = $data['globals']['wgHooks']['LoadExtensionSchemaUpdates']; } - if ( !isset( $vars['wgHooks'] ) || !isset( $vars['wgHooks']['LoadExtensionSchemaUpdates'] ) ) { - return; + if ( $vars && isset( $vars['wgHooks']['LoadExtensionSchemaUpdates'] ) ) { + $hooks = array_merge_recursive( $hooks, $vars['wgHooks']['LoadExtensionSchemaUpdates'] ); } global $wgHooks, $wgAutoloadClasses; - $wgHooks['LoadExtensionSchemaUpdates'] = $vars['wgHooks']['LoadExtensionSchemaUpdates']; - $wgAutoloadClasses = $wgAutoloadClasses + $vars['wgAutoloadClasses']; + $wgHooks['LoadExtensionSchemaUpdates'] = $hooks; + if ( $vars && isset( $vars['wgAutoloadClasses'] ) ) { + $wgAutoloadClasses += $vars['wgAutoloadClasses']; + } } /** |