Index: trunk/phase3/maintenance/install.php |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' ); |
| 31 | +define( 'MEDIAWIKI_INSTALL', true ); |
31 | 32 | |
32 | 33 | require_once( dirname( dirname( __FILE__ ) )."/maintenance/Maintenance.php" ); |
33 | 34 | |
Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -73,6 +73,7 @@ |
74 | 74 | } |
75 | 75 | $this->maintenance->setDB( $db ); |
76 | 76 | $this->initOldGlobals(); |
| 77 | + $this->loadExtensions(); |
77 | 78 | wfRunHooks( 'LoadExtensionSchemaUpdates', array( $this ) ); |
78 | 79 | } |
79 | 80 | |
— | — | @@ -95,6 +96,25 @@ |
96 | 97 | } |
97 | 98 | |
98 | 99 | /** |
| 100 | + * Loads LocalSettings.php, if needed, and initialises everything needed for LoadExtensionSchemaUpdates hook |
| 101 | + */ |
| 102 | + private function loadExtensions() { |
| 103 | + if ( !defined( 'MEDIAWIKI_INSTALL' ) ) { |
| 104 | + return; // already loaded |
| 105 | + } |
| 106 | + $vars = Installer::getExistingLocalSettings(); |
| 107 | + if ( !$vars ) { |
| 108 | + return; // no LocalSettings found |
| 109 | + } |
| 110 | + if ( !isset( $vars['wgHooks'] ) && !isset( $vars['wgHooks']['LoadExtensionSchemaUpdates'] ) ) { |
| 111 | + return; |
| 112 | + } |
| 113 | + global $wgHooks, $wgAutoloadClasses; |
| 114 | + $wgHooks['LoadExtensionSchemaUpdates'] = $vars['wgHooks']['LoadExtensionSchemaUpdates']; |
| 115 | + $wgAutoloadClasses = $wgAutoloadClasses + $vars['wgAutoloadClasses']; |
| 116 | + } |
| 117 | + |
| 118 | + /** |
99 | 119 | * @throws MWException |
100 | 120 | * @param DatabaseBase $db |
101 | 121 | * @param bool $shared |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -456,7 +456,7 @@ |
457 | 457 | * |
458 | 458 | * @return Array |
459 | 459 | */ |
460 | | - public function getExistingLocalSettings() { |
| 460 | + public static function getExistingLocalSettings() { |
461 | 461 | global $IP; |
462 | 462 | |
463 | 463 | wfSuppressWarnings(); |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | class WebInstaller_ExistingWiki extends WebInstallerPage { |
230 | 230 | public function execute() { |
231 | 231 | // If there is no LocalSettings.php, continue to the installer welcome page |
232 | | - $vars = $this->parent->getExistingLocalSettings(); |
| 232 | + $vars = Installer::getExistingLocalSettings(); |
233 | 233 | if ( !$vars ) { |
234 | 234 | return 'skip'; |
235 | 235 | } |