installer: Stop offering MyISAM option for new installs and fix bogus method calls
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 29 Jun 2019 07:58:02 +0000 (00:58 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 21 Jul 2019 01:19:17 +0000 (18:19 -0700)
The methods were renamed in 2010 (r68908, c4100fb83b5b12bd).

Change-Id: I076ec8d9c11f5bd33cb0ad19e5be8e239401b9c6

includes/installer/DatabaseInstaller.php
includes/installer/MssqlInstaller.php
includes/installer/MysqlInstaller.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json

index f947979..ba5da6d 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  * @ingroup Deployment
  */
+
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\LBFactorySingle;
 use Wikimedia\Rdbms\Database;
 use Wikimedia\Rdbms\IDatabase;
@@ -359,8 +361,8 @@ abstract class DatabaseInstaller {
                        throw new MWException( __METHOD__ . ': unexpected DB connection error' );
                }
 
-               \MediaWiki\MediaWikiServices::resetGlobalInstance();
-               $services = \MediaWiki\MediaWikiServices::getInstance();
+               MediaWikiServices::resetGlobalInstance();
+               $services = MediaWikiServices::getInstance();
 
                $connection = $status->value;
                $services->redefineService( 'DBLoadBalancerFactory', function () use ( $connection ) {
index ffa17ed..8b5ff11 100644 (file)
@@ -212,6 +212,7 @@ class MssqlInstaller extends DatabaseInstaller {
                }
 
                try {
+                       /** @var DatabaseMssql $db */
                        $db = Database::factory( 'mssql', [
                                'host' => $this->getVar( 'wgDBserver' ),
                                'port' => $this->getVar( 'wgDBport' ),
@@ -236,7 +237,7 @@ class MssqlInstaller extends DatabaseInstaller {
 
                $status = $this->getConnection();
                if ( !$status->isOK() ) {
-                       $this->parent->showStatusError( $status );
+                       $this->parent->showStatusMessage( $status );
 
                        return;
                }
@@ -594,7 +595,7 @@ class MssqlInstaller extends DatabaseInstaller {
 
                // Try to grant to all the users we know exist or we were able to create
                $this->db->selectDB( $dbName );
-               foreach ( $grantableNames as $name ) {
+               if ( $grantableNames ) {
                        try {
                                // First try to grant full permissions
                                $fullPrivArr = [
index 3013db7..69d03bd 100644 (file)
@@ -48,7 +48,7 @@ class MysqlInstaller extends DatabaseInstaller {
                '_InstallUser' => 'root',
        ];
 
-       public $supportedEngines = [ 'InnoDB', 'MyISAM' ];
+       public $supportedEngines = [ 'InnoDB' ];
 
        public static $minimumVersion = '5.5.8';
        protected static $notMinimumVersionMessage = 'config-mysql-old';
@@ -142,6 +142,7 @@ class MysqlInstaller extends DatabaseInstaller {
        public function openConnection() {
                $status = Status::newGood();
                try {
+                       /** @var DatabaseMysqlBase $db */
                        $db = Database::factory( 'mysql', [
                                'host' => $this->getVar( 'wgDBserver' ),
                                'user' => $this->getVar( '_InstallUser' ),
@@ -162,7 +163,7 @@ class MysqlInstaller extends DatabaseInstaller {
 
                $status = $this->getConnection();
                if ( !$status->isOK() ) {
-                       $this->parent->showStatusError( $status );
+                       $this->parent->showStatusMessage( $status );
 
                        return;
                }
@@ -364,45 +365,6 @@ class MysqlInstaller extends DatabaseInstaller {
                        $this->setVar( '_MysqlEngine', reset( $engines ) );
                }
 
-               $s .= Xml::openElement( 'div', [
-                       'id' => 'dbMyisamWarning'
-               ] );
-               $myisamWarning = 'config-mysql-myisam-dep';
-               if ( count( $engines ) === 1 ) {
-                       $myisamWarning = 'config-mysql-only-myisam-dep';
-               }
-               $s .= $this->parent->getWarningBox( wfMessage( $myisamWarning )->text() );
-               $s .= Xml::closeElement( 'div' );
-
-               if ( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) {
-                       $s .= Xml::openElement( 'script' );
-                       $s .= '$(\'#dbMyisamWarning\').hide();';
-                       $s .= Xml::closeElement( 'script' );
-               }
-
-               if ( count( $engines ) >= 2 ) {
-                       // getRadioSet() builds a set of labeled radio buttons.
-                       // For grep: The following messages are used as the item labels:
-                       // config-mysql-innodb, config-mysql-myisam
-                       $s .= $this->getRadioSet( [
-                               'var' => '_MysqlEngine',
-                               'label' => 'config-mysql-engine',
-                               'itemLabelPrefix' => 'config-mysql-',
-                               'values' => $engines,
-                               'itemAttribs' => [
-                                       'MyISAM' => [
-                                               'class' => 'showHideRadio',
-                                               'rel' => 'dbMyisamWarning'
-                                       ],
-                                       'InnoDB' => [
-                                               'class' => 'hideShowRadio',
-                                               'rel' => 'dbMyisamWarning'
-                                       ]
-                               ]
-                       ] );
-                       $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' );
-               }
-
                // If the current default charset is not supported, use a charset that is
                $charsets = $this->getCharsets();
                if ( !in_array( $this->getVar( '_MysqlCharset' ), $charsets ) ) {
index 52d8d3d..a9da56d 100644 (file)
        "config-db-web-no-create-privs": "The account you specified for installation does not have enough privileges to create an account.\nThe account you specify here must already exist.",
        "config-mysql-engine": "Storage engine:",
        "config-mysql-innodb": "InnoDB (recommended)",
-       "config-mysql-myisam": "MyISAM",
-       "config-mysql-myisam-dep": "<strong>Warning:</strong> You have selected MyISAM as storage engine for MySQL, which is not recommended for use with MediaWiki, because:\n* it barely supports concurrency due to table locking\n* it is more prone to corruption than other engines\n* the MediaWiki codebase does not always handle MyISAM as it should\n\nIf your MySQL installation supports InnoDB, it is highly recommended that you choose that instead.\nIf your MySQL installation does not support InnoDB, maybe it's time for an upgrade.",
-       "config-mysql-only-myisam-dep": "<strong>Warning:</strong> MyISAM is the only available storage engine for MySQL on this machine, and this is not recommended for use with MediaWiki, because:\n* it barely supports concurrency due to table locking\n* it is more prone to corruption than other engines\n* the MediaWiki codebase does not always handle MyISAM as it should\n\nYour MySQL installation does not support InnoDB, maybe it's time for an upgrade.",
        "config-mysql-engine-help": "<strong>InnoDB</strong> is almost always the best option, since it has good concurrency support.\n\n<strong>MyISAM</strong> may be faster in single-user or read-only installations.\nMyISAM databases tend to get corrupted more often than InnoDB databases.",
        "config-mssql-auth": "Authentication type:",
        "config-mssql-install-auth": "Select the authentication type that will be used to connect to the database during the installation process.\nIf you select \"{{int:config-mssql-windowsauth}}\", the credentials of whatever user the webserver is running as will be used.",
index eddee83..039cd26 100644 (file)
        "config-db-web-no-create-privs": "Error message in the MediaWiki installer.",
        "config-mysql-engine": "Field label for MySQL storage engine in the MediaWiki installer.",
        "config-mysql-innodb": "Option for the MySQL storage engine in the MediaWiki installer.",
-       "config-mysql-myisam": "Option for the MySQL storage engine in the MediaWiki installer.",
-       "config-mysql-myisam-dep": "Warning message in the MediaWiki installer when MyISAM is chosen as MySQL storage engine.",
-       "config-mysql-only-myisam-dep": "Used as warning message when mysql does not support the minimum suggested feature set.",
        "config-mysql-engine-help": "Help text in MediaWiki installer with advice for picking a MySQL storage engine.",
        "config-mssql-auth": "Radio button group label.\n\nFollowed by the following radio button labels:\n* {{msg-mw|Config-mssql-sqlauth}}\n* {{msg-mw|Config-mssql-windowsauth}}",
        "config-mssql-install-auth": "Used as the help text for the \"Authentication type\" radio button when typing in database settings for installation.\n\nRefers to {{msg-mw|Config-mssql-windowsauth}}.\n\nSee also:\n* {{msg-mw|Config-mssql-web-auth}}",