Index: branches/new-installer/phase3/skins/common/config.js |
— | — | @@ -27,6 +27,9 @@ |
28 | 28 | } |
29 | 29 | } ); |
30 | 30 | |
| 31 | + // Scroll to the bottom of upgrade log |
| 32 | + $( "#config-update-log" ).each( function() { this.scrollTop = this.scrollHeight; } ); |
| 33 | + |
31 | 34 | // Show/hide Creative Commons thingy |
32 | 35 | $( '.licenseRadio' ).click( function() { |
33 | 36 | var $wrapper = $( '#config-cc-wrapper' ); |
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php |
— | — | @@ -81,6 +81,7 @@ |
82 | 82 | if ( isset( $session['settings'] ) ) { |
83 | 83 | $this->settings = $session['settings'] + $this->settings; |
84 | 84 | } |
| 85 | + $this->exportVars(); |
85 | 86 | $this->setupLanguage(); |
86 | 87 | |
87 | 88 | if ( isset( $session['happyPages'] ) ) { |
— | — | @@ -1058,7 +1059,17 @@ |
1059 | 1060 | } |
1060 | 1061 | |
1061 | 1062 | if ( $this->parent->request->wasPosted() ) { |
1062 | | - if ( true || $installer->doUpgrade() ) { |
| 1063 | + $this->addHTML( |
| 1064 | + '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' . |
| 1065 | + '<script>jQuery( "#config-spinner" )[0].style.display = "block";</script>' . |
| 1066 | + '<textarea id="config-update-log" name="UpdateLog" rows="10" readonly="readonly">' |
| 1067 | + ); |
| 1068 | + $this->parent->output->flush(); |
| 1069 | + $result = $installer->doUpgrade(); |
| 1070 | + $this->addHTML( '</textarea> |
| 1071 | +<script>jQuery( "#config-spinner" )[0].style.display = "none";</script>' ); |
| 1072 | + $this->parent->output->flush(); |
| 1073 | + if ( $result ) { |
1063 | 1074 | $this->setVar( '_UpgradeDone', true ); |
1064 | 1075 | $this->showDoneMessage(); |
1065 | 1076 | return 'output'; |
— | — | @@ -1559,7 +1570,6 @@ |
1560 | 1571 | return 'continue'; |
1561 | 1572 | } |
1562 | 1573 | $this->startForm(); |
1563 | | - $this->parent->exportVars(); |
1564 | 1574 | $this->addHTML("<ul>"); |
1565 | 1575 | foreach( $this->parent->getInstallSteps() as $step ) { |
1566 | 1576 | $this->startStage( "config-install-$step" ); |
Index: branches/new-installer/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -137,6 +137,20 @@ |
138 | 138 | return $this->populateInterwikiTable( $this->db ); |
139 | 139 | } |
140 | 140 | |
| 141 | + function doUpgrade() { |
| 142 | + global $wgDatabase; |
| 143 | + LBFactory::enableBackend(); |
| 144 | + $wgDatabase = wfGetDB( DB_MASTER ); |
| 145 | + ob_start( array( 'SqliteInstaller', 'outputHandler' ) ); |
| 146 | + do_all_updates( false, true ); |
| 147 | + ob_end_flush(); |
| 148 | + return true; |
| 149 | + } |
| 150 | + |
| 151 | + static function outputHandler( $string ) { |
| 152 | + return htmlspecialchars( $string ); |
| 153 | + } |
| 154 | + |
141 | 155 | function getLocalSettings() { |
142 | 156 | $dir = LocalSettings::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) ); |
143 | 157 | return |
Index: branches/new-installer/phase3/includes/installer/InstallerDBType.php |
— | — | @@ -89,6 +89,14 @@ |
90 | 90 | abstract function createTables(); |
91 | 91 | |
92 | 92 | /** |
| 93 | + * Perform database upgrades |
| 94 | + * @todo make abstract |
| 95 | + */ |
| 96 | + /*abstract*/ function doUpgrade() { |
| 97 | + return false; |
| 98 | + } |
| 99 | + |
| 100 | + /** |
93 | 101 | * Return any table options to be applied to all tables that don't |
94 | 102 | * override them |
95 | 103 | * @return Array |
Index: branches/new-installer/phase3/config/new-index.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | |
21 | 21 | chdir( ".." ); |
22 | 22 | require( './includes/WebStart.php' ); |
| 23 | +require_once( './maintenance/updaters.inc' ); // sigh... |
23 | 24 | |
24 | 25 | // Disable the i18n cache and LoadBalancer |
25 | 26 | Language::getLocalisationCache()->disableBackend(); |