* @file
* @ingroup Deployment
*/
+
+use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\LBFactorySingle;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
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 ) {
}
try {
+ /** @var DatabaseMssql $db */
$db = Database::factory( 'mssql', [
'host' => $this->getVar( 'wgDBserver' ),
'port' => $this->getVar( 'wgDBport' ),
$status = $this->getConnection();
if ( !$status->isOK() ) {
- $this->parent->showStatusError( $status );
+ $this->parent->showStatusMessage( $status );
return;
}
// 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 = [
'_InstallUser' => 'root',
];
- public $supportedEngines = [ 'InnoDB', 'MyISAM' ];
+ public $supportedEngines = [ 'InnoDB' ];
public static $minimumVersion = '5.5.8';
protected static $notMinimumVersionMessage = 'config-mysql-old';
public function openConnection() {
$status = Status::newGood();
try {
+ /** @var DatabaseMysqlBase $db */
$db = Database::factory( 'mysql', [
'host' => $this->getVar( 'wgDBserver' ),
'user' => $this->getVar( '_InstallUser' ),
$status = $this->getConnection();
if ( !$status->isOK() ) {
- $this->parent->showStatusError( $status );
+ $this->parent->showStatusMessage( $status );
return;
}
$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 ) ) {
"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.",
"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}}",