/**
* Clean up from execute()
- * @private.
*/
- function finish() {
+ private function finish() {
$this->output->output();
$this->session['happyPages'] = $this->happyPages;
$this->session['skippedPages'] = $this->skippedPages;
}
/**
- * Output an error box using a Status object
+ * Output an error or warning box using a Status object
*/
- function showStatusErrorBox( $status ) {
- $text = $status->getWikiText();
- $this->output->addHTML( $this->getErrorBox( $text ) );
+ function showStatusBox( $status ) {
+ if( !$status->isGood() ) {
+ $text = $status->getWikiText();
+ if( $status->isOk() ) {
+ $box = $this->getWarningBox( $text );
+ } else {
+ $box = $this->getErrorBox( $text );
+ }
+ $this->output->addHTML( $box );
+ }
}
- function showStatusError( $status ) {
+ function showStatusMessage( $status ) {
$text = $status->getWikiText();
$this->output->addWikiText(
"<div class=\"config-message\">\n" .
$this->setVar( '_UpgradeDone', false );
return 'continue';
} else {
- $this->parent->showStatusErrorBox( $status );
+ $this->parent->showStatusBox( $status );
}
}
} elseif ( $status->isGood() ) {
return 'continue';
} else {
- $this->parent->showStatusErrorBox( $status );
+ $this->parent->showStatusBox( $status );
}
}
$this->parent->getFieldsetEnd()
);
- $caches = array( 'none', 'anything', 'db' );
- $selected = 'db';
+ $caches = array( 'none' );
if( count( $this->getVar( '_Caches' ) ) ) {
$caches[] = 'accel';
$selected = 'accel';
}
$this->startForm();
$this->addHTML("<ul>");
- foreach( $this->parent->getInstallSteps() as $step ) {
+ foreach( $this->parent->getInstallSteps() as $stepObj ) {
+ $step = is_array( $stepObj ) ? $stepObj['name'] : $stepObj;
$this->startStage( "config-install-$step" );
- $func = 'install' . ucfirst( $step );
- $status = $this->parent->{$func}();
+ $status = null;
+
+ # Call our working function
+ if ( is_array( $step ) ) {
+ # A custom callaback
+ $callback = $stepObj['callback'];
+ $status = call_user_func_array( $callback, array() );
+ } else {
+ # Boring implicitly named callback
+ $func = 'install' . ucfirst( $step );
+ $status = $this->parent->{$func}();
+ }
+
$ok = $status->isGood();
if ( !$ok ) {
- $this->parent->showStatusErrorBox( $status );
+ $this->parent->showStatusBox( $status );
}
$this->endStage( $ok );
}