Merge "Remove broken test."
[lhc/web/wiklou.git] / includes / installer / DatabaseInstaller.php
index 046fa16..75ede23 100644 (file)
@@ -2,6 +2,21 @@
 /**
  * DBMS-specific installation helper.
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @file
  * @ingroup Deployment
  */
@@ -254,14 +269,15 @@ abstract class DatabaseInstaller {
 
                $ret = true;
                ob_start( array( $this, 'outputHandler' ) );
+               $up = DatabaseUpdater::newForDB( $this->db );
                try {
-                       $up = DatabaseUpdater::newForDB( $this->db );
                        $up->doUpdates();
                } catch ( MWException $e ) {
-                       echo "\nAn error occured:\n";
+                       echo "\nAn error occurred:\n";
                        echo $e->getText();
                        $ret = false;
                }
+               $up->purgeCache();
                ob_end_flush();
                return $ret;
        }
@@ -319,7 +335,7 @@ abstract class DatabaseInstaller {
         * @return String
         */
        public function getReadableName() {
-               return wfMsg( 'config-type-' . $this->getName() );
+               return wfMessage( 'config-type-' . $this->getName() )->text();
        }
 
        /**
@@ -494,7 +510,7 @@ abstract class DatabaseInstaller {
        public function getInstallUserBox() {
                return
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-install-account' )->text() ) .
                        $this->getTextBox( '_InstallUser', 'config-db-username', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-username' ) ) .
                        $this->getPasswordBox( '_InstallPassword', 'config-db-password', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-password' ) ) .
                        Html::closeElement( 'fieldset' );
@@ -519,7 +535,7 @@ abstract class DatabaseInstaller {
        public function getWebUserBox( $noCreateMsg = false ) {
                $wrapperStyle = $this->getVar( '_SameAccount' ) ? 'display: none' : '';
                $s = Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-web-account' )->text() ) .
                        $this->getCheckBox(
                                '_SameAccount', 'config-db-web-account-same',
                                array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' )
@@ -529,7 +545,7 @@ abstract class DatabaseInstaller {
                        $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) .
                        $this->parent->getHelpBox( 'config-db-web-help' );
                if ( $noCreateMsg ) {
-                       $s .= $this->parent->getWarningBox( wfMsgNoTrans( $noCreateMsg ) );
+                       $s .= $this->parent->getWarningBox( wfMessage( $noCreateMsg )->plain() );
                } else {
                        $s .= $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create' );
                }