/**
* Do all the updates
*
+ * @param $what Array: what updates to perform
* @param $purge Boolean: whether to clear the objectcache table after updates
*/
- public function doUpdates( $purge = true ) {
+ public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
global $wgVersion;
- $this->runUpdates( $this->getCoreUpdateList(), false );
- $this->runUpdates( $this->getOldGlobalUpdates(), false );
- $this->runUpdates( $this->getExtensionUpdates(), true );
+ $what = array_flip( $what );
+ if ( isset( $what['core'] ) ) {
+ $this->runUpdates( $this->getCoreUpdateList(), false );
+ }
+ if ( isset( $what['extensions'] ) ) {
+ $this->runUpdates( $this->getOldGlobalUpdates(), false );
+ $this->runUpdates( $this->getExtensionUpdates(), true );
+ }
$this->setAppliedUpdates( $wgVersion, $this->updates );
- if( $purge ) {
+ if( isset( $what['purge'] ) ) {
$this->purgeCache();
}
- $this->checkStats();
+ if ( isset( $what['core'] ) ) {
+ $this->checkStats();
+ }
}
/**
protected function getFieldsetEnd() {
return "</fieldset>\n";
}
+
+ /**
+ * Opens a textarea used to display the progress of a long operation
+ */
+ protected function startLiveBox() {
+ $this->addHTML(
+ '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
+ '<script>jQuery( "#config-spinner" ).show();</script>' .
+ '<textarea id="config-live-log" name="LiveLog" rows="10" cols="30" readonly="readonly">'
+ );
+ $this->parent->output->flush();
+ }
+
+ /**
+ * Opposite to startLiveBox()
+ */
+ protected function endLiveBox() {
+ $this->addHTML( '</textarea>
+<script>jQuery( "#config-spinner" ).hide()</script>' );
+ $this->parent->output->flush();
+ }
}
class WebInstaller_Language extends WebInstallerPage {
if ( $this->parent->request->wasPosted() ) {
$installer->preUpgrade();
- $this->addHTML(
- '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
- '<script>jQuery( "#config-spinner" ).show();</script>' .
- '<textarea id="config-update-log" name="UpdateLog" rows="10" readonly="readonly">'
- );
- $this->parent->output->flush();
+
+ $this->startLiveBox();
$result = $installer->doUpgrade();
- $this->addHTML( '</textarea>
-<script>jQuery( "#config-spinner" ).hide()</script>' );
- $this->parent->output->flush();
+ $this->endLiveBox();
+
if ( $result ) {
// If they're going to possibly regenerate LocalSettings, we
// need to create the upgrade/secret keys. Bug 26481
public function startStage( $step ) {
$this->addHTML( "<li>" . wfMsgHtml( "config-install-$step" ) . wfMsg( 'ellipsis') );
+ if ( $step == 'extension-tables' ) {
+ $this->startLiveBox();
+ }
}
public function endStage( $step, $status ) {
+ if ( $step == 'extension-tables' ) {
+ $this->endLiveBox();
+ }
$msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed';
$html = wfMsgHtml( 'word-separator' ) . wfMsgHtml( $msg );
if ( !$status->isOk() ) {