'config-mysql-engine' => 'Storage engine:',
'config-mysql-innodb' => 'InnoDB',
'config-mysql-myisam' => 'MyISAM',
+ 'config-mysql-myisam-dep' => "'''Warning''': You have selected MyISAM. MyISAM is not recommended for use with MediaWiki, because:
+* it barely supports concurrency due to table locking
+* it is more prone to corruption than other engines
+* the MediaWiki codebase does not always handle MyISAM as it should
+* probably other reasons...
+
+If your MySQL installation supports InnoDB, it is highly recommended that you choose that instead.
+If your MySQL installation does not support InnoDB, maybe its time for an upgrade.
+",
'config-mysql-engine-help' => "'''InnoDB''' is almost always the best option, since it has good concurrency support.
'''MyISAM''' may be faster in single-user or read-only installations.
if ( !in_array( $this->getVar( '_MysqlEngine' ), $engines ) ) {
$this->setVar( '_MysqlEngine', reset( $engines ) );
}
+
+ $s .= Xml::openElement( 'div', array(
+ 'id' => 'dbMyisamWarning'
+ ));
+ $s .= $this->parent->getWarningBox( wfMsg( 'config-mysql-myisam-dep' ) );
+ $s .= Xml::closeElement( 'div' );
+
+ if( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) {
+ $s .= Xml::openElement( 'script', array( 'type' => 'text/javascript' ) );
+ $s .= '$(\'#dbMyisamWarning\').hide();';
+ $s .= Xml::closeElement( 'script' );
+ }
+
if ( count( $engines ) >= 2 ) {
$s .= $this->getRadioSet( array(
'var' => '_MysqlEngine',
'label' => 'config-mysql-engine',
'itemLabelPrefix' => 'config-mysql-',
- 'values' => $engines
- ));
+ 'values' => $engines,
+ 'itemAttribs' => array(
+ 'MyISAM' => array(
+ 'class' => 'showHideRadio',
+ 'rel' => 'dbMyisamWarning'),
+ 'InnoDB' => array(
+ 'class' => 'hideShowRadio',
+ 'rel' => 'dbMyisamWarning')
+ )));
$s .= $this->parent->getHelpBox( 'config-mysql-engine-help' );
}