Merge "(bug 34211) Initial focus on Special:Block is nowhere"
[lhc/web/wiklou.git] / includes / installer / DatabaseInstaller.php
index 2cc539b..10d23fb 100644 (file)
@@ -62,12 +62,12 @@ abstract class DatabaseInstaller {
        /**
         * Return the internal name, e.g. 'mysql', or 'sqlite'.
         */
-       public abstract function getName();
+       abstract public function getName();
 
        /**
         * @return bool Returns true if the client library is compiled in.
         */
-       public abstract function isCompiled();
+       abstract public function isCompiled();
 
        /**
         * Checks for installation prerequisites other than those checked by isCompiled()
@@ -85,7 +85,7 @@ abstract class DatabaseInstaller {
         *
         * If this is called, $this->parent can be assumed to be a WebInstaller.
         */
-       public abstract function getConnectForm();
+       abstract public function getConnectForm();
 
        /**
         * Set variables based on the request array, assuming it was submitted
@@ -96,7 +96,7 @@ abstract class DatabaseInstaller {
         *
         * @return Status
         */
-       public abstract function submitConnectForm();
+       abstract public function submitConnectForm();
 
        /**
         * Get HTML for a web form that retrieves settings used for installation.
@@ -127,7 +127,7 @@ abstract class DatabaseInstaller {
         *
         * @return Status
         */
-       public abstract function openConnection();
+       abstract public function openConnection();
 
        /**
         * Create the database and return a Status object indicating success or
@@ -135,7 +135,7 @@ abstract class DatabaseInstaller {
         *
         * @return Status
         */
-       public abstract function setupDatabase();
+       abstract public function setupDatabase();
 
        /**
         * Connect to the database using the administrative user/password currently
@@ -218,7 +218,7 @@ abstract class DatabaseInstaller {
         *
         * @return String
         */
-       public abstract function getLocalSettings();
+       abstract public function getLocalSettings();
 
        /**
         * Override this to provide DBMS-specific schema variables, to be
@@ -240,7 +240,7 @@ abstract class DatabaseInstaller {
                if ( $status->isOK() ) {
                        $status->value->setSchemaVars( $this->getSchemaVars() );
                } else {
-                       throw new MWException( __METHOD__.': unexpected DB connection error' );
+                       throw new MWException( __METHOD__ . ': unexpected DB connection error' );
                }
        }
 
@@ -252,7 +252,7 @@ abstract class DatabaseInstaller {
        public function enableLB() {
                $status = $this->getConnection();
                if ( !$status->isOK() ) {
-                       throw new MWException( __METHOD__.': unexpected DB connection error' );
+                       throw new MWException( __METHOD__ . ': unexpected DB connection error' );
                }
                LBFactory::setInstance( new LBFactory_Single( array(
                        'connection' => $status->value ) ) );
@@ -269,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;
        }
@@ -334,7 +335,7 @@ abstract class DatabaseInstaller {
         * @return String
         */
        public function getReadableName() {
-               return wfMsg( 'config-type-' . $this->getName() );
+               return wfMessage( 'config-type-' . $this->getName() )->text();
        }
 
        /**
@@ -509,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' );
@@ -534,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' )
@@ -544,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' );
                }