Revert "Generalize Installer::showStatusMessage()"
authorLegoktm <legoktm.wikipedia@gmail.com>
Mon, 21 Jul 2014 08:31:09 +0000 (08:31 +0000)
committerLegoktm <legoktm.wikipedia@gmail.com>
Fri, 25 Jul 2014 01:38:06 +0000 (01:38 +0000)
We probably want to put errors on top in the web installer
and warnings on top in the CLI installer due to differences
in scrolling.

This reverts commit 1c1e321af7977722073116fb6846f494502f6805.

Change-Id: I247030f0a3da6dff44884f4a282e52e92657fd91

includes/installer/CliInstaller.php
includes/installer/Installer.php
includes/installer/WebInstaller.php

index c6939a8..1c7762b 100644 (file)
@@ -179,11 +179,16 @@ class CliInstaller extends Installer {
        public function showHelpBox( $msg /*, ... */ ) {
        }
 
-       /**
-        * @param Status $status
-        */
        public function showStatusMessage( Status $status ) {
-               parent::showStatusMessage( $status );
+               $warnings = array_merge( $status->getWarningsArray(),
+                       $status->getErrorsArray() );
+
+               if ( count( $warnings ) !== 0 ) {
+                       foreach ( $warnings as $w ) {
+                               call_user_func_array( array( $this, 'showMessage' ), $w );
+                       }
+               }
+
                if ( !$status->isOk() ) {
                        echo "\n";
                        exit( 1 );
index 0294c42..3372119 100644 (file)
@@ -352,17 +352,10 @@ abstract class Installer {
        abstract public function showError( $msg /*, ... */ );
 
        /**
-        * Shows messages to the user through a Status object
+        * Show a message to the installing user by using a Status object
         * @param Status $status
         */
-       public function showStatusMessage( Status $status ) {
-               $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
-               if ( $errors ) {
-                       foreach ( $errors as $error ) {
-                               call_user_func( 'showMessage', $error );
-                       }
-               }
-       }
+       abstract public function showStatusMessage( Status $status );
 
        /**
         * Constructor, always call this from child classes.
index 3515469..a6e9e33 100644 (file)
@@ -729,6 +729,16 @@ class WebInstaller extends Installer {
                $this->output->addHTML( $html );
        }
 
+       /**
+        * @param Status $status
+        */
+       public function showStatusMessage( Status $status ) {
+               $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
+               foreach ( $errors as $error ) {
+                       call_user_func_array( array( $this, 'showMessage' ), $error );
+               }
+       }
+
        /**
         * Label a control by wrapping a config-input div around it and putting a
         * label before it.