}
$this->maintenance->setDB( $db );
$this->initOldGlobals();
+ $this->loadExtensions();
wfRunHooks( 'LoadExtensionSchemaUpdates', array( $this ) );
}
$wgExtModifiedFields = array(); // table, index, dir
}
+ /**
+ * Loads LocalSettings.php, if needed, and initialises everything needed for LoadExtensionSchemaUpdates hook
+ */
+ private function loadExtensions() {
+ if ( !defined( 'MEDIAWIKI_INSTALL' ) ) {
+ return; // already loaded
+ }
+ $vars = Installer::getExistingLocalSettings();
+ if ( !$vars ) {
+ return; // no LocalSettings found
+ }
+ if ( !isset( $vars['wgHooks'] ) && !isset( $vars['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
+ return;
+ }
+ global $wgHooks, $wgAutoloadClasses;
+ $wgHooks['LoadExtensionSchemaUpdates'] = $vars['wgHooks']['LoadExtensionSchemaUpdates'];
+ $wgAutoloadClasses = $wgAutoloadClasses + $vars['wgAutoloadClasses'];
+ }
+
/**
* @throws MWException
* @param DatabaseBase $db
class WebInstaller_ExistingWiki extends WebInstallerPage {
public function execute() {
// If there is no LocalSettings.php, continue to the installer welcome page
- $vars = $this->parent->getExistingLocalSettings();
+ $vars = Installer::getExistingLocalSettings();
if ( !$vars ) {
return 'skip';
}
}
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
+define( 'MEDIAWIKI_INSTALL', true );
require_once( dirname( dirname( __FILE__ ) )."/maintenance/Maintenance.php" );