r65155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65154‎ | r65155 | r65156 >
Date:08:48, 17 April 2010
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
new-installer: Fugly, sketchy, but working SQLite updater. Due to WebInstallerOutput::flush() not working, will display nothing for the duration of upgrades.
Modified paths:
  • /branches/new-installer/phase3/config/new-index.php (modified) (history)
  • /branches/new-installer/phase3/includes/installer/InstallerDBType.php (modified) (history)
  • /branches/new-installer/phase3/includes/installer/SqliteInstaller.php (modified) (history)
  • /branches/new-installer/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /branches/new-installer/phase3/skins/common/config.js (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/skins/common/config.js
@@ -27,6 +27,9 @@
2828 }
2929 } );
3030
 31+ // Scroll to the bottom of upgrade log
 32+ $( "#config-update-log" ).each( function() { this.scrollTop = this.scrollHeight; } );
 33+
3134 // Show/hide Creative Commons thingy
3235 $( '.licenseRadio' ).click( function() {
3336 var $wrapper = $( '#config-cc-wrapper' );
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
@@ -81,6 +81,7 @@
8282 if ( isset( $session['settings'] ) ) {
8383 $this->settings = $session['settings'] + $this->settings;
8484 }
 85+ $this->exportVars();
8586 $this->setupLanguage();
8687
8788 if ( isset( $session['happyPages'] ) ) {
@@ -1058,7 +1059,17 @@
10591060 }
10601061
10611062 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 ) {
10631074 $this->setVar( '_UpgradeDone', true );
10641075 $this->showDoneMessage();
10651076 return 'output';
@@ -1559,7 +1570,6 @@
15601571 return 'continue';
15611572 }
15621573 $this->startForm();
1563 - $this->parent->exportVars();
15641574 $this->addHTML("<ul>");
15651575 foreach( $this->parent->getInstallSteps() as $step ) {
15661576 $this->startStage( "config-install-$step" );
Index: branches/new-installer/phase3/includes/installer/SqliteInstaller.php
@@ -137,6 +137,20 @@
138138 return $this->populateInterwikiTable( $this->db );
139139 }
140140
 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+
141155 function getLocalSettings() {
142156 $dir = LocalSettings::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
143157 return
Index: branches/new-installer/phase3/includes/installer/InstallerDBType.php
@@ -89,6 +89,14 @@
9090 abstract function createTables();
9191
9292 /**
 93+ * Perform database upgrades
 94+ * @todo make abstract
 95+ */
 96+ /*abstract*/ function doUpgrade() {
 97+ return false;
 98+ }
 99+
 100+ /**
93101 * Return any table options to be applied to all tables that don't
94102 * override them
95103 * @return Array
Index: branches/new-installer/phase3/config/new-index.php
@@ -19,6 +19,7 @@
2020
2121 chdir( ".." );
2222 require( './includes/WebStart.php' );
 23+require_once( './maintenance/updaters.inc' ); // sigh...
2324
2425 // Disable the i18n cache and LoadBalancer
2526 Language::getLocalisationCache()->disableBackend();

Follow-up revisions

RevisionCommit summaryAuthorDate
r84973using jQuery hide() and show() instead of accessing the dom element directly ...krinkle18:36, 29 March 2011

Comments

#Comment by 😂 (talk | contribs)   22:44, 18 October 2010

This is so much nicer now ;-)

Status & tagging log